|
|
|
@ -20,6 +20,7 @@ import com.gaotao.modules.pda.utils.ResponseData; |
|
|
|
import com.gaotao.modules.purchaseorder.dao.PRHeaderMapper; |
|
|
|
import com.gaotao.modules.purchaseorder.entity.PRHeader; |
|
|
|
import com.gaotao.modules.sys.entity.SysUserEntity; |
|
|
|
import com.gaotao.modules.sys.service.SysMsgService; |
|
|
|
import com.gaotao.modules.toolman.dao.*; |
|
|
|
import com.gaotao.modules.toolman.entity.*; |
|
|
|
import com.gaotao.modules.toolman.query.*; |
|
|
|
@ -72,6 +73,9 @@ public class ToolHeaderServiceImpl implements ToolHeaderService { |
|
|
|
@Autowired |
|
|
|
private BaseService baseService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysMsgService sysMsgService; |
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
public R saveToolDetail1(ToolDetailQuery toolDetailQuery) { |
|
|
|
@ -373,7 +377,7 @@ public class ToolHeaderServiceImpl implements ToolHeaderService { |
|
|
|
public ToolDetail getToolDetail(ToolDetailQuery toolDetailQuery) { |
|
|
|
ToolDetail toolDetail = toolDetailMapper.getToolDetail(toolDetailQuery); |
|
|
|
if (toolDetail == null){ |
|
|
|
throw new XJException("工具实例不存在"); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200200)); |
|
|
|
} |
|
|
|
// 采购入库时需要校验是否 工具分类时否开始 校验 |
|
|
|
if ("Y".equals(toolDetailQuery.getIsPurchase())) { |
|
|
|
@ -382,7 +386,7 @@ public class ToolHeaderServiceImpl implements ToolHeaderService { |
|
|
|
if ("Y".equals(familyData.getInspectFlag())){ |
|
|
|
int count = toolTransHeaderMapper.getToolFile(toolDetailQuery); |
|
|
|
if (count == 0){ |
|
|
|
throw new XJException("该工具分类需要上传检验文件"); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200201)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -662,13 +666,13 @@ public class ToolHeaderServiceImpl implements ToolHeaderService { |
|
|
|
.eq(ReportfilelistUserprinter::getReportid, reportFileVo.getReportId()) |
|
|
|
.eq(ReportfilelistUserprinter::getUserid, user.getUsername()).one(); |
|
|
|
if (userprinter == null) { |
|
|
|
throw new XJException("请维护用户打印机打印机信息!", SysMsgConstant.OBJECT_ID_200005); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200101)); |
|
|
|
} |
|
|
|
if (StringUtils.isEmpty(userprinter.getIpaddress())) { |
|
|
|
throw new XJException("请维护打印机地址!"); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200102)); |
|
|
|
} |
|
|
|
if (StringUtils.isEmpty(userprinter.getNewprintername())) { |
|
|
|
throw new XJException("请维护打印机名称!"); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200103)); |
|
|
|
} |
|
|
|
String printPath = "http://" + userprinter.getIpaddress() + ":" + bartenderPrintServerPath; |
|
|
|
log.info("打印地址:" + printPath); |
|
|
|
@ -698,7 +702,7 @@ public class ToolHeaderServiceImpl implements ToolHeaderService { |
|
|
|
// 获取打印返回结果 |
|
|
|
if (!"200".equals(r.getCode())) { |
|
|
|
log.info("调用错误!" + r.getMsg()); |
|
|
|
throw new XJException("错误信息:" + r.getMsg()); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200104)+ r.getMsg()); |
|
|
|
} else { |
|
|
|
log.info("{},调用成功!", r.getMsg()); |
|
|
|
bool = true; |
|
|
|
@ -734,13 +738,13 @@ public class ToolHeaderServiceImpl implements ToolHeaderService { |
|
|
|
Integer toolDetailCount = toolDetailMapper.getToolDetailCount(toolDetail); |
|
|
|
// 工具存在实例不允许删除 |
|
|
|
if (toolDetailCount > 0) { |
|
|
|
throw new XJException(ResponseEnum.TOOL_DETAIL_EXIST); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200202)); |
|
|
|
} |
|
|
|
// 2.校验工具适用工序 |
|
|
|
Integer routeCount = toolHeaderMapper.getToolRouteList(toolHeaderQuery); |
|
|
|
// 还有使用该工具的工艺路路线 |
|
|
|
if (routeCount > 0) { |
|
|
|
throw new XJException(ResponseEnum.TOOL_ROUTE_EXIST); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200203)); |
|
|
|
} |
|
|
|
// 3.删除工具信息 |
|
|
|
toolHeaderMapper.deleteBySiteAndToolid(toolHeaderQuery); |
|
|
|
@ -764,10 +768,10 @@ public class ToolHeaderServiceImpl implements ToolHeaderService { |
|
|
|
// 校验是否完成对账 |
|
|
|
PoReceiptDetailQuery poReceiptDetail = poReceiptDetailMapper.getPoReceiptDetail(receiptQuery); |
|
|
|
if (poReceiptDetail == null) { |
|
|
|
throw new XJException(ResponseEnum.TOOL_RECEIPT_NOT_FOUND); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200204)); |
|
|
|
} |
|
|
|
if (poReceiptDetail.getArriveQty().intValue() == poReceiptDetail.getInvoiceQty()) { |
|
|
|
throw new XJException(ResponseEnum.TOOL_RECONCILIATION_NOT); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200205)); |
|
|
|
} |
|
|
|
poReceiptDetail.setInspector(userName); |
|
|
|
poReceiptDetail.setInspectionTime(date); |
|
|
|
@ -801,7 +805,7 @@ public class ToolHeaderServiceImpl implements ToolHeaderService { |
|
|
|
locationQuery.setSite(toolDetailQuery.getSite()); |
|
|
|
Location location = locationService.getLocation(locationQuery); |
|
|
|
if (location == null) { |
|
|
|
throw new XJException(ResponseEnum.TOOL_LOCATION_NOT_FOUND); |
|
|
|
throw new XJException(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200206)); |
|
|
|
} |
|
|
|
} |
|
|
|
toolDetailMapper.updateToolDetailInfo(toolDetailQuery); |
|
|
|
|