From c1075c9320c04c2d524ab2918dd89592b075a856 Mon Sep 17 00:00:00 2001 From: dingjie Date: Sat, 23 Dec 2023 14:31:54 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=96=B0=E8=B4=AD=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/base/api}/domain/MaMachineLabel.java | 2 +- .../controller/MaMachineLabelController.java | 2 +- .../base/mapper/MaMachineLabelMapper.java | 2 +- .../base/service/IMaMachineLabelService.java | 4 +- .../impl/MaMachineLabelServiceImpl.java | 2 +- .../mapper/base/MaHouseSetMapper.xml | 4 +- .../mapper/base/MaMachineLabelMapper.xml | 6 +- .../PurchaseMacodeInfoController.java | 17 +--- .../mapper/PurchaseMacodeInfoMapper.java | 5 ++ .../service/IPurchaseMacodeInfoService.java | 3 +- .../impl/PurchaseMacodeInfoServiceImpl.java | 80 ++++++------------- .../material/PurchaseCheckInfoMapper.xml | 2 +- .../material/PurchaseMacodeInfoMapper.xml | 27 ++++++- sgzb-modules/sgzb-system/pom.xml | 2 +- 14 files changed, 70 insertions(+), 88 deletions(-) rename {sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base => sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api}/domain/MaMachineLabel.java (97%) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaMachineLabel.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachineLabel.java similarity index 97% rename from sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaMachineLabel.java rename to sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachineLabel.java index c7d3b3b9..3ce57f8c 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaMachineLabel.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachineLabel.java @@ -1,4 +1,4 @@ -package com.bonus.sgzb.base.domain; +package com.bonus.sgzb.base.api.domain; import com.bonus.sgzb.common.core.annotation.Excel; import com.bonus.sgzb.common.core.web.domain.BaseEntity; diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineLabelController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineLabelController.java index 023f7e2d..0787dbc7 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineLabelController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineLabelController.java @@ -2,7 +2,7 @@ package com.bonus.sgzb.base.controller; -import com.bonus.sgzb.base.domain.MaMachineLabel; +import com.bonus.sgzb.base.api.domain.MaMachineLabel; import com.bonus.sgzb.base.service.IMaMachineLabelService; import com.bonus.sgzb.common.core.web.controller.BaseController; import com.bonus.sgzb.common.core.web.domain.AjaxResult; diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaMachineLabelMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaMachineLabelMapper.java index efa723e5..fc296693 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaMachineLabelMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaMachineLabelMapper.java @@ -1,6 +1,6 @@ package com.bonus.sgzb.base.mapper; -import com.bonus.sgzb.base.domain.MaMachineLabel; +import com.bonus.sgzb.base.api.domain.MaMachineLabel; import org.apache.ibatis.annotations.Mapper; import java.util.Date; diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/IMaMachineLabelService.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/IMaMachineLabelService.java index 8082059e..b26a790b 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/IMaMachineLabelService.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/IMaMachineLabelService.java @@ -1,8 +1,6 @@ package com.bonus.sgzb.base.service; -import com.bonus.sgzb.base.domain.MaMachineLabel; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Service; +import com.bonus.sgzb.base.api.domain.MaMachineLabel; import java.util.List; diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaMachineLabelServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaMachineLabelServiceImpl.java index 2320c25e..f6d0865b 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaMachineLabelServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaMachineLabelServiceImpl.java @@ -1,6 +1,6 @@ package com.bonus.sgzb.base.service.impl; -import com.bonus.sgzb.base.domain.MaMachineLabel; +import com.bonus.sgzb.base.api.domain.MaMachineLabel; import com.bonus.sgzb.base.mapper.MaMachineLabelMapper; import com.bonus.sgzb.base.service.IMaMachineLabelService; import com.bonus.sgzb.common.core.utils.DateUtils; diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml index df14eb13..4e1fde98 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml @@ -92,8 +92,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select mt.type_name specificationType, mt1.type_name machineTypeName, mt2.type_name itemType , mm.ma_code maCode, mhs.house_id, mhs.type_id, mhs.ma_id, mhs.num, mhs.status, mhs.dept_id, mhs.del_flag, mhs.create_by, mhs.create_time, mhs.update_by,mhs.update_time,mhs.remark,mhs.company_id - from ma_type mt - left join ma_machine mm on mt.type_id = mm.type_id + from ma_machine mm + left join ma_type mt on mm.type_id = mt.type_id left join ma_type mt1 on mt.parent_id = mt1.type_id left join ma_type mt2 on mt1.parent_id = mt2.type_id left join ma_house_set mhs on mt.type_id = mhs.type_id diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineLabelMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineLabelMapper.xml index 28b40bd5..8c8f1bdd 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineLabelMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineLabelMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -16,7 +16,7 @@ select label_id, label_code, ma_id, is_bind, label_type, company_id from ma_machine_label - select label_id, label_code, ma_id, is_bind, label_type, company_id from ma_machine_label where is_bind ='0' @@ -26,7 +26,7 @@ from ma_machine_label where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{nowDate},'%y%m') - + insert into ma_machine_label label_code, diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseMacodeInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseMacodeInfoController.java index 0fcee176..6a1e9c37 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseMacodeInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseMacodeInfoController.java @@ -86,21 +86,6 @@ public class PurchaseMacodeInfoController extends BaseController return purchaseMacodeInfoService.insertPurchaseMacodeInfo(purchaseMacodeInfoList); } - /** - * 生成设备编号 - */ - @ApiOperation(value = "生成设备编号") - @PostMapping("/equipmentNumber") - public AjaxResult generateEquipmentNumber(@RequestBody EquipmentNumberVO equipmentNumberVO) throws Exception { - Long typeId = equipmentNumberVO.getTypeId(); - if (typeId == null) { - throw new Exception("类型typeId为空!"); - } - if (equipmentNumberVO.getCount() == 0) { - throw new Exception("生成数量为0!"); - } - return success(purchaseMacodeInfoService.generateEquipmentNumber(equipmentNumberVO)); - } /** * 修改新购验收编号管理 @@ -112,7 +97,7 @@ public class PurchaseMacodeInfoController extends BaseController } /** - * 修改新购验收编号管理 + * 修改新购验收编号管理,暂时不用 */ @ApiOperation(value = "修改编码管理的入库状态") @PutMapping("/manageStatus") diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java index 2dcb949d..68fab2fd 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java @@ -2,6 +2,7 @@ package com.bonus.sgzb.material.mapper; import com.alibaba.fastjson.JSONObject; import com.bonus.sgzb.base.api.domain.MaMachine; +import com.bonus.sgzb.base.api.domain.MaMachineLabel; import com.bonus.sgzb.base.api.domain.MaType; import com.bonus.sgzb.material.domain.MaInputRecord; import com.bonus.sgzb.material.domain.PurchaseMacodeInfo; @@ -102,4 +103,8 @@ public interface PurchaseMacodeInfoMapper { int selectMaCode(String maCode); int updateMacodeByType(PurchaseMacodeInfo purchaseMacodeInfo); + + int selectLableNumByMonth(Date nowDate); + + int insertMaMachineLabel(MaMachineLabel maMachineLabel); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/IPurchaseMacodeInfoService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/IPurchaseMacodeInfoService.java index e069255b..eadb2a3c 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/IPurchaseMacodeInfoService.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/IPurchaseMacodeInfoService.java @@ -1,6 +1,7 @@ package com.bonus.sgzb.material.service; import com.alibaba.fastjson.JSONObject; +import com.bonus.sgzb.base.api.domain.MaMachineLabel; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.material.domain.MaInputRecord; import com.bonus.sgzb.material.domain.PurchaseMacodeInfo; @@ -65,7 +66,7 @@ public interface IPurchaseMacodeInfoService */ public int deletePurchaseMacodeInfoByTaskId(Long taskId); - JSONObject generateEquipmentNumber(EquipmentNumberVO equipmentNumberVO); + String generateEquipmentNumber(MaMachineLabel maMachineLabel); int deletePurchaseMacodeInfoById(Long id); diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java index 3d04a4d9..c2b3bb23 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java @@ -8,6 +8,7 @@ import java.util.List; import com.alibaba.fastjson.JSONObject; import com.bonus.sgzb.base.api.domain.MaMachine; +import com.bonus.sgzb.base.api.domain.MaMachineLabel; import com.bonus.sgzb.base.api.domain.MaType; import com.bonus.sgzb.base.api.domain.TmTask; import com.bonus.sgzb.common.core.utils.StringUtils; @@ -99,11 +100,15 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService String maCode = purchaseMacodeInfo.getMaCode(); purchaseCheckDetails.setTypeId(typeId); purchaseCheckDetails.setTaskId(purchaseMacodeInfo.getTaskId()); + + MaMachineLabel maLabel = new MaMachineLabel(); + String qrCode = generateEquipmentNumber(maLabel); + if (StringUtils.isNotEmpty(maCode)) { MaMachine maMachine = new MaMachine(); maMachine.setTypeId(typeId); maMachine.setMaStatus("14"); - maMachine.setQrCode(purchaseMacodeInfo.getQrCode()); + maMachine.setQrCode(qrCode); // 设备原厂编号 String fixCode = purchaseMacodeInfo.getFixCode(); if ("0".equals(fixCode)) { @@ -118,16 +123,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService maMachine.setCreateBy(SecurityUtils.getUsername()); purchaseMacodeInfoMapper.maMachineAdd(maMachine); } - String qrCode = purchaseMacodeInfo.getQrCode(); - // 二维码存储 - if (StringUtils.isNotEmpty(qrCode)) { - BmQrcodeInfo bmQrcodeInfo = new BmQrcodeInfo(); - bmQrcodeInfo.setTypeId(typeId); - bmQrcodeInfo.setQrCode(qrCode); - bmQrcodeInfo.setTaskId(purchaseMacodeInfo.getTaskId()); - bmQrcodeInfo.setCreateTime(new Date()); - qrcodeInfoMapper.insertBmQrcodeInfo(bmQrcodeInfo); - } + purchaseMacodeInfo.setStatus("0"); purchaseMacodeInfo.setCreateTime(DateUtils.getNowDate()); purchaseMacodeInfoMapper.insertPurchaseMacodeInfo(purchaseMacodeInfo); @@ -215,55 +211,27 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService /** * 生成设备编号 * - * @param equipmentNumberVO 类型id,生成数量 + * @param maMachineLabel 类型id,生成数量 * @return 编码结果 */ @Override - public JSONObject generateEquipmentNumber(EquipmentNumberVO equipmentNumberVO) { - Long typeId = equipmentNumberVO.getTypeId(); - SimpleDateFormat sdf = new SimpleDateFormat("yyMM"); + public String generateEquipmentNumber(MaMachineLabel maMachineLabel) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); Date nowDate = DateUtils.getNowDate(); - String format = sdf.format(nowDate); - - JSONObject jsonObject = purchaseMacodeInfoMapper.getTypeByTypeId(typeId); - String typeCode = jsonObject.getString("modelCode"); - String specsCode = jsonObject.getString("specsCode"); - //序列号 - int count = purchaseMacodeInfoMapper.getSerialNumber(typeId, nowDate) + 1; - List list = new ArrayList<>(); - List codeList = new ArrayList<>(); - for (int i = 0; i < equipmentNumberVO.getCount(); i++) { - int i1 = count + i; - // 编码规则 - String codingRule = "NSJJ" + specsCode + format + typeCode; - String codeNum = ""; - String code = format; - String code1 = format; - if (i1 > 9 && i1 < 100) { - codeNum = "-00" + i1; - code1 = "-00" + i1; - } else if (i1 > 99 && i1 < 1000) { - codeNum = "-0" + i1; - code1 = "-0" + i1; - } else { - codeNum = "-000" + i1; - code1 = "-000" + i1; - } - codingRule = codingRule + codeNum; - code = code + code1; - // 二维码 - int i2 = purchaseMacodeInfoMapper.selectMachineByMaCode(codingRule); - if (i2 <= 0) { - list.add(codingRule); - } - codeList.add(code); + String format = dateFormat.format(nowDate); + int lableNum = purchaseMacodeInfoMapper.selectLableNumByMonth(nowDate) + 1; + String code=""; + if (lableNum>9 && lableNum<100){ + code = format + "-00" + lableNum; + }else if (lableNum>99 && lableNum<1000){ + code = format + "-0" + lableNum; + }else { + code = format + "-000" + lableNum; } - - JSONObject result = new JSONObject(); - result.put("equipmentNum", list); - result.put("twoDimensionalCode", codeList); - - return result; + maMachineLabel.setIsBind("0"); + maMachineLabel.setLabelCode(code); + purchaseMacodeInfoMapper.insertMaMachineLabel(maMachineLabel); + return code; } /** @@ -278,7 +246,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService } /** - * 修改编码管理的入库状态 + * 修改编码管理的入库状态,暂时不用 * * @param maInputVO 入库信息 * @return 结果 diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml index ba6a973d..7c64189a 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml @@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join tm_task tk on pci.task_id = tk.task_id left join (select id,name from sys_dic where p_id = 23) dict on tk.task_status = dict.id left join sys_user su on pci.purchaser = su.user_id - where task_type = 23 and tk.task_status in (24,25,26,27) + where task_type = 23 and tk.code = #{code} and pci.purchase_time = #{purchaseTime} and pci.arrival_time = #{arrivalTime} diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml index 3c1061a4..b5cbd948 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml @@ -235,6 +235,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{companyId}, + + insert into ma_machine_label + + label_code, + ma_id, + is_bind, + label_type, + company_id, + create_time + + + #{labelCode}, + #{maId}, + #{isBind}, + #{labelType}, + #{companyId}, + now() + + select pcd.production_time productionTime,mt.type_name specificationType, mt1.type_name typeName, pmi.ma_code maCode, mm.assets_code assetsCode ,pmi.fix_code fixCode,pcd.type_id typeId,pcd.task_id taskId, mt.code specsCode,mt1.code typeCode, - if(pmi.ma_code is null, if(pcd.status != 4, 0 , 1), pmi.status) status, + if(pmi.ma_code is null, if(pcd.status != 4, 0 , 1), pmi.status) status,mm.qr_code qrCode, if(pmi.ma_code is not null,1,pcd.check_num) checkNum from purchase_check_details pcd left join purchase_macode_info pmi on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id @@ -268,10 +287,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_type mt on pcd.type_id = mt.type_id left join ma_type mt1 on mt.parent_id = mt1.type_id where pcd.task_id = #{taskId} + order by status + update ma_type set num = #{num} where type_id = #{typeId} diff --git a/sgzb-modules/sgzb-system/pom.xml b/sgzb-modules/sgzb-system/pom.xml index 163e457a..ec29e566 100644 --- a/sgzb-modules/sgzb-system/pom.xml +++ b/sgzb-modules/sgzb-system/pom.xml @@ -123,5 +123,5 @@ - + \ No newline at end of file From b87c91473946009a31df19eabb77de1239e43c7c Mon Sep 17 00:00:00 2001 From: syruan <1555146157@163.com> Date: Sat, 23 Dec 2023 15:24:52 +0800 Subject: [PATCH 2/9] =?UTF-8?q?maCode=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/app/controller/LeaseOutDetailsController.java | 6 +++--- .../sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java | 4 ++-- .../src/main/resources/mapper/base/MaMachineMapper.xml | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/LeaseOutDetailsController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/LeaseOutDetailsController.java index 597e4426..44bdd5f1 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/LeaseOutDetailsController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/LeaseOutDetailsController.java @@ -34,13 +34,13 @@ public class LeaseOutDetailsController extends BaseController { /** * 根据code编码查询设备信息 - * @param mCode 机具编码 + * @param maCode 机具编码 * @return 设备信息 */ @Log(title = "根据code编码获取设备信息", businessType = BusinessType.QUERY) @GetMapping("/getMaMachineByCode") - public TableDataInfo getMaMachineByCode(@RequestParam(value = "maCode") String mCode) { - return getDataTable(leaseOutDetailsService.getMaMachineByCode(mCode)); + public TableDataInfo getMaMachineByCode(@RequestParam(value = "maCode") String maCode) { + return getDataTable(leaseOutDetailsService.getMaMachineByCode(maCode)); } /** diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java index 204ed090..e856eba9 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java @@ -83,8 +83,8 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService { } /** - * @param maMachine - * @return + * @param maCode 编码ID + * @return 数据 */ @Override public List getMaMachineByCode(String maCode) { diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml index 0d3c7320..745aa5fa 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml @@ -69,10 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_type mt1 on mt.parent_id = mt1.type_id left join ma_type mt2 on mt1.parent_id = mt2.type_id left join ma_label_bind mmb on m.ma_id = mmb.ma_id and m.type_id = mmb.type_id - - m.ma_code = #{maCode} - - order by m.ma_id desc + where m.ma_code = #{maCode} From 49e1b410b6ceef09b47a37a505335a8ad70933d7 Mon Sep 17 00:00:00 2001 From: bns_han <1604366271@qq.com> Date: Sat, 23 Dec 2023 15:36:12 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=90=8E=E5=8F=B0-=E9=80=80=E6=96=99?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E4=B8=8E=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/app/domain/BackApplyInfo.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java index 57bcff3d..d3bbe862 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.app.domain; +import io.swagger.models.auth.In; import lombok.Data; /** @@ -86,8 +87,46 @@ public class BackApplyInfo { private String lotId; private String unitId; private String backTime; + private Integer maId; /** * 机具管理方式 */ private String manageType; + /** + * 合格数量 + */ + private Integer passNum; + /** + * 维修数量 + */ + private Integer maintenanceNum; + /** + * 报废数量 + */ + private Integer scrapNum; + + /** + * 退料数量 + */ + private Integer backNum; + + /** + * 退料数量 + */ + private String backStatus; + + /** + * 合格入库数量 + */ + private String inputNum; + + /** + * 任务类型 + */ + private Integer taskType; + + /** + * 任务id + */ + private Integer taskId; } From a22ee17c232265e10fd806a00ca094a8ec0c44a9 Mon Sep 17 00:00:00 2001 From: bns_han <1604366271@qq.com> Date: Sat, 23 Dec 2023 15:55:22 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E5=90=8E=E5=8F=B0-=E9=80=80=E6=96=99?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E4=B8=8E=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/material/controller/BackApplyController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BackApplyController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BackApplyController.java index 1177bc8b..08e98bf0 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BackApplyController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BackApplyController.java @@ -52,7 +52,7 @@ public class BackApplyController extends BaseController { */ @ApiOperation(value = "获取在用物料列表") @GetMapping("/getMaterialList") - public TableDataInfo getMaterialList(@RequestBody BackApplyInfo bean) + public TableDataInfo getMaterialList(BackApplyInfo bean) { startPage(); List list = backApplyService.getMaterialList(bean); @@ -64,7 +64,7 @@ public class BackApplyController extends BaseController { */ @ApiOperation(value = "退料申请详情") @GetMapping("/getView") - public TableDataInfo getView(@RequestBody BackApplyInfo bean) + public TableDataInfo getView(BackApplyInfo bean) { startPage(); List list = backApplyService.getView(bean); @@ -86,7 +86,7 @@ public class BackApplyController extends BaseController { */ @ApiOperation(value = "退料申请删除") @GetMapping("/del") - public AjaxResult del(@RequestBody BackApplyInfo bean) + public AjaxResult del(BackApplyInfo bean) { return backApplyService.del(bean); } From d4a943ce4664a9c89b615ba2b0327acef8356919 Mon Sep 17 00:00:00 2001 From: dingjie Date: Sat, 23 Dec 2023 15:57:50 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=96=B0=E8=B4=AD=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/base/api/domain/MaMachine.java | 258 ++---------------- .../bonus/sgzb/base/domain/MaHouseSet.java | 11 + .../mapper/base/MaHouseSetMapper.xml | 3 +- .../resources/mapper/base/MaMachineMapper.xml | 26 +- .../mapper/base/MaTypeFileMapper.xml | 2 +- .../impl/PurchaseCheckInfoServiceImpl.java | 2 + .../impl/PurchaseMacodeInfoServiceImpl.java | 3 + .../material/PurchaseCheckInfoMapper.xml | 3 +- sgzb-modules/sgzb-system/pom.xml | 2 +- 9 files changed, 61 insertions(+), 249 deletions(-) diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java index af2927ab..7d72ab42 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java @@ -22,8 +22,18 @@ public class MaMachine extends BaseEntity { /** * 类型ID */ - @ApiModelProperty(value = "类型ID") + @ApiModelProperty(value = "资产属性id") private long propId; + /** + * 物品种类 + */ + @ApiModelProperty(value = "物品种类id") + private long itemId; + /** + * 设备类型 + */ + @ApiModelProperty(value = "设备类型id") + private long deviceId; /** * 物品种类 */ @@ -151,246 +161,12 @@ public class MaMachine extends BaseEntity { private String labelCode; + @ApiModelProperty(value = "筛选名称") + private String keyWord; + @ApiModelProperty(value = "开始时间") + private String beginTime; - public void setMaId(long maId) { - this.maId = maId; - } - - - public long getTypeId() { - return typeId; - } - - public void setTypeId(long typeId) { - this.typeId = typeId; - } - - - public String getMaCode() { - return maCode; - } - - public void setMaCode(String maCode) { - this.maCode = maCode; - } - - - public String getPreCode() { - return preCode; - } - - public void setPreCode(String preCode) { - this.preCode = preCode; - } - - - public String getMaStatus() { - return maStatus; - } - - public void setMaStatus(String maStatus) { - this.maStatus = maStatus; - } - - - public String getQrCode() { - return qrCode; - } - - public void setQrCode(String qrCode) { - this.qrCode = qrCode; - } - - - public String getBuyPrice() { - return buyPrice; - } - - public void setBuyPrice(String buyPrice) { - this.buyPrice = buyPrice; - } - - - public String getMaVender() { - return maVender; - } - - public void setMaVender(String maVender) { - this.maVender = maVender; - } - - - public String getOutFacTime() { - return outFacTime; - } - - public void setOutFacTime(String outFacTime) { - this.outFacTime = outFacTime; - } - - - public String getOutFacCode() { - return outFacCode; - } - - public void setOutFacCode(String outFacCode) { - this.outFacCode = outFacCode; - } - - - public String getAssetsCode() { - return assetsCode; - } - - public void setAssetsCode(String assetsCode) { - this.assetsCode = assetsCode; - } - - - public String getCheckMan() { - return checkMan; - } - - public void setCheckMan(String checkMan) { - this.checkMan = checkMan; - } - - - public String getThisCheckTime() { - return thisCheckTime; - } - - public void setThisCheckTime(String thisCheckTime) { - this.thisCheckTime = thisCheckTime; - } - - - public String getNextCheckTime() { - return nextCheckTime; - } - - public void setNextCheckTime(String nextCheckTime) { - this.nextCheckTime = nextCheckTime; - } - - - public String getGpsCode() { - return gpsCode; - } - - public void setGpsCode(String gpsCode) { - this.gpsCode = gpsCode; - } - - - public String getRfidCode() { - return rfidCode; - } - - public void setRfidCode(String rfidCode) { - this.rfidCode = rfidCode; - } - - - public String getErpCode() { - return erpCode; - } - - public void setErpCode(String erpCode) { - this.erpCode = erpCode; - } - - - public String getTransferCode() { - return transferCode; - } - - public void setTransferCode(String transferCode) { - this.transferCode = transferCode; - } - - - public String getInOutNum() { - return inOutNum; - } - - public void setInOutNum(String inOutNum) { - this.inOutNum = inOutNum; - } - - - public String getBuyTask() { - return buyTask; - } - - public void setBuyTask(String buyTask) { - this.buyTask = buyTask; - } - - - public String getOwnHouse() { - return ownHouse; - } - - public void setOwnHouse(String ownHouse) { - this.ownHouse = ownHouse; - } - - - public String getCompanyId() { - return companyId; - } - - public void setCompanyId(String companyId) { - this.companyId = companyId; - } - - public String getItemType() { - return itemType; - } - - public void setItemType(String itemType) { - this.itemType = itemType; - } - - public String getDeviceType() { - return deviceType; - } - - public void setDeviceType(String deviceType) { - this.deviceType = deviceType; - } - - public String getSpecificationType() { - return specificationType; - } - - public void setSpecificationType(String specificationType) { - this.specificationType = specificationType; - } - - public String getMaStatusName() { - return maStatusName; - } - - public void setMaStatusName(String maStatusName) { - this.maStatusName = maStatusName; - } - - public String getLabelCode() { - return labelCode; - } - - public void setLabelCode(String labelCode) { - this.labelCode = labelCode; - } - - public long getPropId() { - return propId; - } - - public void setPropId(long propId) { - this.propId = propId; - } + @ApiModelProperty(value = "结束时间") + private String endTime; } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaHouseSet.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaHouseSet.java index be0734d0..080c02fc 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaHouseSet.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaHouseSet.java @@ -15,6 +15,9 @@ public class MaHouseSet { */ @ApiModelProperty(value="仓库ID") private long houseId; + + @ApiModelProperty(value="仓库名称") + private String houseName; /** * 机具类型ID */ @@ -255,4 +258,12 @@ public class MaHouseSet { public void setMaCode(String maCode) { this.maCode = maCode; } + + public String getHouseName() { + return houseName; + } + + public void setHouseName(String houseName) { + this.houseName = houseName; + } } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml index 4e1fde98..10af974e 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseSetMapper.xml @@ -91,12 +91,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select m.ma_id, m.type_id, m.ma_code, m.pre_code, m.ma_status, dic.name maStatusName, m.qr_code, m.buy_price, m.ma_vender, m.out_fac_time, m.out_fac_code, - m.assets_code, m.check_man, m.this_check_time, m.next_check_time, m.gps_code, m.rfid_code, m.erp_code, m.transfer_code, - m.in_out_num, m.buy_task, m.own_house ,m.company_id ,mt.type_name specificationType,mt1.type_name deviceType, mt2.type_name itemType, + select m.ma_id, m.type_id, m.ma_code, m.pre_code, m.ma_status, dic.name maStatusName, m.qr_code, m.buy_price, + m.ma_vender, m.out_fac_time, m.out_fac_code, m.assets_code, m.check_man, m.this_check_time, m.next_check_time, + m.gps_code, m.rfid_code, m.erp_code, m.transfer_code,m.create_time ,m.in_out_num, m.buy_task, m.own_house , + m.company_id ,mt.type_name specificationType,mt1.type_name deviceType, mt2.type_name itemType, mmb.label_code labelCode from ma_machine m left join (select id,p_id,name from sys_dic where p_id in (select id from sys_dic where value = 'ma_status')) dic on m.ma_status = dic.id @@ -47,12 +49,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_type mt1 on mt.parent_id = mt1.type_id left join ma_type mt2 on mt1.parent_id = mt2.type_id left join ma_label_bind mmb on m.ma_id = mmb.ma_id and m.type_id = mmb.type_id + left join ma_prop_set mps on mt.type_id = mps.type_id AND ma_id = #{maId} - AND type_id = #{typeId} + AND mt.type_id = #{typeId} + + + AND mt1.type_id = #{deviceId} + + + AND mt2.type_id = #{itemId} + + + AND mps.prop_id = #{propId} + + + AND (m.ma_code like concat('%',#{keyWord},'%') or m.buy_task like concat('%',#{keyWord},'%')) + + + AND m.create_time between #{beginTime} and #{endTime} order by m.ma_id desc diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaTypeFileMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaTypeFileMapper.xml index f1623879..5e5e32b3 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaTypeFileMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaTypeFileMapper.xml @@ -79,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where type_id = #{typeId} and file_type = #{fileType} - + delete from ma_type_file where type_id = #{typeId} and file_type = #{fileType} diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java index e88422c5..3d93fb33 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java @@ -5,6 +5,7 @@ import java.util.Date; import java.util.List; import com.bonus.sgzb.base.api.domain.TmTask; +import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.domain.BmNoticeInfo; import com.bonus.sgzb.material.domain.PurchaseCheckDetails; import com.bonus.sgzb.material.domain.PurchaseCheckInfo; @@ -112,6 +113,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService task.setCode(purchaseCodeRule()); task.setCreateTime(DateUtils.getNowDate()); task.setCompanyId(purchaseCheckInfo.getCompanyId()); + task.setCreateBy(SecurityUtils.getUsername()); // 创建任务信息 taskMapper.insertTmTask(task); purchaseCheckInfo.setTaskId(task.getTaskId()); diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java index c2b3bb23..17cadf5e 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java @@ -96,6 +96,8 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService } PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails(); for (PurchaseMacodeInfo purchaseMacodeInfo : purchaseMacodeInfoList) { + Long taskId = purchaseMacodeInfo.getTaskId(); + TmTask task = taskMapper.selectTmTaskByTaskId(taskId); Long typeId = purchaseMacodeInfo.getTypeId(); String maCode = purchaseMacodeInfo.getMaCode(); purchaseCheckDetails.setTypeId(typeId); @@ -109,6 +111,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService maMachine.setTypeId(typeId); maMachine.setMaStatus("14"); maMachine.setQrCode(qrCode); + maMachine.setBuyTask(task.getCode()); // 设备原厂编号 String fixCode = purchaseMacodeInfo.getFixCode(); if ("0".equals(fixCode)) { diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml index 7c64189a..9da62c3c 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml @@ -144,7 +144,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"