From af2cb826b94e7b259b2ae2310d98822a0870286c Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 10 Apr 2024 16:05:25 +0800 Subject: [PATCH 1/7] =?UTF-8?q?change=20-=20=E9=87=87=E8=B4=AD=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=8D=95ERP=E6=8E=A5=E5=8F=A3=E3=80=81=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E6=8F=90=E4=BA=A4=E3=80=81=E5=AE=A1=E6=A0=B8ERP?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hw/jindie/config/KingdeeConfig.java | 107 ++++++++ .../controller/KingdeeErpSyncController.java | 87 ++++++- .../service/impl/KingdeeErpService.java | 232 ++++++++++++++++++ 3 files changed, 423 insertions(+), 3 deletions(-) create mode 100644 hw-modules/hw-jindie/src/main/java/com/hw/jindie/config/KingdeeConfig.java create mode 100644 hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpService.java diff --git a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/config/KingdeeConfig.java b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/config/KingdeeConfig.java new file mode 100644 index 00000000..e9630ac0 --- /dev/null +++ b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/config/KingdeeConfig.java @@ -0,0 +1,107 @@ +package com.hw.jindie.config; + +import com.alibaba.fastjson2.JSONObject; +import com.hw.common.core.utils.DateUtils; +import com.kingdee.bos.webapi.sdk.K3CloudApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 金蝶 bean配置 + */ +@Configuration +public class KingdeeConfig { + + @Bean + public K3CloudApi K3CloudApi() { + return new K3CloudApi(); + } + + /** + * 实体主键 + */ + public static Long FID = 0L; + + /** + * 申请日期 + */ + public static String FApplicationDate = DateUtils.getTime(); + + /** + * 申请类型 + */ + public static String FRequestType = "Material"; + + /** + * 采购申请单formId + */ + public static String PUR_Requisition = "PUR_Requisition"; + + + /** + * 京源项目 + */ + public static JSONObject F_TOND_Base = new JSONObject(); + + /** + * 申请组织||需求组织||采购组织 + */ + public static JSONObject FApplicationOrgId = new JSONObject(); + + /** + * 单据类型-单一采购申请单 + */ + public static JSONObject FBillTypeIDPurchase = new JSONObject(); + + /** + * 币别 + */ + public static JSONObject FCurrencyId = new JSONObject(); + + /** + * 汇率类型 + */ + public static JSONObject FExchangeTypeId = new JSONObject(); + + /** + * 京源项目 + */ + public static JSONObject getF_TOND_Base() { + F_TOND_Base.put("FNumber", "001"); + return F_TOND_Base; + } + + /** + * 申请组织||需求组织||采购组织 + */ + public static JSONObject getFApplicationOrgId() { + FApplicationOrgId.put("FNumber", "100"); + return FApplicationOrgId; + } + + /** + * 单据类型-单一采购申请单 + */ + public static JSONObject getFBillTypeIDPurchase() { + FBillTypeIDPurchase.put("FNUMBER", "CGSQD01_SYS"); + return FBillTypeIDPurchase; + } + + /** + * 币别 + */ + public static JSONObject getFCurrencyId() { + FCurrencyId.put("FNumber", "PRE001"); + return FCurrencyId; + } + + /** + * 汇率类型 + */ + public static JSONObject getFExchangeTypeId() { + FExchangeTypeId.put("FNumber", "HLTX01_SYS"); + return FExchangeTypeId; + } + + +} \ No newline at end of file diff --git a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/controller/KingdeeErpSyncController.java b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/controller/KingdeeErpSyncController.java index b40e7dbb..4e837e26 100644 --- a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/controller/KingdeeErpSyncController.java +++ b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/controller/KingdeeErpSyncController.java @@ -1,11 +1,12 @@ package com.hw.jindie.controller; +import com.alibaba.fastjson2.JSONObject; import com.hw.common.core.web.domain.AjaxResult; import com.hw.common.log.annotation.Log; import com.hw.common.log.enums.BusinessType; import com.hw.jindie.service.IKingdeeErpSyncService; +import com.hw.jindie.service.impl.KingdeeErpService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; /** @@ -18,9 +19,13 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/jindie") public class KingdeeErpSyncController { + @Autowired private IKingdeeErpSyncService kingdeeErpSyncService; + @Autowired + private KingdeeErpService kingdeeErpService; + /** * 新增原材料入库记录 */ @@ -28,12 +33,88 @@ public class KingdeeErpSyncController { @Log(title = "物料信息", businessType = BusinessType.INSERT) @GetMapping(("/syncMaterialInfo")) public AjaxResult syncMaterialInfo() { - try{ + try { return AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp()); - }catch(Exception e){ + } catch (Exception e) { e.printStackTrace(); return AjaxResult.error(); } } + + /** + * 单一采购申请单保存->提交->审核 + * + * @param params {"FMaterialId": "040200050162","FMaterialDesc": "UPVC直管","FReqQty": 20} + * @return {"msg": "{"IsSuccess": true,"Errors": [],"SuccessEntitys": [{"Id": "154898","Number": "CGSQ010785","DIndex": 0}]}", "code": 200} + */ + @PostMapping(("/singleSavePurchaseRequisition")) + public AjaxResult singleSavePurchaseRequisition(@RequestBody String params) { + try { + return AjaxResult.success(kingdeeErpService.singleSavePurchaseRequisition(params)); + } catch (Exception e) { + return AjaxResult.error(e.toString()); + } + } + + /** + * ERP通用提交接口 + * + * @param params + * @return + */ + @PostMapping(("/genericCommitInterface")) + public AjaxResult genericCommitInterface(@RequestBody JSONObject params) { + try { + return AjaxResult.success(kingdeeErpService.genericCommitInterface(params)); + } catch (Exception e) { + return AjaxResult.error(e.toString()); + } + } + + /** + * ERP通用审核接口 + * + * @param params + * @return + */ + @PostMapping(("/genericAuditInterface")) + public AjaxResult genericAuditInterface(@RequestBody JSONObject params) { + try { + return AjaxResult.success(kingdeeErpService.genericAuditInterface(params)); + } catch (Exception e) { + return AjaxResult.error(e.toString()); + } + } + + /** + * ERP通用查看接口 + * + * @param params + * @return + */ + @PostMapping(("/genericViewInterface")) + public String genericViewInterface(@RequestBody JSONObject params) { + try { + return kingdeeErpService.genericViewInterface(params); + } catch (Exception e) { + return e.toString(); + } + } + + /** + * 测试组装实体 + * + * @param params + * @return + */ + @PostMapping(("/testAssemblyEntity")) + public String testAssemblyEntity(@RequestBody String params) { + try { + return kingdeeErpService.testAssemblyEntity(params); + } catch (Exception e) { + return e.toString(); + } + } + } diff --git a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpService.java b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpService.java new file mode 100644 index 00000000..8c148f62 --- /dev/null +++ b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpService.java @@ -0,0 +1,232 @@ +package com.hw.jindie.service.impl; + + +import com.alibaba.fastjson2.JSONObject; +import com.alibaba.nacos.shaded.com.google.gson.Gson; +import com.hw.jindie.config.KingdeeConfig; +import com.kingdee.bos.webapi.entity.RepoRet; +import com.kingdee.bos.webapi.entity.RepoStatus; +import com.kingdee.bos.webapi.sdk.K3CloudApi; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; + + +/** + * @Description: 金蝶ERP交互业务处理类 + * @Author : Yinq + * @Date :2024-04-08 14:38 + */ +@Service +public class KingdeeErpService { + + private static final Logger logger = LoggerFactory.getLogger(KingdeeErpService.class); + + private final K3CloudApi client; + + public KingdeeErpService(K3CloudApi client) { + this.client = client; + } + + + /** + * 单一采购申请单保存->提交->审核 + * + * @param params + * @return + */ + public String singleSavePurchaseRequisition(String params) { + Gson gsonParams = new Gson(); + JSONObject objectParams = gsonParams.fromJson(params, JSONObject.class); + JSONObject model = new JSONObject(); + JSONObject FEntity = new JSONObject(); + String FMaterialId = (String) objectParams.get("FMaterialId");//物料编码 +// String FMaterialDesc = (String) objectParams.get("FMaterialDesc");//物料说明 + Double FReqQty = (Double) objectParams.get("FReqQty");//采购数量 + try { + //业务对象标识 + String formId = KingdeeConfig.PUR_Requisition; + //调用接口 + FEntity.put("FRequireOrgId", KingdeeConfig.getFApplicationOrgId()); //需求组织(必填项) + JSONObject FMaterialIdObject = new JSONObject(); + FMaterialIdObject.put("FNumber", FMaterialId); + FEntity.put("FMaterialId", FMaterialIdObject); //物料编码(必填项) + FEntity.put("FPurchaseOrgId", KingdeeConfig.getFApplicationOrgId()); //采购组织(必填项) + JSONObject FUnitId = new JSONObject(); + FUnitId.put("FNumber", "m"); + FEntity.put("FUnitId", FUnitId); //申请单位(必填项) + FEntity.put("FPriceUnitId", FUnitId); //计价单位(必填项) + FEntity.put("FREQSTOCKUNITID", FUnitId); //库存单位(必填项) + FEntity.put("FReqQty", FReqQty); //申请数量 +// FEntity.put("FMaterialDesc", FMaterialDesc); //物料说明 +// FEntity.put("FReceiveOrgId", KingdeeConfig.getFApplicationOrgId()); //收料组织 +// FEntity.put("FApproveQty", FReqQty); //批准数量 +// FEntity.put("FEvaluatePrice", 0.0); //单价 +// FEntity.put("FTAXPRICE", 0.0); //含税单价 +// FEntity.put("FTAXRATE", 0.0); //税率% +// FEntity.put("FPriceUnitQty", FReqQty); //计价数量 +// FEntity.put("FREQSTOCKQTY", FReqQty); //库存单位数量 +// FEntity.put("FLeadTime", 0); //提前期 +// FEntity.put("FSrcBillTypeId", ""); //源单类型 +// FEntity.put("FSrcBillNo", ""); //源单编号 +// FEntity.put("FBaseReqQty", FReqQty); //申请数量 +// FEntity.put("FSalUnitID", FUnitId); //销售单位 +// FEntity.put("FSalQty", FReqQty); //销售数量 +// FEntity.put("FSalBaseQty", FReqQty); //销售基本数量 +// FEntity.put("FIsVmiBusiness", false); //VMI业务 +// FEntity.put("FDEMANDBILLENTRYSEQ", 0); // 需求单据行号 +// FEntity.put("FDEMANDBILLENTRYID", 0); // 需求单据分录内码 + ArrayList entityList = new ArrayList<>(); + entityList.add(FEntity); + model.put("FEntity", entityList); + String saveParams = this.saveGenericAssemblyEntity(model); + String resultJson = client.save(formId, saveParams); +// String resultJson = "{\"Result\":{\"ResponseStatus\":{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":154903,\"Number\":\"CGSQ010788\",\"DIndex\":0}],\"SuccessMessages\":[],\"MsgCode\":0},\"Id\":154903,\"Number\":\"CGSQ010788\",\"NeedReturnData\":[{}]}}"; + + //用于记录结果 + Gson gson = new Gson(); + //对返回结果进行解析和校验 + RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class); + logger.info("singleSavePurchaseRequisition接口调用成功|请求参数:" + saveParams + "|返回结果:" + resultJson); + RepoStatus responseStatus = repoRet.getResult().getResponseStatus(); + if (responseStatus.isIsSuccess()) { + JSONObject json = new JSONObject(); + json.put("formId", KingdeeConfig.PUR_Requisition); + json.put("Ids", repoRet.getResult().getId()); + //采购申请单提交 +// String commitResult = this.genericCommitInterface(json); + //采购申请单审核 +// String auditResult = this.genericAuditInterface(json); + } + return gson.toJson(responseStatus); + } catch (Exception e) { + logger.error("singleSavePurchaseRequisition|params:" + params + "|Exception:" + e); + return e.getMessage(); + } + } + + + /** + * 保存通用组装实体 + * + * @param model 模型 + * @return + */ + public String saveGenericAssemblyEntity(JSONObject model) { + // 组装数据json + JSONObject result = new JSONObject(); + result.put("NeedUpDateFields", new ArrayList<>()); + result.put("NeedReturnFields", new ArrayList<>()); + result.put("IsDeleteEntry", "true"); + result.put("SubSystemId", ""); + result.put("IsVerifyBaseDataField", "false"); + result.put("IsEntryBatchFill", "true"); + result.put("ValidateFlag", "true"); + result.put("NumberSearch", "true"); + result.put("IsAutoAdjustField", "false"); + result.put("InterationFlags", ""); + result.put("IgnoreInterationFlag", ""); + result.put("IsControlPrecision", "false"); + result.put("ValidateRepeatJson", "false"); + + model.put("FID", KingdeeConfig.FID); + model.put("FBillTypeID", KingdeeConfig.getFBillTypeIDPurchase()); //单据类型(必填项) + model.put("FApplicationDate", KingdeeConfig.FApplicationDate); //申请日期(必填项) + model.put("FRequestType", KingdeeConfig.FRequestType); //申请类型(必填项) + model.put("FApplicationOrgId", KingdeeConfig.getFApplicationOrgId()); //申请组织(必填项) + model.put("F_TOND_Base", KingdeeConfig.getF_TOND_Base()); //京源项目(必填项) +// model.put("FCurrencyId", KingdeeConfig.getFCurrencyId()); +// model.put("FExchangeTypeId", KingdeeConfig.getFExchangeTypeId()); +// model.put("FISPRICEEXCLUDETAX", true); //价外税 +// model.put("FIsConvert", false); //是否是单据转换 +// model.put("FACCTYPE", "Q"); //验收方式 +// JSONObject FMobBillHead = new JSONObject(); +// FMobBillHead.put("FIsMobBill", false); +// FMobBillHead.put("FMobIsPending", false); +// model.put("FMobBillHead", FMobBillHead); //移动单据 + + result.put("Model", model); + try { + return result.toJSONString(); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * ERP通用提交接口 + * + * @param params + * @return + */ + public String genericCommitInterface(JSONObject params) throws Exception { + JSONObject requestParams = new JSONObject(); + //业务对象标识 + String formId = params.getString("formId"); + requestParams.put("Ids", params.get("Ids"));//单据内码集合 +// requestParams.put("Numbers", params.get("Numbers"));//单据编码集合 +// requestParams.put("CreateOrgId", 0); +// requestParams.put("IgnoreInterationFlag", ""); +// requestParams.put("InterationFlags", ""); +// requestParams.put("IsVerifyProcInst", "true"); +// requestParams.put("NetworkCtrl", "true"); +// requestParams.put("UseBatControlTimes", "false"); +// requestParams.put("UseOrgId", 0); + //调用接口 + String s = requestParams.toJSONString(); + System.out.println(s); + String submit = client.submit(formId, requestParams.toJSONString()); + logger.error("genericCommitInterface|formId:" + formId + "|请求参数:" + requestParams.toJSONString() + "|返回结果:" + submit); + return submit; + } + + /** + * ERP通用审核接口 + * + * @param params + * @return + */ + public String genericAuditInterface(JSONObject params) throws Exception { + JSONObject requestParams = new JSONObject(); + //业务对象标识 + String formId = params.getString("formId"); + requestParams.put("Ids", params.get("Ids"));//单据内码集合 + //调用接口 + String audit = client.audit(formId, requestParams.toJSONString()); + logger.error("genericAuditInterface|formId:" + formId + "|请求参数:" + requestParams.toJSONString() + "|返回结果:" + audit); + return audit; + } + + /** + * ERP通用查看接口 + * + * @param params + * @return + */ + public String genericViewInterface(JSONObject params) throws Exception { + JSONObject requestParams = new JSONObject(); + //业务对象标识 + String formId = params.getString("formId"); + requestParams.put("Id", params.get("Id"));//单据内码集合 + //调用接口 + String audit = client.view(formId, requestParams.toJSONString()); + System.out.println(("genericAuditInterface|formId:" + formId + "|请求参数:" + requestParams.toJSONString() + "|返回结果:" + audit)); + return audit; + } + + /** + * 测试组装实体 + * + * @param params + * @return + */ + public String testAssemblyEntity(String params) { + JSONObject model = new JSONObject(); + String result = this.saveGenericAssemblyEntity(model); + System.out.println(result); + return result; + } +} From aaadc09d0079ced3379dbc0fb58aa129cba5ad1d Mon Sep 17 00:00:00 2001 From: xins Date: Wed, 10 Apr 2024 17:59:09 +0800 Subject: [PATCH 2/7] =?UTF-8?q?2.0.2=20=E8=BD=A6=E9=97=B4=EF=BC=9A=201?= =?UTF-8?q?=E3=80=81=E4=B8=80=E6=A5=BC=E6=89=AB=E6=8F=8F=E7=89=A9=E6=96=99?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E4=BD=BF=E7=94=A8=E3=80=81=E4=B8=80=E6=A5=BC?= =?UTF-8?q?=E6=88=90=E5=93=81=E5=85=A5=E5=BA=93=202=E3=80=81=E5=9B=9B?= =?UTF-8?q?=E6=A5=BC=E6=89=AB=E6=8F=8F=E7=89=A9=E6=96=99=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=92=8C=E5=9B=9B=E6=A5=BC=E6=88=90=E5=93=81?= =?UTF-8?q?=E5=85=A5=E5=BA=93=203=E3=80=81=E4=BA=94=E6=A5=BC=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E9=A2=86=E6=96=99=E3=80=81=E6=9F=9C=E4=BD=93=E7=BB=91?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MesProductPlanDetailServiceImpl.java | 8 +- .../hw/wms/controller/WmsApiController.java | 11 ++ .../wms/controller/WmsMobileController.java | 4 +- .../service/IWmsInventoryCheckService.java | 4 +- .../impl/WmsInventoryCheckServiceImpl.java | 4 +- .../wms/WmsInventoryCheckDetailMapper.xml | 2 +- .../mapper/wms/WmsInventoryCheckMapper.xml | 2 +- hw-ui/src/api/board/index.js | 48 +++++ hw-ui/src/views/board/fifthFloor/index.vue | 150 +++++++++++++++- hw-ui/src/views/board/firstFloor/index.vue | 164 +++++++++++++++++- .../src/views/board/fourthFloor/assemble.vue | 158 ++++++++++++++++- .../views/board/fourthFloor/laserLight.vue | 25 +-- hw-ui/src/views/board/fourthFloor/weld.vue | 4 +- 13 files changed, 541 insertions(+), 43 deletions(-) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java index f315d3b1..8537b393 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java @@ -3,6 +3,7 @@ package com.hw.mes.service.impl; import com.hw.common.core.constant.MesConstants; import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; +import com.hw.common.core.utils.StringUtils; import com.hw.common.core.utils.uuid.Seq; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.domain.MesMaterialCheckResult; @@ -60,6 +61,9 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer */ @Override public List selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail) { + if(mesProductPlanDetail.getPlanId()==null){ + return new ArrayList(); + } return mesProductPlanDetailMapper.selectMesProductPlanDetailList(mesProductPlanDetail); } @@ -241,8 +245,8 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer Date currentDate = new Date(); String userName = SecurityUtils.getUsername(); BigDecimal planAmount = null; - if (mesProductPlanDetail.getAttachId() != null) {//如果是按图纸生产的 - String attachId = dbProductPlan.getAttachId(); + String attachId = dbProductPlan.getAttachId(); + if (StringUtils.isNotEmpty(attachId)) {//如果是按图纸生产的 String[] attachIdArr = attachId.split(","); planAmount = new BigDecimal(attachIdArr.length); } else { diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java index 5c123b8c..187883c0 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java @@ -49,6 +49,7 @@ public class WmsApiController extends BaseController { // @RequiresPermissions("wms:rawoutstock:list") @GetMapping("/getWarehouses") public AjaxResult getWarehouses(WmsBaseWarehouse queryBaseWarehouse) { + queryBaseWarehouse.setWarehouseInstockType(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_RAW); List list = wmsBaseWarehouseService.selectWmsBaseWarehouseList(queryBaseWarehouse); return success(list); } @@ -130,4 +131,14 @@ public class WmsApiController extends BaseController { return toAjax(wmsProductInstockService.fourthFloorProduceInstock(wmsProduceInstockVo)); } + /** + * 申请返库 + */ + @Log(title = "原材料返库记录", businessType = BusinessType.APPLY) + @PostMapping(("/applyRawBack")) + public AjaxResult applyRawBack(@Validated @RequestBody List wmsRawReturns) { + return toAjax(wmsRawReturnService.applyRawReturn(wmsRawReturns)); + } + + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java index 44bd1e16..759c29af 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java @@ -524,12 +524,12 @@ public class WmsMobileController extends BaseController { /** - * 获取待盘点和盘点中的盘点记录明细列表 + * 获取待盘点和盘点中的盘点记录明细列表(inventoryCheckId=3&checkStatus=1(1是盘点中,2是盘点完成)) */ // @RequiresPermissions("wms:rawoutstock:query") @GetMapping(value = "/getInventoryCheckDetails") public AjaxResult getInventoryCheckDetails(WmsInventoryCheckDetail wmsInventoryCheckDetail) { - List checkDetails = wmsInventoryCheckService.getIncompletedInventoryCheckDetails(wmsInventoryCheckDetail); + List checkDetails = wmsInventoryCheckService.getInventoryCheckDetails(wmsInventoryCheckDetail); return success(checkDetails); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsInventoryCheckService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsInventoryCheckService.java index 58f10f2f..63a043da 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsInventoryCheckService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsInventoryCheckService.java @@ -82,12 +82,12 @@ public interface IWmsInventoryCheckService // public Map> getIncompletedInventoryCheckDetails(WmsInventoryCheckDetail wmsInventoryCheckDetail); /** - * 根据判断状态获取数据,按状态返回list数据 + * 根据状态获取数据,按状态返回list数据 * * @param wmsInventoryCheckDetail * @return */ - public List getIncompletedInventoryCheckDetails(WmsInventoryCheckDetail wmsInventoryCheckDetail); + public List getInventoryCheckDetails(WmsInventoryCheckDetail wmsInventoryCheckDetail); /** * 确认盘点 diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsInventoryCheckServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsInventoryCheckServiceImpl.java index b4e65f46..ee8c0395 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsInventoryCheckServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsInventoryCheckServiceImpl.java @@ -89,7 +89,7 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { String userName = SecurityUtils.getUsername(); Date currentDate = new Date(); - if (inventoryCheckId == null || inventoryCheckId.equals(0L)) { + if (inventoryCheckId == null || inventoryCheckId.equals(0L) || inventoryCheckId.equals(-1L)) { WmsInventoryCheck queryInventoryCheck = new WmsInventoryCheck(); queryInventoryCheck.setWarehouseId(warehouseId); queryInventoryCheck.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_STATUS_INVENTORYING); @@ -307,7 +307,7 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { * @return */ @Override - public List getIncompletedInventoryCheckDetails(WmsInventoryCheckDetail wmsInventoryCheckDetail) { + public List getInventoryCheckDetails(WmsInventoryCheckDetail wmsInventoryCheckDetail) { List wmsInventoryCheckDetailList = wmsInventoryCheckDetailMapper.selectWmsInventoryCheckDetailJoinList(wmsInventoryCheckDetail); return wmsInventoryCheckDetailList; } diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsInventoryCheckDetailMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsInventoryCheckDetailMapper.xml index dd656d27..17884cde 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsInventoryCheckDetailMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsInventoryCheckDetailMapper.xml @@ -146,7 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select wicd.inventory_check_detail_id, wicd.inventory_check_id, wicd.material_id, wicd.material_batch, - wicd.stock_type, wicd.stock_id, wicd.stock_amount, wicd.real_amount, wicd.check_status, wicd.inventory_time, + wicd.stock_type, wicd.stock_id, wicd.stock_amount, wicd.real_amount, wicd.check_status, wicd.inventory_time, wicd.location_code, mbmi.material_code,mbmi.material_name from wms_inventory_check_detail wicd left join mes_base_material_info mbmi on wicd.material_id = mbmi.material_id diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsInventoryCheckMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsInventoryCheckMapper.xml index 2bfccb55..4fac80bb 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsInventoryCheckMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsInventoryCheckMapper.xml @@ -163,7 +163,7 @@ + select attach_path + from mes_base_attach_info + where attach_type = #{attachType} and process_id = #{processId} + + + + delete from mes_base_attach_info + where attach_type = #{attachType} and process_id = #{processId} + + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseDeviceInstallMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseDeviceInstallMapper.xml index 875f4092..4dd6a556 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseDeviceInstallMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseDeviceInstallMapper.xml @@ -28,8 +28,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join dms_base_device_ledger b on a.device_id = b.device_id and a.device_id = #{deviceId} - and a.install_position = #{installPosition} - and a.install_time = #{installTime} + and a.install_position like concat( '%',#{installPosition},'%') + and a.install_time between #{params.beginTime} and #{params.endTime} and a.install_persion = #{installPersion} and a.work_order = #{workOrder} and b.device_name like concat('%', #{deviceName},'%') diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseSpecialdeviceParamMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseSpecialdeviceParamMapper.xml index fb21bb5c..2ebfb8c3 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseSpecialdeviceParamMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseSpecialdeviceParamMapper.xml @@ -28,13 +28,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from dms_base_specialdevice_param a left join dms_base_device_ledger b on a.device_id = b.device_id - and device_id = #{deviceId} - and device_name like concat('%', #{deviceName},'%') - and param_code = #{paramCode} - and param_name like concat('%', #{paramName}, '%') - and param_value = #{paramValue} - and param_unit = #{paramUnit} - and is_flag = #{isFlag} + and a.device_id = #{deviceId} + and b.device_name like concat('%', #{deviceName},'%') + and a.param_code = #{paramCode} + and a.param_name like concat('%', #{paramName}, '%') + and a.param_value = #{paramValue} + and a.param_unit = #{paramUnit} + and a.is_flag = #{isFlag} diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseTransferInfoMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseTransferInfoMapper.xml index 4373070b..3e665460 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseTransferInfoMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseTransferInfoMapper.xml @@ -29,11 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join dms_base_device_ledger b on a.device_id = b.device_id and a.device_id = #{deviceId} - and a.device_position = #{devicePosition} - and a.device_position_new = #{devicePositionNew} + and a.device_position like concat('%',#{devicePosition},'%') + and a.device_position_new like concat('%',#{devicePositionNew},'%') and a.device_position_operator = #{devicePositionOperator} and a.device_position_reason = #{devicePositionReason} - and a.device_transfer_time = #{deviceTransferTime} + and a.device_transfer_time between #{params.beginTime} and #{params.endTime} and b.device_name like concat('%', #{deviceName},'%') diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceActivityMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceActivityMapper.xml index e44e1c48..fc6fb212 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceActivityMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceActivityMapper.xml @@ -143,7 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - and plan_inspect_id = #{planInspectId} + and plan_inspect_id like concat('%',#{planInspectId},'%') and inspect_instance_id = #{inspectInstanceId} and wf_process_id = #{wfProcessId} and inspect_type = #{inspectType} and bills_inspect_code = #{billsInspectCode} - and plan_begin_time = #{planBeginTime} - and plan_end_time = #{planEndTime} - and real_begin_time = #{realBeginTime} - and real_end_time = #{realEndTime} + and plan_begin_time > #{planBeginTime} + and #{planEndTime}>plan_end_time + and real_begin_time > #{realBeginTime} + and #{realEndTime}>real_end_time and inspect_status = #{inspectStatus} and is_flag = #{isFlag} diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsLubeInstanceMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsLubeInstanceMapper.xml index af5a39aa..44043322 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsLubeInstanceMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsLubeInstanceMapper.xml @@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and plan_lube_id = #{planLubeId} + and lube_instance_id = #{lubeInstanceId} and bills_lube_code = #{billsLubeCode} and plan_begin_time = #{planBeginTime} and real_begin_time = #{realBeginTime} diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml index 26fc7471..0e65977f 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml @@ -36,12 +36,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and plan_maint_id = #{planMaintId} + and maint_instance_id = #{maintInstanceId} and wf_process_id = #{wfProcessId} - and bills_maint_code = #{billsMaintCode} - and plan_begin_time = #{planBeginTime} - and real_begin_time = #{realBeginTime} - and plan_end_time = #{planEndTime} - and real_end_time = #{realEndTime} + and bills_maint_code like concat('%',#{billsMaintCode},'%') + and plan_begin_time > #{planBeginTime} + and #{planEndTime}>plan_end_time + and real_begin_time > #{realBeginTime} + and #{realEndTime} > real_end_time and maint_status = #{maintStatus} and maint_comp_rate = #{maintCompRate} and is_flag = #{isFlag} diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectInstanceDetailProjectMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectInstanceDetailProjectMapper.xml index cba4ce92..5fd27453 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectInstanceDetailProjectMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectInstanceDetailProjectMapper.xml @@ -146,4 +146,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectRouteDetailMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectRouteDetailMapper.xml index 25d1601c..f9f7b6ab 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectRouteDetailMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectRouteDetailMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -12,6 +12,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -20,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into dms_inspect_route_detail @@ -72,9 +74,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from dms_inspect_route_detail where route_detail_id in + delete from dms_inspect_route_detail where route_detail_id in #{routeDetailId} - \ No newline at end of file + + + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml index 54930126..c096d24d 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInstanceFileMapper.xml @@ -73,4 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ( #{item.instanceFileId}, #{item.targetType}, #{item.targetId}, #{item.filePath}) + + delete from dms_instance_file where target_type = 1 and target_id =#{targetId} + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanLubeDetailMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanLubeDetailMapper.xml index 16fb46b3..3a877825 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanLubeDetailMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanLubeDetailMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -17,6 +17,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -25,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into dms_plan_lube_detail @@ -93,9 +96,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from dms_plan_lube_detail where plan_lube_detail_id in + delete from dms_plan_lube_detail where plan_lube_detail_id in #{planLubeDetailId} - \ No newline at end of file + + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml index 8d204713..7f515819 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml @@ -20,6 +20,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -132,5 +134,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and is_flag = #{isFlag} + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanRepairDetailMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanRepairDetailMapper.xml index 637e8a5c..886a48a9 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanRepairDetailMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanRepairDetailMapper.xml @@ -3,11 +3,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - + + @@ -16,35 +17,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + - select plan_repair_detail_id, plan_repair_id, device_id, fault_type, repair_desc, repair_protocol, operation_description, create_by, create_time, update_by, update_time from dms_plan_repair_detail + select plan_repair_detail_id, plan_repair_id, repair_detail_target_type, repair_detail_target_id , fault_type, repair_desc, repair_protocol, operation_description, create_by, create_time, update_by, update_time from dms_plan_repair_detail - + - + insert into dms_plan_repair_detail plan_repair_id, - device_id, fault_type, + repair_detail_target_type, + repair_detail_target_id, repair_desc, repair_protocol, operation_description, @@ -55,8 +58,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{planRepairId}, - #{deviceId}, #{faultType}, + #{repairDetailTargetType}, + #{repairDetailTargetId}, #{repairDesc}, #{repairProtocol}, #{operationDescription}, @@ -71,8 +75,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update dms_plan_repair_detail plan_repair_id = #{planRepairId}, - device_id = #{deviceId}, fault_type = #{faultType}, + repair_detail_target_type = #{repairDetailTargetType}, + repair_detail_target_id = #{repairDetailTargetId}, repair_desc = #{repairDesc}, repair_protocol = #{repairProtocol}, operation_description = #{operationDescription}, @@ -89,9 +94,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from dms_plan_repair_detail where plan_repair_detail_id in + delete from dms_plan_repair_detail where plan_repair_detail_id in #{planRepairDetailId} - \ No newline at end of file + + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanRepairMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanRepairMapper.xml index 591f9585..c7a6c6da 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanRepairMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanRepairMapper.xml @@ -31,7 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + @@ -62,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"