From 23d5e6b4f6cc86eaceb6320452dd810d23af8acb Mon Sep 17 00:00:00 2001 From: jiang Date: Tue, 14 Oct 2025 23:00:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MaDevInfoController.java | 12 +++++++--- .../material/devchange/domain/MaDevInfo.java | 4 +++- .../devchange/mapper/MaDevInfoMapper.java | 2 ++ .../service/DevChangeServiceImpl.java | 11 ++++++--- .../devchange/service/MaDevInfoService.java | 3 +++ .../service/MaDevInfoServiceImpl.java | 11 +++++++++ .../material/order/domain/OrderInfoDto.java | 3 +++ .../material/devchange/DevChangeMapper.xml | 8 +++---- .../material/devchange/MaDevInfoMapper.xml | 23 ++++++++++++++++++- .../devchange/MaDevRetireWarningMapper.xml | 10 ++++---- .../mapper/material/device/DevMergeMapper.xml | 2 +- .../mapper/material/order/OrderInfoMapper.xml | 17 +++++++------- 12 files changed, 80 insertions(+), 26 deletions(-) diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/MaDevInfoController.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/MaDevInfoController.java index 045a80c..9a9220c 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/MaDevInfoController.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/MaDevInfoController.java @@ -74,12 +74,20 @@ public class MaDevInfoController extends BaseController { return AjaxResult.success(service.getDevice(maId)); } + + @ApiOperation(value = "设备台账-获取单个设备详情") + @GetMapping("/getDeviceByMaIds/{maIds}") + public AjaxResult getDeviceByMaIds(@PathVariable String maIds) { + return service.getDeviceByMaIds(maIds); + } + + @ApiOperation(value = "设备台账-删除") @PostMapping("/delDevice/{ids}") public AjaxResult delDevice(@PathVariable("ids") String[] ids) { try { Integer i = service.delDevice(ids); - return i > 0 ? AjaxResult.success("修改成功"): AjaxResult.error("修改失败"); + return i > 0 ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败"); } catch (Exception e) { logger.error("报错啦", e); return AjaxResult.error("调用异常,请联系管理员"); @@ -135,6 +143,4 @@ public class MaDevInfoController extends BaseController { } - - } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/MaDevInfo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/MaDevInfo.java index 7eb782b..c598dff 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/MaDevInfo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/MaDevInfo.java @@ -22,6 +22,8 @@ public class MaDevInfo { * 设备id */ private Integer maId; + + private Integer devId; /** * 类型id */ @@ -308,7 +310,7 @@ public class MaDevInfo { @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date startOrderCreateTime; - + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date endOrderCreateTime; /** diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/MaDevInfoMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/MaDevInfoMapper.java index da98004..e9260d1 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/MaDevInfoMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/MaDevInfoMapper.java @@ -42,5 +42,7 @@ public interface MaDevInfoMapper { void insertDevInfoProperties(@Param("list") List item, @Param("maId") Integer maId); MaDevInfo getDevice(Integer maId); + + List getDeviceByMaIds(String[] maIdArray); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java index 05af74e..d15efd4 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java @@ -165,7 +165,7 @@ public class DevChangeServiceImpl implements DevChangeService { String usUnit = mapper.getChangeUnit(list.get(0).getDevId()); vo.setUseUint(usUnit); vo.setChangeUnit(usUnit); - vo.setChangeStatus("1"); + vo.setChangeStatus("4"); vo.setDevNum(list.size() + ""); String proId = vo.getProCode(); int num = mapper.addChangeInfo(vo); @@ -221,12 +221,17 @@ public class DevChangeServiceImpl implements DevChangeService { String usUnit = mapper.getChangeUnit(list.get(0).getDevId()); vo.setUseUint(usUnit); vo.setChangeUnit(usUnit); - vo.setChangeStatus("5"); + vo.setChangeStatus("1"); vo.setDevNum(list.size() + ""); String proId = vo.getProCode(); int num = mapper.addChangeInfo(vo); if (num > 0) { for (CsDeviceChangeDetailsVo deviceChangeDetailsVo : list) { + CsDeviceChangeVo entity = new CsDeviceChangeVo(); + entity.setDevId(deviceChangeDetailsVo.getDevId()); + entity.setChangeStatus(deviceChangeDetailsVo.getStatus()); + entity.setUseUint(usUnit); + entity.setChangeUnit(usUnit); if ("1".equals(deviceChangeDetailsVo.getStatus())) { updateDevDetails2(deviceChangeDetailsVo.getDevId(), proId, "1", deviceChangeDetailsVo.getNum()); } else { @@ -243,7 +248,7 @@ public class DevChangeServiceImpl implements DevChangeService { vo.setUserName(null); vo.setUserPhone(null); vo.setProCode(null); - mapper.updateDevInfo(vo); + mapper.updateDevInfo(entity); } } } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoService.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoService.java index 4897e1c..0a8c010 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoService.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoService.java @@ -1,5 +1,6 @@ package com.bonus.material.devchange.service; +import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.material.devchange.domain.DeviceCountBean; import com.bonus.material.devchange.domain.DeviceTreeBean; import com.bonus.material.devchange.domain.MaDevInfo; @@ -27,4 +28,6 @@ public interface MaDevInfoService { Integer updateDeviceApi(MaDevInfo o); MaDevInfo getDevice(Integer maId); + + AjaxResult getDeviceByMaIds(String maIds); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java index 60f8fe8..933645c 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java @@ -1,6 +1,7 @@ package com.bonus.material.devchange.service; import com.bonus.common.core.utils.StringUtils; +import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.devchange.domain.DeviceCountBean; import com.bonus.material.devchange.domain.DeviceTreeBean; @@ -109,6 +110,16 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { return item; } + /** + * @param maIds + * @return + */ + @Override + public AjaxResult getDeviceByMaIds(String maIds) { + String[] maIdArray = maIds.split(","); + return AjaxResult.success(mapper.getDeviceByMaIds(maIdArray)); + } + /** * 将扁平列表构建成树,并添加一个总的根节点 */ diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/domain/OrderInfoDto.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/domain/OrderInfoDto.java index 1e9b647..f49f6a0 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/domain/OrderInfoDto.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/domain/OrderInfoDto.java @@ -170,4 +170,7 @@ public class OrderInfoDto { @ApiModelProperty(value = "出库时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private String preOutboundTime; + + + private String maIds; } diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml index 1c86622..0704384 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml @@ -33,10 +33,9 @@ update ma_dev_info set xq_unit=#{useUint}, - user_info=#{userName}, - user_phone=#{userPhone}, on_project=#{proCode}, - change_status=#{changeStatus} + change_status=#{changeStatus}, + ma_status = #{changeStatus} where ma_id = #{devId} @@ -189,8 +188,7 @@ mt.childGx, mt.devCategory, mt.devSubcategory, - mt.devName, - mt.devModel, + dev.item_type_model AS devModel, bci.company_name compName, bci.operate_address orgName, IFNULL(pro.pro_name, '-') proName, diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml index bd65d32..882ff11 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml @@ -371,7 +371,12 @@ and DATE_FORMAT(mdi.purchase_date,'%Y-%m-%d') between #{startPurchaseDate} and #{endPurchaseDate} - and mdi.change_status = #{status} + + and mdi.change_status in(2,3) + + + AND mdi.change_status=#{status} + @@ -442,4 +447,20 @@ mdi.is_active = '1' AND mdi.ma_id =#{maId} + + diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevRetireWarningMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevRetireWarningMapper.xml index 788a775..37caa17 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevRetireWarningMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevRetireWarningMapper.xml @@ -9,8 +9,9 @@ c.company_name AS propertyUnit, mdi.ma_id AS maId, mdi.device_name AS name, + mdi.item_type_model AS specificationModel, mdi.`code` AS code, - mdi.brand AS manufacturer, + ms.supplier_name AS manufacturer, mdi.production_date AS productionDate, mdi.expiration_time AS expirationTime, IF(STR_TO_DATE(production_date, '%Y-%m-%d') IS NOT NULL AND STR_TO_DATE(expiration_time, '%Y-%m-%d') IS NOT @@ -44,12 +45,13 @@ ma_dev_info mdi LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id + LEFT JOIN ma_supplier ms ON ms.supplier_id = mdi.supplier_id WHERE mdi.is_active = 1 and mdi.entry_status = '1' and mdi.change_status in (1,5) - AND mdi.device_name like concat('%',#{deviceName},'%') + AND mdi.device_name like concat('%',#{name},'%') - - AND mdi.manufacturer like concat('%',#{manufacturer},'%') + + AND mdi.supplier_id like concat('%',#{manufacturerId},'%') ) a diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevMergeMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevMergeMapper.xml index 5b25f5b..586ed27 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevMergeMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevMergeMapper.xml @@ -183,7 +183,7 @@ - UPDATE ma_dev_info SET change_status = #{data.value} WHERE ma_id = #{data.key} + UPDATE ma_dev_info SET change_status ='1' WHERE ma_id = #{data.key} diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml index 8f5e947..ce4efc5 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml @@ -143,6 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT moi.code AS code, GROUP_CONCAT(hh.id) AS ids, + GROUP_CONCAT(mdi.ma_id) AS maIds, moi.order_time, mdi.on_company as sellerCompany, up.dept_name AS czcompanyName, @@ -165,9 +166,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join sys_dept up on up.dept_id = mdi.on_company WHERE mt.del_flag = '0' - - and moi.code like concat('%',#{keyWord},'%') - + + and moi.code like concat('%',#{keyWord},'%') + AND moi.buyer_company = #{buyerCompany} @@ -195,11 +196,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND dept.dept_name like concat('%',#{companyName},'%') GROUP BY - moi.buyer_company, - moi.`code`, - su.phonenumber, - moi.address, - moi.order_time + moi.buyer_company, + moi.`code`, + su.phonenumber, + moi.address, + moi.order_time order by moi.order_time desc