From 4f6c7d6b1a70131d64049577e3c28430e3aa8feb Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Mon, 15 Sep 2025 00:09:22 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat(device):=20=E6=96=B0=E5=A2=9E=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=AE=A1=E7=90=86=E6=96=B9=E5=BC=8F=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 DevInfo 类中添加 deviceType 字段,用于表示设备管理方式(0: 编码, 1: 数量)- 在 DevInfoMapper.xml 中添加 --- .../main/java/com/bonus/material/device/domain/DevInfo.java | 3 +++ .../main/resources/mapper/material/device/DevInfoMapper.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java index 60bf9df..cde8acc 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java @@ -68,6 +68,9 @@ public class DevInfo extends BaseEntity { @ApiModelProperty(value = "整机装备重量") private String deviceWeight; + @ApiModelProperty(value = "设备管理方式: 0编码 1数量") + private Byte deviceType; + @Excel(name = "设备数量") @ApiModelProperty(value = "设备数量") private Integer deviceCount; diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index 93dff3a..200ada2 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -227,6 +227,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" d.ma_id as maId, d.code as code, d.buy_price as buyPrice, + d.device_type as deviceType, d.item_type_model as itemTypeModel, identify_code as identifyCode, d.device_name as deviceName, @@ -288,6 +289,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" device_name, device_weight, + device_type, device_count, code, identify_code, @@ -331,6 +333,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{deviceName}, #{deviceWeight}, + #{deviceType}, #{deviceCount}, #{code}, #{identifyCode}, From 610c290d1f1190cd21bbe80cfe1eae45cc29cd7d Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Mon, 15 Sep 2025 09:09:13 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=92=8C=E7=9C=81=E5=85=AC?= =?UTF-8?q?=E5=8F=B8=E7=9F=AD=E4=BF=A1=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 bootstrap-material_mall_test.yml 测试配置文件 - 添加省公司短信sms-util依赖- 更新pom.xml文件,包含新增的短信依赖包 --- bonus-modules/bonus-material-mall/pom.xml | 7 ++++ .../bootstrap-material_mall_test.yml | 33 ++++++++++++++++++ .../src/main/resources/lib/sms-util-1.0.jar | Bin 0 -> 14820 bytes 3 files changed, 40 insertions(+) create mode 100644 bonus-modules/bonus-material-mall/src/main/resources/bootstrap-material_mall_test.yml create mode 100644 bonus-modules/bonus-material-mall/src/main/resources/lib/sms-util-1.0.jar diff --git a/bonus-modules/bonus-material-mall/pom.xml b/bonus-modules/bonus-material-mall/pom.xml index 10199f1..9094e2b 100644 --- a/bonus-modules/bonus-material-mall/pom.xml +++ b/bonus-modules/bonus-material-mall/pom.xml @@ -17,6 +17,13 @@ + + + com.ahsbd + sms-util + ${project.basedir}/src/main/resources/lib/sms-util-1.0.jar + + com.github.ulisesbocchio diff --git a/bonus-modules/bonus-material-mall/src/main/resources/bootstrap-material_mall_test.yml b/bonus-modules/bonus-material-mall/src/main/resources/bootstrap-material_mall_test.yml new file mode 100644 index 0000000..200552e --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/resources/bootstrap-material_mall_test.yml @@ -0,0 +1,33 @@ +# Tomcat +server: + port: 18589 + +# Spring +spring: + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 14.103.246.124:8848 +# server-addr: 192.168.1.2:8848 + namespace: material_mall + ip: 192.168.0.69 + config: + # 配置中心地址 + server-addr: 14.103.246.124:8848 +# server-addr: 192.168.1.2:8848 + namespace: material_mall + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +#加密组件 +jasypt: + encryptor: + password: Encrypt + +mybatis: + configuration: + map-underscore-to-camel-case: true \ No newline at end of file diff --git a/bonus-modules/bonus-material-mall/src/main/resources/lib/sms-util-1.0.jar b/bonus-modules/bonus-material-mall/src/main/resources/lib/sms-util-1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..7b093559e1e9dc7125485fe7a3c54cbf215e8650 GIT binary patch literal 14820 zcma)j1yo(h(lzexPH=bk;O-tE2^QSBxVyVsaCdiicY?dSlK|l-Z{|&AGBfZ0nsx5I zYf-hkPj{WF>OQ*^q(Q-8fPOS|r+4rE^W*mq=+|#qQ58WtNjWhFh2O=XfY4sW4!W6C ztX}`^_j;lISxi{@noL`Is9ehOZij(U7_qDF~vmStntmR4$fkXD*b z2nup1S1k^MrjyjEDNTySPRc%=x(qEtcKK^9fQBK_PSI3P(iBExwCW8L7l~>YM-?rb ze3!l5d4Ro%x!wN|$NVR8Yh7F2pLYoLpS6sHpi*Oa z6=r(95MM7{Yin~8eO-GKD@%H33v=o53F#4;hOJ#C1MygWVM;&$RGaeqUaNAAjvppr35y7WDs zypZX!gJ-Y@V>}*6LlD@DcN6T9u4AAcqk*r$1}W+tUod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=?*+uJ%VKta+&jq{u@AFnT-s!qiPg6wxN_KEiYPPSclN z&hvxORvLu_X31ny3Nw?74~TqHBYPbJ{;SR>C)7i^Qw4`?QVf++M2&e3J71te_FVEA z@gAeu(Pp_1=EM@H8{mBEkV{9Nr1dc0dBHzJ7f3l=B6Tl6Mj*6q!2=zyP?7;P(&H2B z(w)SKt%8KscN~olp+#)u=Aa`k5o&ZSq?NkAfc`bXGHq=PGk#rIlh=#!|GdD~wpP}L zw)Q55cFGR&W72d|w34!l62&SPvb54;+q+5#khZHzv1nnVXmGM+aB!tEaOi2i!f0V| zVKUB5!%CqcEZ5iO@V9VIP1B)Q(y+YB=CRjyw-R;Oo!dDp>w~sILsS-`fw3qu(|DQ_=G8N&EgY?h)lb;Qs%&nZI`M>lWf?2f8%> z+QDBp6u(0Lnvwp5G^G0n$iL;MKk@$V%6=puzcnPFmzVz6inKqR;eXSSfA Date: Mon, 15 Sep 2025 09:46:49 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/device/mapper/DevInfoMapper.java | 22 ++ .../controller/ProvinceScreenController.java | 161 +++++++++ .../largeScreen/entity/DevInfoReq.java | 26 ++ .../service/ProvinceScreenService.java | 51 +++ .../impl/ProvinceScreenServiceImpl.java | 342 ++++++++++++++++++ .../mapper/material/device/DevInfoMapper.xml | 80 ++++ 6 files changed, 682 insertions(+) create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/controller/ProvinceScreenController.java create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/entity/DevInfoReq.java create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/service/ProvinceScreenService.java create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/service/impl/ProvinceScreenServiceImpl.java diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java index 75e1f97..d8be7f5 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java @@ -10,10 +10,12 @@ import com.bonus.material.device.domain.dto.InfoMotionDto; import com.bonus.material.device.domain.vo.DevInfoPropertyVo; import com.bonus.material.device.domain.vo.DevInfoVo; import com.bonus.material.device.domain.vo.LeaseVo; +import com.bonus.material.largeScreen.entity.DevInfoReq; import com.bonus.material.largeScreen.entity.LeaseInfo; import com.bonus.material.largeScreen.entity.RentInfo; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -276,5 +278,25 @@ public interface DevInfoMapper { List getDemandUnit(DevInfoVo devInfoVo); int updateTypeLeasePrice(DevInfo devInfo); + + Integer getTotalEquipment(DevInfoReq devInfoReq); + + BigDecimal getTotalValue(DevInfoReq devInfoReq); + + int getLineNum(DevInfoReq devInfoReq); + + BigDecimal getLinePrice(DevInfoReq devInfoReq); + + List getLineProductionDateList(DevInfoReq devInfoReq); + + List getUnitEquipmentConfiguration(); + + BigDecimal getPrice(Long deptId); + + int getEquipmentStatus(String changeStatus); + + int getChangeNum(); + + int getTurnoverRate(); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/controller/ProvinceScreenController.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/controller/ProvinceScreenController.java new file mode 100644 index 0000000..87acf9c --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/controller/ProvinceScreenController.java @@ -0,0 +1,161 @@ +package com.bonus.material.largeScreen.controller; + +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.material.device.domain.DevInfo; +import com.bonus.material.largeScreen.service.ProvinceScreenService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 马三炮 + * @date 2025/9/14 + */ +@Api(value = "网省大屏", tags = {"网省大屏"}) +@RestController +@RequestMapping("/provinceScreen") +public class ProvinceScreenController extends BaseController { + + @Resource + private ProvinceScreenService provinceScreenService; + + /** + * 装备总量,总价值 + * @return + */ + @ApiOperation("装备总量,总价值") + @GetMapping("/getTotalEquipment") + public AjaxResult getTotalEquipment() { + try { + Map res = provinceScreenService.getTotalEquipment(); + return AjaxResult.success(res); + } catch (Exception e) { + return AjaxResult.error("装备总量,总价值异常"); + } + } + + /** + *线路装备,变电装备,电缆装备 + * @return + */ + @ApiOperation("线路装备,变电装备,电缆装备") + @GetMapping("/getTotalEquipment") + public AjaxResult getEquipmentClassification() { + try { + Map res = provinceScreenService.getEquipmentClassification(); + return AjaxResult.success(res); + } catch (Exception e) { + return AjaxResult.error("线路装备,变电装备,电缆装备异常"); + } + } + + /** + * 单位装备配置 + * @return + */ + @ApiOperation("单位装备配置") + @GetMapping("/getUnitEquipmentConfiguration") + public AjaxResult getUnitEquipmentConfiguration() { + try { + List> res = provinceScreenService.getUnitEquipmentConfiguration(); + return AjaxResult.success(res); + } catch (Exception e) { + return AjaxResult.error("单位装备配置异常"); + } + } + + /** + * 装备状态 + * @return + */ + @ApiOperation("装备状态") + @GetMapping("/getEquipmentStatus") + public AjaxResult getEquipmentStatus() { + try { + List> res = provinceScreenService.getEquipmentStatus(); + return AjaxResult.success(res); + } catch (Exception e) { + return AjaxResult.error("装备状态异常"); + } + } + + /** + * 项目装备 + * @return + */ + @ApiOperation("项目装备") + @GetMapping("/getProjectEquipment") + public AjaxResult getProjectEquipment() { + try { + Map res = provinceScreenService.getProjectEquipment(); + return AjaxResult.success(res); + } catch (Exception e) { + return AjaxResult.error("项目装备异常"); + } + } + + /** + * 各单位装备在用率情况 + * @return + */ + @ApiOperation("各单位装备在用率情况") + @GetMapping("/getDeptEquipment") + public AjaxResult getDeptEquipment() { + try { + List> res = provinceScreenService.getDeptEquipment(); + return AjaxResult.success(res); + } catch (Exception e) { + return AjaxResult.error("项目装备异常"); + } + } + + /** + * 工程在用装备情况 + * @return + */ + @ApiOperation("工程在用装备情况") + @GetMapping("/getEquipmentUse") + public AjaxResult getEquipmentUse() { + try { + List> res = provinceScreenService.getEquipmentUse(); + for (int i = 0; i < 10; i++) { + Map map = new HashMap<>(); + map.put("projectName","石桥-大陇π入万济变、大陇-阳湖T接万济变 35kV架空线路工程"); + map.put("inUser","82"); + map.put("scale","172"); + map.put("usage","47.67"); + res.add(map); + } + return AjaxResult.success(res); + } catch (Exception e) { + return AjaxResult.error("工程在用装备情况异常"); + } + } + + @ApiOperation("装备在用率统计") + @GetMapping("/getUsageStatistics") + public AjaxResult getUsageStatistics() { + try { + List> res = provinceScreenService.getUsageStatistics(); + for (int i = 0; i < 10; i++) { + Map map = new HashMap<>(); + map.put("projectName","石桥-大陇π入万济变、大陇-阳湖T接万济变 35kV架空线路工程"); + map.put("inUser","82"); + map.put("scale","172"); + map.put("usage","47.67"); + res.add(map); + } + return AjaxResult.success(res); + } catch (Exception e) { + return AjaxResult.error("装备在用率统计异常"); + } + } +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/entity/DevInfoReq.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/entity/DevInfoReq.java new file mode 100644 index 0000000..cc96ea4 --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/entity/DevInfoReq.java @@ -0,0 +1,26 @@ +package com.bonus.material.largeScreen.entity; + +import lombok.Data; + +/** + * @author 马三炮 + * @date 2025/9/14 + */ +@Data +public class DevInfoReq { + + /** + * 设备所属公司 + */ + public Integer ownCo; + + /** + * 类型id + */ + public Integer typeId; + + /** + *默认 1 变更状态 变更类型 1入库 2、3 出库(2是自用 3共享) 4退役 5维修 + */ + public String changeStatus; +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/service/ProvinceScreenService.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/service/ProvinceScreenService.java new file mode 100644 index 0000000..2c5d555 --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/service/ProvinceScreenService.java @@ -0,0 +1,51 @@ +package com.bonus.material.largeScreen.service; + +import java.util.List; +import java.util.Map; + +public interface ProvinceScreenService { + + /** + * 装备总量,总价值 + * @return + */ + Map getTotalEquipment(); + + /** + *线路装备,变电装备,电缆装备 + * @return + */ + Map getEquipmentClassification(); + + /** + * 单位装备配置 + * @return + */ + List> getUnitEquipmentConfiguration(); + + /** + * 装备状态 + * @return + */ + List> getEquipmentStatus(); + + /** + * 项目装备 + * @return + */ + Map getProjectEquipment(); + + /** + * 各单位装备在用率情况 + * @return + */ + List> getDeptEquipment(); + + /** + * 工程在用装备情况 + * @return + */ + List> getEquipmentUse(); + + List> getUsageStatistics(); +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/service/impl/ProvinceScreenServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/service/impl/ProvinceScreenServiceImpl.java new file mode 100644 index 0000000..623db9f --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/service/impl/ProvinceScreenServiceImpl.java @@ -0,0 +1,342 @@ +package com.bonus.material.largeScreen.service.impl; + +import com.bonus.common.core.utils.DateUtils; +import com.bonus.material.device.domain.DevInfo; +import com.bonus.material.device.mapper.DevInfoMapper; +import com.bonus.material.equipment.domain.DeptConfigRateSummary; +import com.bonus.material.equipment.mapper.SysDeptMapper; +import com.bonus.material.equipment.service.ISysDeptService; +import com.bonus.material.equipment.service.impl.SysDeptServiceImpl; +import com.bonus.material.largeScreen.entity.DevInfoReq; +import com.bonus.material.largeScreen.service.ProvinceScreenService; +import com.bonus.system.api.domain.SysDept; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.Period; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.*; + +/** + * @author 马三炮 + * @date 2025/9/14 + */ +@Service +@Slf4j +public class ProvinceScreenServiceImpl implements ProvinceScreenService { + + @Resource + private DevInfoMapper devInfoMapper; + + @Resource + private SysDeptMapper sysDeptMapper; + + @Resource + private ISysDeptService sysDeptService; + + /** + * 装备总量,总价值 + * @return + */ + @Override + public Map getTotalEquipment() { + Map res = new HashMap<>(); + DevInfoReq devInfoReq = new DevInfoReq(); + //装备总量 + Integer totalEquipmentQuantity = devInfoMapper.getTotalEquipment(devInfoReq); + res.put("totalEquipmentQuantity",totalEquipmentQuantity); + //总价值 + BigDecimal totalValue = devInfoMapper.getTotalValue(devInfoReq); + res.put("totalValue",totalValue); + return res; + } + + /** + *线路装备,变电装备,电缆装备 + * @return + */ + @Override + public Map getEquipmentClassification() { + Map res = new HashMap<>(); + Map res1 = new HashMap<>(); + Map res2 = new HashMap<>(); + Map res3 = new HashMap<>(); + DevInfoReq devInfoReq = new DevInfoReq(); + //线路装备 + //装备数 + devInfoReq.setTypeId(1); + int lineNum = devInfoMapper.getLineNum(devInfoReq); + res1.put("num",lineNum); + BigDecimal linePrice = devInfoMapper.getLinePrice(devInfoReq); + res1.put("price",linePrice); + List lineProductionDateList = devInfoMapper.getLineProductionDateList(devInfoReq); + count(res1,lineProductionDateList); + //变电装备 + //装备数 + devInfoReq.setTypeId(2); + int substationNum = devInfoMapper.getLineNum(devInfoReq); + res2.put("num",substationNum); + BigDecimal substationPrice = devInfoMapper.getLinePrice(devInfoReq); + res2.put("price",substationPrice); + List substationProductionDateList = devInfoMapper.getLineProductionDateList(devInfoReq); + count(res2,substationProductionDateList); + //电缆装备 + //装备数 + devInfoReq.setTypeId(3); + int cableNum = devInfoMapper.getLineNum(devInfoReq); + res3.put("num",cableNum); + BigDecimal cablePrice = devInfoMapper.getLinePrice(devInfoReq); + res3.put("price",cablePrice); + List cableProductionDateList = devInfoMapper.getLineProductionDateList(devInfoReq); + count(res3,cableProductionDateList); + + res.put("line",res1); + res.put("substation",res2); + res.put("cable",res3); + return res; + } + + /** + * 单位装备配置 + * @return + */ + @Override + public List> getUnitEquipmentConfiguration() { + //获取所有单位 TODO 后期可能单位放到字典表这里要修改 + SysDept sysDept = new SysDept(); + DevInfoReq devInfoReq = new DevInfoReq(); + List sysDeptList = sysDeptMapper.selectDeptList(sysDept); + List> res = new ArrayList<>(); + for (SysDept sysDeptNew:sysDeptList) { + Map dept = new HashMap<>(); + dept.put("deptName",sysDeptNew.getDeptName()); + devInfoReq.setOwnCo(Math.toIntExact(sysDeptNew.getDeptId())); + //装备价值 + BigDecimal totalValue = devInfoMapper.getTotalValue(devInfoReq); + dept.put("totalValue",totalValue); + //装备总数 + Integer totalEquipmentQuantity = devInfoMapper.getTotalEquipment(devInfoReq); + dept.put("totalEquipmentQuantity",totalEquipmentQuantity); + //线路 + devInfoReq.setTypeId(1); + int lineNum = devInfoMapper.getLineNum(devInfoReq); + dept.put("lineNum",lineNum); + //变电 + devInfoReq.setTypeId(2); + int substationNum = devInfoMapper.getLineNum(devInfoReq); + dept.put("substationNum",substationNum); + //电缆 + devInfoReq.setTypeId(3); + int cableNum = devInfoMapper.getLineNum(devInfoReq); + dept.put("cableNum",cableNum); + // 获取装备转换率 + DeptConfigRateSummary user = new DeptConfigRateSummary(); + List list = sysDeptService.selectDeptConfigRatePivot(user); + for (DeptConfigRateSummary deptConfigRateSummary: list) { + if (deptConfigRateSummary.getDeptId().equals(sysDeptNew.getDeptId())){ + //总数 + dept.put("configRate",deptConfigRateSummary.getConfigRate()); + //线路 + dept.put("valueA",deptConfigRateSummary.getValueA()); + //变电 + dept.put("valueA",deptConfigRateSummary.getValueB()); + //电缆 + dept.put("valueA",deptConfigRateSummary.getValueC()); + } + } + res.add(dept); + } + return res; + } + + /** + * 装备状态 + * @return + */ + @Override + public List> getEquipmentStatus() { + List> res = new ArrayList<>(); + Map res1 = new HashMap<>(); + Map res2 = new HashMap<>(); + Map res3 = new HashMap<>(); + Map res4 = new HashMap<>(); + //在库--1 + int inStock = devInfoMapper.getEquipmentStatus("1"); + res1.put("name","在库"); + res1.put("num",inStock); + //自用--2 + int inUse = devInfoMapper.getEquipmentStatus("2"); + //共享--3 + int share = devInfoMapper.getEquipmentStatus("3"); + res2.put("name","在用"); + res2.put("num",inUse+share); + //维修--5 + int repair = devInfoMapper.getEquipmentStatus("5"); + res3.put("name","在修"); + res3.put("num",repair); + + res4.put("name","共享"); + res4.put("num",share); + int count = inStock+inUse+share+repair; + res1.put("proportion",count > 0 ? (inStock * 100) / count : 0+"%"); + res2.put("proportion",count > 0 ? ((inUse+share) * 100) / count : 0+"%"); + res3.put("proportion",count > 0 ? (repair * 100) / count : 0+"%"); + res4.put("proportion",0); + res.add(res1); + res.add(res2); + res.add(res3); + res.add(res4); + return null; + } + + /** + * 项目装备 + * @return + */ + @Override + public Map getProjectEquipment() { + + Map res = new HashMap<>(); + //年度总投资额 TODO 输入的 + res.put("annualTotal","140.6"); + //在建工程数 TODO e基建2.0获取 + res.put("projectNUm",50); + //在用装备数 + //自用--2 + int inUse = devInfoMapper.getEquipmentStatus("2"); + //共享--3 + int share = devInfoMapper.getEquipmentStatus("3"); + res.put("num",inUse+share); + //在用率 + DevInfoReq devInfoReq = new DevInfoReq(); + Integer totalEquipmentQuantity = devInfoMapper.getTotalEquipment(devInfoReq); + res.put("proportion",totalEquipmentQuantity > 0 ? ((inUse+share) * 100) / totalEquipmentQuantity : 0+"%"); + //周转率 + int devNum = devInfoMapper.getChangeNum(); + res.put("turnoverRate",totalEquipmentQuantity > 0 ? (devNum * 100) / totalEquipmentQuantity : 0+"%"); + return res; + } + + /** + * 各单位装备在用率情况 + * @return + */ + @Override + public List> getDeptEquipment() { + List> res = new ArrayList<>(); + SysDept sysDept = new SysDept(); + List sysDeptList = sysDeptMapper.selectDeptList(sysDept); + for (SysDept sysDeptNew:sysDeptList) { + Map dept = new HashMap<>(); + DevInfoReq devInfoReq = new DevInfoReq(); + devInfoReq.setOwnCo(Math.toIntExact(sysDeptNew.getDeptId())); + //装备总数 + Integer sum = devInfoMapper.getTotalEquipment(devInfoReq); + //自用2 + devInfoReq.setChangeStatus("2"); + Integer inUse = devInfoMapper.getTotalEquipment(devInfoReq); + devInfoReq.setChangeStatus("3"); + Integer share = devInfoMapper.getTotalEquipment(devInfoReq); + inUse = inUse+share; + dept.put("name",sysDeptNew.getDeptName()); + //在用率 + dept.put("proportion",sum > 0 ? (inUse * 100) / sum : 0+"%"); + //周转率 + int turnoverRate = devInfoMapper.getTurnoverRate(); + dept.put("turnoverRate",sum > 0 ? (turnoverRate * 100) / sum : 0+"次/年"); + dept.put("inUse",inUse); + res.add(dept); + } + // 【核心排序逻辑】按proportion数值降序排序(高在用率优先) + Collections.sort(res, new Comparator>() { + @Override + public int compare(Map map1, Map map2) { + // 1. 提取两个map中的proportion字符串 + String proportion1 = (String) map1.get("proportion"); + String proportion2 = (String) map2.get("proportion"); + // 2. 处理null值(默认视为0%) + proportion1 = proportion1 == null ? "0%" : proportion1; + proportion2 = proportion2 == null ? "0%" : proportion2; + // 3. 去掉"%"符号,转为Integer数值(核心步骤) + // 注意:若proportion含小数(如"83.5%"),需转为Double,此处按整数处理(适配原代码逻辑) + int propValue1 = Integer.parseInt(proportion1.replace("%", "")); + int propValue2 = Integer.parseInt(proportion2.replace("%", "")); + // 4. 数值降序排序(高在用率在前);升序用:propValue1 - propValue2 + return propValue2 - propValue1; + } + }); + return res; + } + + /** + * 工程在用装备情况 + * @return + */ + @Override + public List> getEquipmentUse() { + List> res = new ArrayList<>(); + return res; + } + + @Override + public List> getUsageStatistics() { + return null; + } + + /** + * 统计数量 + */ + public void count(Map res,List lineProductionDateList){ + int five = 0; + int fiveOrTen = 0; + int ten = 0; + if (lineProductionDateList.size()>0){ + for (String date :lineProductionDateList){ + int yearDiff = calculateYearDifferenceWithJava8(date); + if (yearDiff<5){ + five++; + }else if(yearDiff>10){ + ten++; + }else { + fiveOrTen++; + } + } + five = lineProductionDateList.size() > 0 ? (five * 100) / lineProductionDateList.size() : 0; + fiveOrTen = lineProductionDateList.size() > 0 ? (fiveOrTen * 100) / lineProductionDateList.size() : 0; + ten = lineProductionDateList.size() > 0 ? (ten * 100) / lineProductionDateList.size() : 0; + } + res.put("five",five+"%"); + res.put("fiveOrTen",fiveOrTen+"%"); + res.put("ten",ten+"%"); + } + + /** + * 计算当前日期与production_date的完整年数差(基于Java 8+ LocalDate) + * @param productionDateStr 生产日期字符串(格式:yyyy-MM-dd,如"2020-05-18") + * @return 年数差(正数:当前日期在production_date之后;负数:当前日期在production_date之前;0:同年) + * @throws DateTimeParseException 若日期字符串格式不符合要求,抛出解析异常 + */ + public static int calculateYearDifferenceWithJava8(String productionDateStr) throws DateTimeParseException { + // 1. 定义日期格式器(匹配输入的production_date字符串格式) + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + + // 2. 将字符串类型的production_date解析为LocalDate对象 + LocalDate productionDate = LocalDate.parse(productionDateStr, formatter); + + // 3. 获取当前系统日期(仅日期,不含时间) + LocalDate currentDate = LocalDate.now(); + + // 4. 计算两个LocalDate之间的周期(Period包含年、月、日差) + Period period = Period.between(productionDate, currentDate); + + // 5. 返回完整年数差(Period的getYears()方法直接返回满1年的数量) + return period.getYears(); + } + + + +} diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index 200ada2..3cb3fbe 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -1405,4 +1405,84 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ma_lease_info mli LEFT JOIN sys_dept sd ON mli.publish_company = sd.dept_id + + + + + + + + + + From e7700f872c1edb6608cad97429673443d3960519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E4=B8=89=E7=82=AE?= <15856818120@163.com> Date: Mon, 15 Sep 2025 10:02:17 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../largeScreen/controller/ProvinceScreenController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/controller/ProvinceScreenController.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/controller/ProvinceScreenController.java index 87acf9c..a741c96 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/controller/ProvinceScreenController.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/largeScreen/controller/ProvinceScreenController.java @@ -47,7 +47,7 @@ public class ProvinceScreenController extends BaseController { * @return */ @ApiOperation("线路装备,变电装备,电缆装备") - @GetMapping("/getTotalEquipment") + @GetMapping("/getEquipmentClassification") public AjaxResult getEquipmentClassification() { try { Map res = provinceScreenService.getEquipmentClassification(); From 3db006b06183897a05827db66ec426853c7a745a Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Mon, 15 Sep 2025 15:11:52 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=9C=AA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E7=9F=AD=E4=BF=A1=E4=BE=9D=E8=B5=96=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除了 OrderMapper 接口中 updateOrderStatus 方法的多余逗号 - 移除了 pom.xml 中未使用的短信依赖包 sms-util --- bonus-modules/bonus-material-mall/pom.xml | 7 ------- .../java/com/bonus/material/order/mapper/OrderMapper.java | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/bonus-modules/bonus-material-mall/pom.xml b/bonus-modules/bonus-material-mall/pom.xml index 9094e2b..10199f1 100644 --- a/bonus-modules/bonus-material-mall/pom.xml +++ b/bonus-modules/bonus-material-mall/pom.xml @@ -17,13 +17,6 @@ - - - com.ahsbd - sms-util - ${project.basedir}/src/main/resources/lib/sms-util-1.0.jar - - com.github.ulisesbocchio diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/mapper/OrderMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/mapper/OrderMapper.java index e8136ef..624e571 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/mapper/OrderMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/mapper/OrderMapper.java @@ -34,7 +34,7 @@ public interface OrderMapper { void updateMaStatus(OrderDetailDto orderDetailDto); - Integer updateOrderStatus(@Param("orderId") Integer orderId, @Param("maIds") List maIds, @Param("orderStatus") String orderStatus,@Param("userName") String userName, @Param("remark") String remark); + Integer updateOrderStatus(@Param("orderId") Integer orderId, @Param("maIds") List maIds, @Param("orderStatus") String orderStatus, @Param("userName") String userName, @Param("remark") String remark); Integer updateDevCount(OrderDetailDto orderDetailDto); Integer updateAddDevCount(OrderDetailDto orderDetailDto); From 92a57ff38370b1b2e92a8b4d4562f06a0c617ad0 Mon Sep 17 00:00:00 2001 From: haozq <1611483981@qq.com> Date: Mon, 15 Sep 2025 20:42:21 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DevChangeController.java | 45 ++- .../domain/CsDeviceChangeDetailsVo.java | 7 + .../devchange/domain/CsDeviceChangeVo.java | 22 ++ .../devchange/domain/DevChangeDetailsVo.java | 28 ++ .../devchange/domain/DevChangeVo.java | 4 + .../devchange/mapper/DevChangeMapper.java | 32 +- .../devchange/service/DevChangeService.java | 8 +- .../service/DevChangeServiceImpl.java | 279 +++++++++++++++++- .../material/devchange/DevChangeMapper.xml | 84 ++++-- 9 files changed, 476 insertions(+), 33 deletions(-) create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/DevChangeDetailsVo.java diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/DevChangeController.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/DevChangeController.java index 5f8413c..4d86329 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/DevChangeController.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/controller/DevChangeController.java @@ -2,9 +2,14 @@ package com.bonus.material.devchange.controller; import cn.hutool.core.convert.Convert; import com.bonus.common.biz.config.ListPagingUtil; +import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.core.web.page.TableDataInfo; +import com.bonus.common.log.annotation.SysLog; +import com.bonus.common.log.enums.OperaType; +import com.bonus.material.basic.domain.BmSlideShow; +import com.bonus.material.common.annotation.PreventRepeatSubmit; import com.bonus.material.devchange.domain.CsDeviceChangeDetailsVo; import com.bonus.material.devchange.domain.CsDeviceChangeVo; import com.bonus.material.devchange.domain.DevChangeVo; @@ -17,6 +22,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; @RestController @@ -67,7 +73,7 @@ public class DevChangeController extends BaseController { - @ApiOperation(value = "新增出库、入库、-退役、维修 ") + @ApiOperation(value = "新增出库") @PostMapping("/addChangeInfo") public AjaxResult addChangeInfo(@RequestBody CsDeviceChangeVo vo) { return service.addChangeInfo(vo); @@ -75,6 +81,32 @@ public class DevChangeController extends BaseController { + @ApiOperation(value = "入库和维修") + @PostMapping("/updateDevChangeInfo") + public AjaxResult updateDevChangeInfo(@RequestBody CsDeviceChangeVo vo) { + return service.updateDevChangeInfo(vo); + } + + @ApiOperation(value = "入库、报废") + @PostMapping("/updateDevChangeInfo2") + public AjaxResult updateDevChangeInfo2(@RequestBody CsDeviceChangeVo vo) { + return service.updateDevChangeInfo2(vo); + } + + @ApiOperation(value = "入库、报废") + @PostMapping("/updateDevChangeInfo3") + public AjaxResult updateDevChangeInfo3(@RequestBody CsDeviceChangeVo vo) { + return service.updateDevChangeInfo3(vo); + } + + + @ApiOperation(value = "导出设备流转台账") + @PostMapping("/export") + public void export(HttpServletResponse response, CsDeviceChangeVo vo) { + List list = service.getDevChangeList(vo); + ExcelUtil util = new ExcelUtil(CsDeviceChangeVo.class); + util.exportExcel(response, list, "设备流转台账"); + } @@ -86,10 +118,19 @@ public class DevChangeController extends BaseController { return getDataTable(list); } + @ApiOperation(value = "导出设备流转台账详情") + @PostMapping("/exportDetails") + public void exportDetails(HttpServletResponse response, CsDeviceChangeDetailsVo vo) { + List list = service.getDevDetails(vo); + ExcelUtil util = new ExcelUtil(DevChangeVo.class); + util.exportExcel(response, list, "导出设备流转台账详情"); + } + + @ApiOperation(value = "出库记录单") @PostMapping("/getDevDetails") public AjaxResult getDevDetails(@RequestBody CsDeviceChangeDetailsVo vo) { - return service.getDevDetails(vo); + return AjaxResult.success(service.getDevDetails(vo)); } } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeDetailsVo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeDetailsVo.java index 6ab0483..ffdbf0a 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeDetailsVo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeDetailsVo.java @@ -8,6 +8,13 @@ public class CsDeviceChangeDetailsVo { private Integer pageNum; private Integer pageSize; + + private String proId; + + private int num=1; + + private String type; + /** * 主键 */ diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeVo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeVo.java index 05e7bc0..305498b 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeVo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeVo.java @@ -1,5 +1,6 @@ package com.bonus.material.devchange.domain; +import com.bonus.common.core.annotation.Excel; import lombok.Data; @Data @@ -12,6 +13,14 @@ public class CsDeviceChangeVo { private Integer pageNum; private Integer pageSize; + /** + * 退役原因 + */ + private String reasonId; + /** + * 退役原因 + */ + private String reasonVal; /** * 主键 */ @@ -19,11 +28,18 @@ public class CsDeviceChangeVo { /** * 变更状前状态 */ + @Excel(name = "流转前状态",width = 20,sort = 4) + private String changeStatusName; + private String changeStatus; /** * 类型 * 变更类型 1入库 2出库 3 退役 4 维修 */ + @Excel(name = "操作类型",width = 25 ,sort = 2) + private String typeName; + + private String type; /** * 变更状态 0自用 1共享 @@ -36,6 +52,7 @@ public class CsDeviceChangeVo { /** * 工程名称 */ + @Excel(name = "使用项目",width = 25,sort = 7) private String proName; /** * 工程类型 @@ -44,6 +61,7 @@ public class CsDeviceChangeVo { /** * 设备数量 */ + @Excel(name = "设备数量",width = 25,sort = 9) private String devNum; /** * 电压等级 @@ -52,6 +70,7 @@ public class CsDeviceChangeVo { /** * 使用单位 */ + @Excel(name = "使用单位",width = 25,sort = 6) private String useUint; /** * 省 @@ -68,14 +87,17 @@ public class CsDeviceChangeVo { /** * 详细地址 */ + @Excel(name = "使用地址",width = 25,sort = 8) private String proLocation; /** * 创建时间 */ + @Excel(name = "操作时间",width = 25,sort = 2) private String createTime; /** * 创建人 */ + @Excel(name = "操作人",width = 20,sort = 1) private String createUser; /** * 使用人 diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/DevChangeDetailsVo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/DevChangeDetailsVo.java new file mode 100644 index 0000000..63de104 --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/DevChangeDetailsVo.java @@ -0,0 +1,28 @@ +package com.bonus.material.devchange.domain; + +import lombok.Data; + +@Data +public class DevChangeDetailsVo { + + private String id; + + private int num=1; + + private String type; + + private String proId; + + private String devId; + + public DevChangeDetailsVo() { + } + + public DevChangeDetailsVo(String devId, String proId, String type, int num) { + this.num = num; + this.type = type; + this.proId = proId; + this.devId = devId; + } + +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/DevChangeVo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/DevChangeVo.java index 94f9833..0d1a717 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/DevChangeVo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/DevChangeVo.java @@ -1,5 +1,6 @@ package com.bonus.material.devchange.domain; +import com.bonus.common.core.annotation.Excel; import com.bonus.material.device.domain.vo.DevInfoPropertyVo; import lombok.Data; @@ -42,10 +43,12 @@ public class DevChangeVo { /** * 设备型号 */ + @Excel(name = "设备型号",width = 25 ,sort = 2) private String devModel; /** * 设备名称 */ + @Excel(name = "设备名称",width = 25 ,sort = 1) private String devName; /** * 等级 @@ -66,6 +69,7 @@ public class DevChangeVo { /** * 设备编码 */ + @Excel(name = "设备名称",width = 25 ,sort = 3) private String devCode; /** * 产权单位 diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/DevChangeMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/DevChangeMapper.java index dfdbf3e..9cc1770 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/DevChangeMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/mapper/DevChangeMapper.java @@ -1,10 +1,7 @@ package com.bonus.material.devchange.mapper; import com.bonus.common.core.web.domain.AjaxResult; -import com.bonus.material.devchange.domain.CsDeviceChangeDetailsVo; -import com.bonus.material.devchange.domain.CsDeviceChangeVo; -import com.bonus.material.devchange.domain.DevChangeVo; -import com.bonus.material.devchange.domain.JjProjectVo; +import com.bonus.material.devchange.domain.*; import com.bonus.material.device.domain.vo.DevInfoPropertyVo; import com.bonus.material.device.domain.vo.DevInfoVo; import org.apache.ibatis.annotations.Mapper; @@ -96,7 +93,7 @@ public interface DevChangeMapper { * @param vo * @return */ - List getDevDetails(CsDeviceChangeDetailsVo vo); + List getDevDetails(CsDeviceChangeDetailsVo vo); /** * 电压等级 @@ -104,4 +101,29 @@ public interface DevChangeMapper { * @return */ List getVoltageLevel(JjProjectVo vo); + + /** + * 修改详情 + * @param deviceChangeDetailsVo + */ + void addDevChangeDetails(DevChangeDetailsVo deviceChangeDetailsVo); + + /** + * 查询数据 + * @param vo + * @return + */ + List getDevChangeDetailsList(DevChangeDetailsVo vo); + + /** + * + * @param voo + */ + void deleteDevChangeDetails(DevChangeDetailsVo voo); + + /** + * 修改数量 + * @param newNum + */ + void updateChangeDetailsNum(DevChangeDetailsVo voo); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeService.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeService.java index 07d699b..79906be 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeService.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeService.java @@ -49,7 +49,7 @@ public interface DevChangeService { * @param vo * @return */ - AjaxResult getDevDetails(CsDeviceChangeDetailsVo vo); + List getDevDetails(CsDeviceChangeDetailsVo vo); /** * 电压等级下拉选 @@ -57,4 +57,10 @@ public interface DevChangeService { * @return */ List getVoltageLevel(JjProjectVo vo); + + AjaxResult updateDevChangeInfo(CsDeviceChangeVo vo); + + AjaxResult updateDevChangeInfo2(CsDeviceChangeVo vo); + + AjaxResult updateDevChangeInfo3(CsDeviceChangeVo vo); } 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 971b46b..a1f38ac 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 @@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSON; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.common.utils.StringUtil; -import com.bonus.material.devchange.domain.CsDeviceChangeDetailsVo; -import com.bonus.material.devchange.domain.CsDeviceChangeVo; -import com.bonus.material.devchange.domain.DevChangeVo; -import com.bonus.material.devchange.domain.JjProjectVo; +import com.bonus.material.devchange.domain.*; import com.bonus.material.devchange.mapper.DevChangeMapper; import com.bonus.material.device.domain.vo.DevInfoPropertyVo; import com.bonus.material.device.domain.vo.DevInfoVo; @@ -66,6 +63,191 @@ public class DevChangeServiceImpl implements DevChangeService { return new ArrayList<>(); } + /** + * 维修 + * @param vo + * @return + */ + @Override + public AjaxResult updateDevChangeInfo(CsDeviceChangeVo vo) { + try{ + String username = SecurityUtils.getLoginUser().getUsername(); + vo.setCreateUser(username); + String proCode=vo.getProCode(); + if (StringUtils.isBlank(proCode)) { + return AjaxResult.error("请选择工程"); + } + if (StringUtils.isBlank(vo.getType())) { + return AjaxResult.error("请上传类型type:1入库 2出库 3 退役 4 维修"); + } + String json=vo.getJsonData(); + if (StringUtils.isBlank(json)) { + return AjaxResult.error("请选择变更的设备"); + } + List list=JSON.parseArray(json, CsDeviceChangeDetailsVo.class); + if(list==null || list.isEmpty()){ + return AjaxResult.error("请选择变更的设备"); + } + + //出库 + if("2".equals(vo.getType())){ + String changeUnit=mapper.getChangeUnit(list.get(0).getDevId()); + vo.setChangeUnit(changeUnit); + } else { + // + String changeUnit=mapper.getChangeUnitById(list.get(0).getDevId()); + vo.setChangeUnit(changeUnit); + } + if("1".equals(vo.getType())){ + //入库厂家 + String changeUnit=mapper.getChangeUnit(list.get(0).getDevId()); + vo.setUseUint(changeUnit); + } + //变更前状态查询 + String changeStatus=mapper.getChangeStatus(list.get(0).getDevId()); + vo.setChangeStatus(changeStatus); + vo.setDevNum(list.size()+""); + int num=mapper.addChangeInfo(vo); + if(num>0){ + for (CsDeviceChangeDetailsVo deviceChangeDetailsVo:list){ + if("1".equals(vo.getStatus())){ + updateDevDetails(deviceChangeDetailsVo.getDevId(),null,"1",deviceChangeDetailsVo.getNum()); + + }else{ + updateDevDetails(deviceChangeDetailsVo.getDevId(),null,"5",deviceChangeDetailsVo.getNum()); + } + //新增设备列表数据 + deviceChangeDetailsVo.setChangeId(vo.getId()); + //新增设备详情 + int isSuccess= mapper.addDetailsInfo(deviceChangeDetailsVo); + if(isSuccess>0){ + vo.setDevId(deviceChangeDetailsVo.getDevId()); + vo.setChangeStatus(vo.getStatus()); + vo.setUseUint(null); + vo.setUserName(null); + vo.setUserPhone(null); + vo.setProCode(null); + mapper.updateDevInfo(vo); + } + } + } + }catch (Exception e){ + log.error(e.getMessage()); + } + return AjaxResult.success(); + } + + /** + * 报废接口 + * @param vo + * @return + */ + @Override + public AjaxResult updateDevChangeInfo3(CsDeviceChangeVo vo) { + try{ + String username = SecurityUtils.getLoginUser().getUsername(); + vo.setCreateUser(username); + if (StringUtils.isBlank(vo.getType())) { + return AjaxResult.error("请上传类型type:1入库 2出库 3 退役 4 维修"); + } + String json=vo.getJsonData(); + if (StringUtils.isBlank(json)) { + return AjaxResult.error("请选择变更的设备"); + } + List list=JSON.parseArray(json, CsDeviceChangeDetailsVo.class); + if(list==null || list.isEmpty()){ + return AjaxResult.error("请选择变更的设备"); + } + //入库厂家 + String usUnit=mapper.getChangeUnit(list.get(0).getDevId()); + vo.setUseUint(usUnit); + vo.setChangeUnit(usUnit); + vo.setChangeStatus("1"); + vo.setDevNum(list.size()+""); + String proId=vo.getProCode(); + int num=mapper.addChangeInfo(vo); + if(num>0){ + for (CsDeviceChangeDetailsVo deviceChangeDetailsVo:list){ + updateDevDetails(deviceChangeDetailsVo.getDevId(),proId,"4",deviceChangeDetailsVo.getNum()); + //新增设备列表数据 + deviceChangeDetailsVo.setChangeId(vo.getId()); + deviceChangeDetailsVo.setReasonVal(vo.getReasonVal()); + deviceChangeDetailsVo.setReasonId(vo.getReasonId()); + //新增设备详情 + int isSuccess= mapper.addDetailsInfo(deviceChangeDetailsVo); + if(isSuccess>0){ + vo.setDevId(deviceChangeDetailsVo.getDevId()); + vo.setChangeStatus(vo.getStatus()); + vo.setUseUint(null); + vo.setUserName(null); + vo.setUserPhone(null); + vo.setProCode(null); + mapper.updateDevInfo(vo); + } + } + } + }catch (Exception e){ + log.error(e.getMessage()); + } + return AjaxResult.success(); + } + /** + * 维修接口 + * @param vo + * @return + */ + @Override + public AjaxResult updateDevChangeInfo2(CsDeviceChangeVo vo) { + try{ + String username = SecurityUtils.getLoginUser().getUsername(); + vo.setCreateUser(username); + if (StringUtils.isBlank(vo.getType())) { + return AjaxResult.error("请上传类型type:1入库 2出库 3 退役 4 维修"); + } + String json=vo.getJsonData(); + if (StringUtils.isBlank(json)) { + return AjaxResult.error("请选择变更的设备"); + } + List list=JSON.parseArray(json, CsDeviceChangeDetailsVo.class); + if(list==null || list.isEmpty()){ + return AjaxResult.error("请选择变更的设备"); + } + //入库厂家 + String usUnit=mapper.getChangeUnit(list.get(0).getDevId()); + vo.setUseUint(usUnit); + vo.setChangeUnit(usUnit); + vo.setChangeStatus("5"); + vo.setDevNum(list.size()+""); + String proId=vo.getProCode(); + int num=mapper.addChangeInfo(vo); + if(num>0){ + for (CsDeviceChangeDetailsVo deviceChangeDetailsVo:list){ + if("1".equals(vo.getStatus())){ + updateDevDetails2(deviceChangeDetailsVo.getDevId(),proId,"1",deviceChangeDetailsVo.getNum()); + }else{ + updateDevDetails2(deviceChangeDetailsVo.getDevId(),proId,"4",deviceChangeDetailsVo.getNum()); + } + //新增设备列表数据 + deviceChangeDetailsVo.setChangeId(vo.getId()); + //新增设备详情 + int isSuccess= mapper.addDetailsInfo(deviceChangeDetailsVo); + if(isSuccess>0){ + vo.setDevId(deviceChangeDetailsVo.getDevId()); + vo.setChangeStatus(vo.getStatus()); + vo.setUseUint(null); + vo.setUserName(null); + vo.setUserPhone(null); + vo.setProCode(null); + mapper.updateDevInfo(vo); + } + } + } + }catch (Exception e){ + log.error(e.getMessage()); + } + return AjaxResult.success(); + } + /** * 新增设备台账数据 * @param vo @@ -114,6 +296,8 @@ public class DevChangeServiceImpl implements DevChangeService { for (CsDeviceChangeDetailsVo deviceChangeDetailsVo:list){ //新增设备列表数据 deviceChangeDetailsVo.setChangeId(vo.getId()); + //数据更新 + updateDevDetails(deviceChangeDetailsVo.getDevId(),vo.getProCode(),vo.getType(),deviceChangeDetailsVo.getNum()); //新增设备详情 int isSuccess= mapper.addDetailsInfo(deviceChangeDetailsVo); if(isSuccess>0){ @@ -138,6 +322,85 @@ public class DevChangeServiceImpl implements DevChangeService { } return AjaxResult.success(); } + public void updateDevDetails2(String devId,String proCode,String type,int num){ + try{ + DevChangeDetailsVo vo=new DevChangeDetailsVo(devId,proCode,type,num); + List list=mapper.getDevChangeDetailsList(vo); + DevChangeDetailsVo devChangeDetailsVo=new DevChangeDetailsVo(devId,proCode,"5",num); + List newList=mapper.getDevChangeDetailsList(devChangeDetailsVo); + for (DevChangeDetailsVo voo:newList){ + if(voo.getNum()==num){ + mapper.deleteDevChangeDetails(voo); + }else if(voo.getNum()>num){ + int newNum=voo.getNum()-num; + vo.setNum(newNum); + mapper.updateChangeDetailsNum(vo); + } + } + //入库--报废 + if("4".equals(type) ){ + if(list==null || list.isEmpty()){ + mapper.addDevChangeDetails(vo); + }else{ + for (DevChangeDetailsVo voo:list){ + int newNum=voo.getNum()+num; + vo.setNum(newNum); + mapper.updateChangeDetailsNum(vo); + } + } + } + }catch (Exception e){ + log.error(e.getMessage()); + } + } + /** + * 修改设备 状态 + */ + public void updateDevDetails(String devId,String proCode,String type,int num){ + try{ + DevChangeDetailsVo vo=new DevChangeDetailsVo(devId,proCode,type,num); + List list=mapper.getDevChangeDetailsList(vo); + if( "1".equals(type) || "5".equals(type)){ + DevChangeDetailsVo devChangeDetailsVo=new DevChangeDetailsVo(devId,proCode,"2",num); + List newList=mapper.getDevChangeDetailsList(devChangeDetailsVo); + for (DevChangeDetailsVo voo:newList){ + if(voo.getNum()==num){ + mapper.deleteDevChangeDetails(voo); + }else if(voo.getNum()>num){ + int newNum=voo.getNum()-num; + vo.setNum(newNum); + mapper.updateChangeDetailsNum(vo); + } + } + } + //入库 + if("1".equals(type)){ + //查询 历史数据 进行删除 + for (DevChangeDetailsVo voo:list){ + if(voo.getNum()==num){ + mapper.deleteDevChangeDetails(voo); + }else if(voo.getNum()>num){ + int newNum=voo.getNum()-num; + vo.setNum(newNum); + mapper.updateChangeDetailsNum(vo); + } + } + } else if("2".equals(type) || "3".equals(type) || "4".equals(type) || "5".equals(type)){ + if(list==null || list.isEmpty()){ + mapper.addDevChangeDetails(vo); + }else{ + for (DevChangeDetailsVo voo:list){ + int newNum=voo.getNum()+num; + vo.setNum(newNum); + mapper.updateChangeDetailsNum(vo); + } + } + } + }catch (Exception e){ + log.error(e.getMessage()); + } + + } /** * 查询工程下拉选 @@ -175,14 +438,14 @@ public class DevChangeServiceImpl implements DevChangeService { * @return */ @Override - public AjaxResult getDevDetails(CsDeviceChangeDetailsVo vo) { + public List getDevDetails(CsDeviceChangeDetailsVo vo) { try{ - List list=mapper.getDevDetails(vo); - return AjaxResult.success(list); + List list=mapper.getDevDetails(vo); + return list; }catch (Exception e){ log.error(e.getMessage()); } - return AjaxResult.success(new ArrayList<>()); + return new ArrayList<>(); } @Override 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 5849971..7b8ab5e 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 @@ -19,7 +19,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" )values ( #{changeId},#{devId},#{useTime},#{reasonId},#{reasonVal},#{remark},#{repairman},#{repairTime},#{repairContent},0 ) + + + insert into cs_device_detials( + pro_id,dev_id, num, type, create_time, update_time) + values (#{proId},#{devId},#{num},#{type},now(),now()) update ma_dev_info set json_data=#{jsonData} where ma_id=#{devId} @@ -29,6 +34,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" change_status=#{changeStatus} where ma_id=#{devId} + + delete from cs_device_detials where id=#{id} + + + + update cs_device_detials set num=#{num} where id=#{id} + @@ -121,8 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from ma_dev_info where ma_id=#{devId} - + select dev.ma_id devId,dev.device_name devName,dev.code devCode,dev.json_data,DATE(dev.production_date ) productDate ,dev.buy_price buyPrice ,dev.brand , mdq.next_check_time nextDate,mt.typeId, mt.unit_name unit,mt.maintenance_alarm_day , mt.lease_price,mt.proType,mt.level,mt.mainGx,mt.childGx,mt.devCategory ,mt.devSubcategory ,mt.devName, mt.devModel ,bci.company_name compName,bci.operate_address orgName,IFNULL(pro.pro_name,'-') proName, @@ -131,7 +162,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_dev_info dev on dcd.dev_id=dev.ma_id left join bm_company_info bci on bci.company_id=dev.own_co left join ma_type_view mt on mt.typeId=dev.type_id - LEFT JOIN ma_dev_qc mdq on dev.ma_id=mdq.ma_id + LEFT JOIN + (SELECT max( next_check_time) next_check_time,ma_id + from ma_dev_qc + GROUP BY ma_id + ) mdq on dev.ma_id=mdq.ma_id left join jj_sing_project pro on pro.pro_code=dev.on_project where is_active=1 and dcd.change_id=#{id} @@ -139,5 +174,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select distinct voltage from jj_sing_project + + \ No newline at end of file