From f69b85697c6e835580e6b8f33c2e33140a64b07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B3=BD=E8=85=BE?= <1178634255@qq.com> Date: Fri, 4 Aug 2023 18:06:00 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E7=89=A9=E8=B5=84=E8=B5=84=E8=B4=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E--=E6=96=B0=E5=A2=9E=E9=85=8D=E9=80=81?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E8=B5=84=E8=B4=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/common/enums/ResultEnum.java | 1 + .../purchase/SupProductController.java | 64 ++++++++++--------- .../glxp/api/dao/purchase/SupProductDao.java | 2 +- .../service/purchase/SupProductService.java | 4 +- .../purchase/impl/SupProductServiceImpl.java | 4 ++ .../mybatis/mapper/purchase/SupProductDao.xml | 14 ++++ 6 files changed, 58 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/glxp/api/common/enums/ResultEnum.java b/src/main/java/com/glxp/api/common/enums/ResultEnum.java index f19fc0ed6..42ebe9512 100644 --- a/src/main/java/com/glxp/api/common/enums/ResultEnum.java +++ b/src/main/java/com/glxp/api/common/enums/ResultEnum.java @@ -17,6 +17,7 @@ public enum ResultEnum { DATA_CHANGE(6, "数据没有任何更改"), DATA_REPEAT(7, "数据已存在"), DATA_ERROR(8, "参数错误"), + ; private Integer code; diff --git a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java index acd248ad6..9f52f29b3 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java @@ -86,11 +86,10 @@ public class SupProductController { @PostMapping("/sup/product/addRegistration") @Log(title = "资质证书", businessType = BusinessType.INSERT) public BaseResponse addRegistration(@RequestBody SupProductEntity supProductEntity) { - + System.out.println(supProductEntity.toString()); //提交审核 if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) { //判断是否上级供应商是否审核通过 - SupManufacturerEntity supManufacturerEntity = supManufacturerService.findManufacturer(supProductEntity.getManufacturerIdFk()); if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_DRAFT) { @@ -135,15 +134,22 @@ public class SupProductController { return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!"); } } - supProductEntity.setCreateTime(new Date()); - supProductEntity.setUpdateTime(new Date()); - supProductEntity.setId(IdUtil.getSnowflakeNextId()); - boolean b = supProductService.insertRegistration(supProductEntity); - if (b) { - return ResultVOUtils.success("添加成功"); + int i = supProductService.findProduct(supProductEntity); + System.out.println(i); + if (i == 0) { + supProductEntity.setCreateTime(new Date()); + supProductEntity.setUpdateTime(new Date()); + supProductEntity.setId(IdUtil.getSnowflakeNextId()); + boolean b = supProductService.insertRegistration(supProductEntity); + if (b) { + return ResultVOUtils.success("添加成功"); + } else { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + } } else { - return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + return ResultVOUtils.error(ResultEnum.DATA_REPEAT); } + } @@ -153,27 +159,27 @@ public class SupProductController { UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectUdiId(Long.valueOf(selectProductBindRequest.getRelIdFk())); SupProductEntity supProductEntity = supProductService.findByManufactury(udiRelevanceResponse.getCpmctymc(), udiRelevanceResponse.getManufactory(), selectProductBindRequest.getManufacturerId()); - if (supProductEntity != null) { - return ResultVOUtils.error(500, "该产品资质已存在,请勿重复添加!"); - } else { - supProductEntity = new SupProductEntity(); - BeanUtils.copyProperties(udiRelevanceResponse, supProductEntity); - supProductEntity.setProductId(selectProductBindRequest.getProductId()); - supProductEntity.setRecordCode(udiRelevanceResponse.getZczbhhzbapzbh()); - supProductEntity.setRelIdFk(udiRelevanceResponse.getId() + ""); - supProductEntity.setRecordProductName(udiRelevanceResponse.getCpmctymc()); - supProductEntity.setProductType(udiRelevanceResponse.getQxlb()); - supProductEntity.setProductDirectoryCode(udiRelevanceResponse.getFlbm()); - supProductEntity.setRecordPeopleName(udiRelevanceResponse.getYlqxzcrbarmc()); - supProductEntity.setSpecification(udiRelevanceResponse.getGgxh()); - supProductEntity.setCreateTime(new Date()); - supProductEntity.setUpdateTime(new Date()); - supProductEntity.setManufacturerIdFk(selectProductBindRequest.getManufacturerId()); - supProductEntity.setCustomerId(selectProductBindRequest.getCustomerId()); - supProductEntity.setHchzsb(udiRelevanceResponse.getCplb()); +// if (supProductEntity != null) { +//// return ResultVOUtils.error(500, "该产品资质已存在,请勿重复添加!"); +// } else { + supProductEntity = new SupProductEntity(); + BeanUtils.copyProperties(udiRelevanceResponse, supProductEntity); + supProductEntity.setProductId(selectProductBindRequest.getProductId()); + supProductEntity.setRecordCode(udiRelevanceResponse.getZczbhhzbapzbh()); + supProductEntity.setRelIdFk(udiRelevanceResponse.getId() + ""); + supProductEntity.setRecordProductName(udiRelevanceResponse.getCpmctymc()); + supProductEntity.setProductType(udiRelevanceResponse.getQxlb()); + supProductEntity.setProductDirectoryCode(udiRelevanceResponse.getFlbm()); + supProductEntity.setRecordPeopleName(udiRelevanceResponse.getYlqxzcrbarmc()); + supProductEntity.setSpecification(udiRelevanceResponse.getGgxh()); + supProductEntity.setCreateTime(new Date()); + supProductEntity.setUpdateTime(new Date()); + supProductEntity.setManufacturerIdFk(selectProductBindRequest.getManufacturerId()); + supProductEntity.setCustomerId(selectProductBindRequest.getCustomerId()); + supProductEntity.setHchzsb(udiRelevanceResponse.getCplb()); // supProductEntity.setCompanyName(selectProductBindRequest.getCompanyName()); - supProductEntity.setAuditStatus(selectProductBindRequest.getAuditStatus()); - } + supProductEntity.setAuditStatus(selectProductBindRequest.getAuditStatus()); +// } return ResultVOUtils.success(supProductEntity); diff --git a/src/main/java/com/glxp/api/dao/purchase/SupProductDao.java b/src/main/java/com/glxp/api/dao/purchase/SupProductDao.java index 14483eb33..052bf63b4 100644 --- a/src/main/java/com/glxp/api/dao/purchase/SupProductDao.java +++ b/src/main/java/com/glxp/api/dao/purchase/SupProductDao.java @@ -26,7 +26,7 @@ public interface SupProductDao extends BaseMapperPlus { SupProductEntity findByRelIdFk(String relIdFk); - SupProductEntity findByManufactury(String cpmctymc, String manufactory,String manufacturerIdFk); + SupProductEntity findByManufactury(String cpmctymc, String manufactory, String manufacturerIdFk); SupProductResponse findByPassByReCert(String registerCert); @@ -34,6 +34,8 @@ public interface SupProductService extends IService { boolean insertRegistration(SupProductEntity supProductEntity); + int findProduct(SupProductEntity supProductEntity); + boolean deleteById(@Param("id") String id); boolean deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId); diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java index c1fac32a5..414bfd757 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupProductServiceImpl.java @@ -143,6 +143,10 @@ public class SupProductServiceImpl extends ServiceImpl 0 ? true : false; } + @Override + public int findProduct(SupProductEntity supProductEntity) { + return supProductDao.findProduct(supProductEntity); + } @Override public boolean deleteById(String id) { return supProductDao.deleteById(id); diff --git a/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml b/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml index 8fe545e1c..c3cbd0e0b 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupProductDao.xml @@ -389,4 +389,18 @@ FROM sup_product WHERE enterpriseId = #{enterpriseId} + + + From b27758f8db8f51d4d5d92967922206034ec20d61 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Fri, 4 Aug 2023 18:59:45 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=8A=A5=E4=BF=AE=E5=8D=95=20=20?= =?UTF-8?q?=E7=BB=B4=E4=BF=9D=E8=AE=BE=E5=A4=87=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/common/req/UpdateRequest.java | 15 +++ .../inv/DeviceProjectSetController.java | 99 +++++++++++++++++++ .../inv/DeviceRepairOrderController.java | 37 ++++++- .../api/dao/inv/DeviceProjectSetMapper.java | 9 +- .../glxp/api/entity/inv/DeviceProjectSet.java | 5 +- .../entity/inv/DeviceRepairOrderEntity.java | 8 +- .../req/inv/AddDeviceRepairOrderRequest.java | 45 ++++++++- .../api/req/inv/DeviceProjectSetRequest.java | 55 +++++++++++ .../inv/FilterDeviceRepairOrderRequest.java | 11 ++- .../api/res/inv/DeviceProjectSetResponse.java | 60 +++++++++++ .../res/inv/DeviceRepairOrderResponse.java | 47 ++++++++- .../service/inv/DeviceProjectSetService.java | 71 ++++++++++++- .../service/inv/DeviceRepairOrderService.java | 7 +- .../impl/DeviceRepairOrderServiceImpl.java | 55 +++++++++-- .../mapper/inv/DeviceProjectSetMapper.xml | 28 +++++- .../mapper/inv/DeviceRepairOrderDao.xml | 21 +++- src/main/resources/schemas/schema_v2.2.sql | 12 +-- 17 files changed, 554 insertions(+), 31 deletions(-) create mode 100644 src/main/java/com/glxp/api/controller/inv/DeviceProjectSetController.java create mode 100644 src/main/java/com/glxp/api/req/inv/DeviceProjectSetRequest.java create mode 100644 src/main/java/com/glxp/api/res/inv/DeviceProjectSetResponse.java diff --git a/src/main/java/com/glxp/api/common/req/UpdateRequest.java b/src/main/java/com/glxp/api/common/req/UpdateRequest.java index 570b0b295..f6ac58e2b 100644 --- a/src/main/java/com/glxp/api/common/req/UpdateRequest.java +++ b/src/main/java/com/glxp/api/common/req/UpdateRequest.java @@ -28,4 +28,19 @@ public class UpdateRequest { */ private String auditOpinion; + /** + * 维修人 + */ + private String repariName; + + /** + * 维修照片 + */ + private String repariImage; + + /** + * 维修说明 + */ + private String repariRemark; + } diff --git a/src/main/java/com/glxp/api/controller/inv/DeviceProjectSetController.java b/src/main/java/com/glxp/api/controller/inv/DeviceProjectSetController.java new file mode 100644 index 000000000..a8c57ab71 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/inv/DeviceProjectSetController.java @@ -0,0 +1,99 @@ +package com.glxp.api.controller.inv; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.common.enums.ResultEnum; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.req.inv.DeviceProjectSetRequest; +import com.glxp.api.res.inv.DeviceProjectSetResponse; +import com.glxp.api.service.inv.DeviceProjectSetService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 维保设备接口 + */ +@Slf4j +@RestController +public class DeviceProjectSetController { + + @Resource + private DeviceProjectSetService deviceProjectSetService; + + /** + * 查询维保设备列表 + * + * @param deviceProjectSetRequest + * @return + */ + @GetMapping("/udiwms/inv/device/project/set/filter") + public BaseResponse filterList(DeviceProjectSetRequest deviceProjectSetRequest) { + + List list = deviceProjectSetService.filterList(deviceProjectSetRequest); + PageInfo pageInfo = new PageInfo<>(list); + return ResultVOUtils.page(pageInfo); + } + + /** + * 添加维保设备维护 + * + * @param deviceProjectSetRequest + * @return + */ + @PostMapping("/udiwms/inv/device/project/set/insertDevprojectSet") + public BaseResponse insertDevprojectSet(@RequestBody DeviceProjectSetRequest deviceProjectSetRequest, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + //判断编码是否存在 + boolean b = deviceProjectSetService.chcekCode(deviceProjectSetRequest.getCode(), null); + if(b){ + return ResultVOUtils.error(999,"编码已存在!"); + } + deviceProjectSetService.insertDevprojectSet(deviceProjectSetRequest); + return ResultVOUtils.success("添加成功"); + } + + /** + * 更新维保设备维护信息 + * + * @param deviceProjectSetRequest + * @return + */ + @PostMapping("/udiwms/inv/device/project/set/updateDevprojectSet") + public BaseResponse updateDevprojectSet(@RequestBody DeviceProjectSetRequest deviceProjectSetRequest, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + //判断编号是否存在 + boolean b = deviceProjectSetService.chcekCode(deviceProjectSetRequest.getCode(), deviceProjectSetRequest.getId() + ""); + if(b){ + return ResultVOUtils.error(999,"编码已存在!"); + } + + deviceProjectSetService.updateDevprojectSet(deviceProjectSetRequest); + return ResultVOUtils.success("更新成功"); + } + + + /** + * 删除维保设备维护 + * + * @param id + * @return + */ + @GetMapping("/udiwms/inv/device/project/set/deleteDevprojectSet") + public BaseResponse deleteDevprojectSet(String id) { + deviceProjectSetService.deleteDevprojectSet(id); + + return ResultVOUtils.success("删除成功"); + } + +} diff --git a/src/main/java/com/glxp/api/controller/inv/DeviceRepairOrderController.java b/src/main/java/com/glxp/api/controller/inv/DeviceRepairOrderController.java index 6321e960f..f8e1d8503 100644 --- a/src/main/java/com/glxp/api/controller/inv/DeviceRepairOrderController.java +++ b/src/main/java/com/glxp/api/controller/inv/DeviceRepairOrderController.java @@ -96,9 +96,44 @@ public class DeviceRepairOrderController { if (null == updateRequest) { return ResultVOUtils.paramVerifyFail(); } - return deviceRepairOrderService.updateStatus(updateRequest.getOrderId(), updateRequest.getStatus()); + if(!"".equals(updateRequest.getRepariName()) && null !=updateRequest.getRepariName() ){ + return deviceRepairOrderService.updateStatus(updateRequest.getOrderId(), updateRequest.getStatus(),updateRequest.getRepariName()); + }else + return deviceRepairOrderService.updateStatus(updateRequest.getOrderId(), updateRequest.getStatus(),null); } + /** + * 开始任务 + * 更新报修单状态和维修时间 + * + * @param updateRequest + * @return + */ + @PostMapping("/udiwms/inv/device/repair/order/updateStatusAndTime") + public BaseResponse updateStatusAndTime(@RequestBody UpdateRequest updateRequest) { + if (null == updateRequest) { + return ResultVOUtils.paramVerifyFail(); + } + return deviceRepairOrderService.updateStatusAndTime(updateRequest.getOrderId(), updateRequest.getStatus()); + } + + /** + * 结束任务 + * 更新报修单状态 维修时间 维修照片 + * + * @param updateRequest + * @return + */ + @PostMapping("/udiwms/inv/device/repair/order/updateStatusAndImg") + public BaseResponse updateStatusAndImg(@RequestBody UpdateRequest updateRequest) { + if (null == updateRequest) { + return ResultVOUtils.paramVerifyFail(); + } + return deviceRepairOrderService.updateStatusAndImg(updateRequest.getOrderId(), updateRequest.getStatus(), + updateRequest.getRepariImage(),updateRequest.getRepariRemark()); + } + + /** * 删除报修单 * diff --git a/src/main/java/com/glxp/api/dao/inv/DeviceProjectSetMapper.java b/src/main/java/com/glxp/api/dao/inv/DeviceProjectSetMapper.java index 126bb0179..47758a366 100644 --- a/src/main/java/com/glxp/api/dao/inv/DeviceProjectSetMapper.java +++ b/src/main/java/com/glxp/api/dao/inv/DeviceProjectSetMapper.java @@ -2,8 +2,15 @@ package com.glxp.api.dao.inv; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.glxp.api.entity.inv.DeviceProjectSet; +import com.glxp.api.req.inv.DeviceProjectSetRequest; +import com.glxp.api.res.inv.DeviceProjectSetResponse; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + @Mapper public interface DeviceProjectSetMapper extends BaseMapper { -} \ No newline at end of file + + List filterList(DeviceProjectSetRequest deviceProjectSetRequest); + +} diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceProjectSet.java b/src/main/java/com/glxp/api/entity/inv/DeviceProjectSet.java index 0f2a0c10f..3de1658aa 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceProjectSet.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceProjectSet.java @@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; @Data @TableName(value = "device_project_set") @@ -63,4 +64,4 @@ public class DeviceProjectSet implements Serializable { private Date createTime; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceRepairOrderEntity.java b/src/main/java/com/glxp/api/entity/inv/DeviceRepairOrderEntity.java index 091ae25c4..3b3d75fa1 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceRepairOrderEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceRepairOrderEntity.java @@ -43,7 +43,7 @@ public class DeviceRepairOrderEntity { private String code; /** - * 状态(0:新增;1:未审核;2:已审核;3。已处理) + * 状态(0:草稿;1:未审核;2:已审核;3:未处理 4:维修中 5:已处理) */ @TableField(value = "`status`") private Integer status; @@ -95,7 +95,7 @@ public class DeviceRepairOrderEntity { /** * 维修类型 1:自行维修;2:外部维修 */ - private String repairType; + private Integer repairType; /** * 紧急类型 1,正常;2,较急;3,特急 */ @@ -117,11 +117,11 @@ public class DeviceRepairOrderEntity { /** * 维修开始时间 */ - private String repariStartTime; + private Date repariStartTime; /** * 维修结束时间 */ - private String repariEndTime; + private Date repariEndTime; /** * 维修说明 */ diff --git a/src/main/java/com/glxp/api/req/inv/AddDeviceRepairOrderRequest.java b/src/main/java/com/glxp/api/req/inv/AddDeviceRepairOrderRequest.java index a1e10629b..45b817b62 100644 --- a/src/main/java/com/glxp/api/req/inv/AddDeviceRepairOrderRequest.java +++ b/src/main/java/com/glxp/api/req/inv/AddDeviceRepairOrderRequest.java @@ -2,6 +2,8 @@ package com.glxp.api.req.inv; import lombok.Data; +import java.util.Date; + /** * 添加设备报修单参数 */ @@ -24,7 +26,7 @@ public class AddDeviceRepairOrderRequest { private String code; /** - * 状态(1:新增;2:未审核;3:已审核) + * 状态(0:草稿;1:未审核;2:已审核;3:未处理 4:维修中 5:已处理) */ private Integer status; @@ -38,4 +40,45 @@ public class AddDeviceRepairOrderRequest { */ private String remark; + + // ----------------------新增字段=------------------------------- + /** + * 维修类型 1:自行维修;2:外部维修 + */ + private Integer repairType; + /** + * 紧急类型 1,正常;2,较急;3,特急 + */ + private Integer urgencyType; + /** + * 计划完成日期 + */ + private Date planTime; + /** + * 报修图片 + */ + private String uploadImage; + + + /** + * 维修人 + */ + private String repariName; + /** + * 维修开始时间 + */ + private String repariStartTime; + /** + * 维修结束时间 + */ + private String repariEndTime; + /** + * 维修说明 + */ + private String repariRemark; + /** + * 维修图片 + */ + private String repariImage; + } diff --git a/src/main/java/com/glxp/api/req/inv/DeviceProjectSetRequest.java b/src/main/java/com/glxp/api/req/inv/DeviceProjectSetRequest.java new file mode 100644 index 000000000..35370cf35 --- /dev/null +++ b/src/main/java/com/glxp/api/req/inv/DeviceProjectSetRequest.java @@ -0,0 +1,55 @@ +package com.glxp.api.req.inv; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import java.util.Date; + +@Data +public class DeviceProjectSetRequest extends ListPageRequest { + private Integer id; + + /** + * 项目编号 + */ + private String code; + + /** + * 项目内容 + */ + private String content; + + /** + * 项目类型:1:巡检;2:养护 + */ + private Integer type; + + /** + * 备注 + */ + private String remak; + + /** + * 更新时间 + */ + private Date udpateTime; + + /** + * 更新人 + */ + private String updateUser; + + /** + * 创建人 + */ + private String createUser; + + /** + * 创建时间 + */ + private Date createTime; + + private String startTime; + private String endTime; + +} diff --git a/src/main/java/com/glxp/api/req/inv/FilterDeviceRepairOrderRequest.java b/src/main/java/com/glxp/api/req/inv/FilterDeviceRepairOrderRequest.java index 2c26ce6c2..c01a8cc8a 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterDeviceRepairOrderRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterDeviceRepairOrderRequest.java @@ -3,6 +3,8 @@ package com.glxp.api.req.inv; import com.glxp.api.util.page.ListPageRequest; import lombok.Data; +import java.util.List; + /** * 查询部门设备报修单接口参数 */ @@ -32,8 +34,15 @@ public class FilterDeviceRepairOrderRequest extends ListPageRequest { private String code; /** - * 状态(1:新增;2:未审核;3:已审核) + * 状态(0:草稿;1:未审核;2:已审核;3:未处理 4:维修中 5:已处理) */ private Integer status; + private List statusList; + + /** + * 维修人 + */ + private String repariName; + } diff --git a/src/main/java/com/glxp/api/res/inv/DeviceProjectSetResponse.java b/src/main/java/com/glxp/api/res/inv/DeviceProjectSetResponse.java new file mode 100644 index 000000000..43862670b --- /dev/null +++ b/src/main/java/com/glxp/api/res/inv/DeviceProjectSetResponse.java @@ -0,0 +1,60 @@ +package com.glxp.api.res.inv; + +import lombok.Data; + +import java.util.Date; + +@Data +public class DeviceProjectSetResponse { + private Integer id; + + /** + * 项目编号 + */ + private String code; + + /** + * 项目内容 + */ + private String content; + + /** + * 项目类型:1:巡检;2:养护 + */ + private Integer type; + + /** + * 备注 + */ + private String remak; + + /** + * 更新时间 + */ + private Date udpateTime; + + /** + * 更新人 + */ + private String updateUser; + + /** + * 更新人名称 + */ + private String updateUserName; + + /** + * 创建人 + */ + private String createUser; + /** + * 创建人名称 + */ + private String createUserName; + + /** + * 创建时间 + */ + private Date createTime; + +} diff --git a/src/main/java/com/glxp/api/res/inv/DeviceRepairOrderResponse.java b/src/main/java/com/glxp/api/res/inv/DeviceRepairOrderResponse.java index 264e2049b..4ac6041df 100644 --- a/src/main/java/com/glxp/api/res/inv/DeviceRepairOrderResponse.java +++ b/src/main/java/com/glxp/api/res/inv/DeviceRepairOrderResponse.java @@ -33,7 +33,7 @@ public class DeviceRepairOrderResponse { private String code; /** - * 状态(0:新增;1:未审核;2:已审核) + * 状态(0:草稿;1:未审核;2:已审核;3:未处理 4:维修中 5:已处理) */ private Integer status; @@ -102,4 +102,49 @@ public class DeviceRepairOrderResponse { */ private String batchNo; + // ----------------------新增字段=------------------------------- + /** + * 维修类型 1:自行维修;2:外部维修 + */ + private Integer repairType; + /** + * 紧急类型 1,正常;2,较急;3,特急 + */ + private Integer urgencyType; + /** + * 计划完成日期 + */ + private Date planTime; + /** + * 报修图片 + */ + private String uploadImage; + + + /** + * 维修人 + */ + private String repariName; + + /** + * 维修人名称 + */ + private String repName; + /** + * 维修开始时间 + */ + private String repariStartTime; + /** + * 维修结束时间 + */ + private String repariEndTime; + /** + * 维修说明 + */ + private String repariRemark; + /** + * 维修图片 + */ + private String repariImage; + } diff --git a/src/main/java/com/glxp/api/service/inv/DeviceProjectSetService.java b/src/main/java/com/glxp/api/service/inv/DeviceProjectSetService.java index 1eac4ddd0..ef5303192 100644 --- a/src/main/java/com/glxp/api/service/inv/DeviceProjectSetService.java +++ b/src/main/java/com/glxp/api/service/inv/DeviceProjectSetService.java @@ -1,12 +1,77 @@ package com.glxp.api.service.inv; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.inv.DeviceProjectSetMapper; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.inv.DeviceProjectSet; +import com.glxp.api.req.inv.DeviceProjectSetRequest; +import com.glxp.api.res.inv.DeviceProjectSetResponse; +import com.glxp.api.service.auth.CustomerService; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; + import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; import java.util.List; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.glxp.api.entity.inv.DeviceProjectSet; -import com.glxp.api.dao.inv.DeviceProjectSetMapper; + @Service public class DeviceProjectSetService extends ServiceImpl { + @Resource + DeviceProjectSetMapper deviceProjectSetMapper; + @Resource + CustomerService customerService; + + public List filterList(DeviceProjectSetRequest deviceProjectSetRequest) { + + if (null == deviceProjectSetRequest) { + return Collections.emptyList(); + } + if (null != deviceProjectSetRequest.getPage() && null != deviceProjectSetRequest.getLimit()) { + PageHelper.offsetPage((deviceProjectSetRequest.getPage() - 1) * deviceProjectSetRequest.getLimit(), deviceProjectSetRequest.getLimit()); + } + return deviceProjectSetMapper.filterList(deviceProjectSetRequest); + + } + + public boolean insertDevprojectSet(DeviceProjectSetRequest deviceProjectSetRequest) { + AuthAdmin user = customerService.getUserBean(); + DeviceProjectSet projectSet = new DeviceProjectSet(); + BeanUtils.copyProperties(deviceProjectSetRequest, projectSet); + projectSet.setCreateTime(new Date()); + projectSet.setCreateUser(user.getId()+""); + return deviceProjectSetMapper.insert(projectSet) > 0; + } + + public boolean deleteDevprojectSet(String id) { + + return deviceProjectSetMapper.deleteById(id) > 0; + } + + public boolean updateDevprojectSet(DeviceProjectSetRequest deviceProjectSetRequest) { + AuthAdmin user = customerService.getUserBean(); + DeviceProjectSet projectSet = new DeviceProjectSet(); + BeanUtils.copyProperties(deviceProjectSetRequest, projectSet); + projectSet.setUdpateTime(new Date()); + projectSet.setUpdateUser(user.getId()+""); + return deviceProjectSetMapper.updateById(projectSet) > 0; + } + + public boolean chcekCode(String code, String id) { + List list = null; + if (id != null && !"".equals(id)) { + list = deviceProjectSetMapper.selectList(new QueryWrapper().eq("code", code).ne("id", id)); + } else + list = deviceProjectSetMapper.selectList(new QueryWrapper().eq("code", code)); + if (list != null && list.size() > 0) { + return true; + } else + return false; + + } + + } diff --git a/src/main/java/com/glxp/api/service/inv/DeviceRepairOrderService.java b/src/main/java/com/glxp/api/service/inv/DeviceRepairOrderService.java index 73f2fc8ec..56dcc90ef 100644 --- a/src/main/java/com/glxp/api/service/inv/DeviceRepairOrderService.java +++ b/src/main/java/com/glxp/api/service/inv/DeviceRepairOrderService.java @@ -52,7 +52,12 @@ public interface DeviceRepairOrderService { * @param status * @return */ - BaseResponse updateStatus(String orderId, Integer status); + BaseResponse updateStatus(String orderId, Integer status,String repariName); + + BaseResponse updateStatusAndTime(String orderId, Integer status); + + BaseResponse updateStatusAndImg(String orderId, Integer status,String repariImage,String repariRemark); + /** * 删除设备报修单 diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeviceRepairOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeviceRepairOrderServiceImpl.java index 0fe6fde00..84c4b3b51 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/DeviceRepairOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/DeviceRepairOrderServiceImpl.java @@ -7,6 +7,7 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.Constant; import com.glxp.api.dao.inv.DeviceRepairOrderDao; +import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.inv.DeviceRepairOrderEntity; import com.glxp.api.req.inv.AddDeviceRepairOrderRequest; import com.glxp.api.req.inv.FilterDeviceRepairOrderRequest; @@ -18,7 +19,6 @@ import com.glxp.api.util.GennerOrderUtils; import com.glxp.api.util.OrderNoTypeBean; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; @@ -62,6 +62,10 @@ public class DeviceRepairOrderServiceImpl implements DeviceRepairOrderService { deviceRepairOrderEntity.setStatus(0); deviceRepairOrderEntity.setCreateTime(date); deviceRepairOrderEntity.setUpdateTime(date); + deviceRepairOrderEntity.setRepairType(addDeviceRepairOrderRequest.getRepairType()); + deviceRepairOrderEntity.setUrgencyType(addDeviceRepairOrderRequest.getUrgencyType()); + deviceRepairOrderEntity.setPlanTime(addDeviceRepairOrderRequest.getPlanTime()); + deviceRepairOrderEntity.setUploadImage(addDeviceRepairOrderRequest.getUploadImage()); deviceRepairOrderDao.insert(deviceRepairOrderEntity); return ResultVOUtils.success(); } @@ -88,20 +92,55 @@ public class DeviceRepairOrderServiceImpl implements DeviceRepairOrderService { } @Override - public BaseResponse updateStatus(String orderId, Integer status) { + public BaseResponse updateStatus(String orderId, Integer status,String repariName) { if (StrUtil.isBlank(orderId) || null == status) { return ResultVOUtils.paramVerifyFail(); } + AuthAdmin authAdmin=customerService.getUserBean(); DeviceRepairOrderEntity deviceRepairOrderEntity = deviceRepairOrderDao.selectByOrderId(orderId); deviceRepairOrderEntity.setStatus(status); Date date = new Date(); - if (status == 2) { - //审核通过,生成维保单 - deviceInspectOrderService.addByRepairOrderId(orderId); - deviceRepairOrderEntity.setAuditUser(customerService.getUserIdStr()); - deviceRepairOrderEntity.setAuditTime(date); - } +// if (status == 2) { +// //审核通过,生成维保单 +// deviceInspectOrderService.addByRepairOrderId(orderId); +// deviceRepairOrderEntity.setAuditUser(customerService.getUserIdStr()); +// deviceRepairOrderEntity.setAuditTime(date); +// } deviceRepairOrderEntity.setUpdateTime(date); + deviceRepairOrderEntity.setAuditTime(date); + deviceRepairOrderEntity.setAuditUser(authAdmin.getId()+""); + if(null != repariName){ + deviceRepairOrderEntity.setRepariName(repariName); + } + deviceRepairOrderDao.updateById(deviceRepairOrderEntity); + return ResultVOUtils.success(); + } + + @Override + public BaseResponse updateStatusAndTime(String orderId, Integer status) { + if (StrUtil.isBlank(orderId) || null == status) { + return ResultVOUtils.paramVerifyFail(); + } + DeviceRepairOrderEntity deviceRepairOrderEntity = deviceRepairOrderDao.selectByOrderId(orderId); + deviceRepairOrderEntity.setStatus(status); + //插入开始时间 + deviceRepairOrderEntity.setRepariStartTime(new Date()); + + deviceRepairOrderDao.updateById(deviceRepairOrderEntity); + return ResultVOUtils.success(); + } + + @Override + public BaseResponse updateStatusAndImg(String orderId, Integer status, String repariImage, String repariRemark) { + if (StrUtil.isBlank(orderId) || null == status) { + return ResultVOUtils.paramVerifyFail(); + } + DeviceRepairOrderEntity deviceRepairOrderEntity = deviceRepairOrderDao.selectByOrderId(orderId); + deviceRepairOrderEntity.setStatus(status); + //插入结束时间 + deviceRepairOrderEntity.setRepariEndTime(new Date()); + deviceRepairOrderEntity.setRepariImage(repariImage); + deviceRepairOrderEntity.setRepariRemark(repariRemark); deviceRepairOrderDao.updateById(deviceRepairOrderEntity); return ResultVOUtils.success(); } diff --git a/src/main/resources/mybatis/mapper/inv/DeviceProjectSetMapper.xml b/src/main/resources/mybatis/mapper/inv/DeviceProjectSetMapper.xml index bf97420b9..21edfe657 100644 --- a/src/main/resources/mybatis/mapper/inv/DeviceProjectSetMapper.xml +++ b/src/main/resources/mybatis/mapper/inv/DeviceProjectSetMapper.xml @@ -18,4 +18,30 @@ id, code, content, `type`, remak, udpateTime, updateUser, `createUser`, createTime - \ No newline at end of file + + + + + diff --git a/src/main/resources/mybatis/mapper/inv/DeviceRepairOrderDao.xml b/src/main/resources/mybatis/mapper/inv/DeviceRepairOrderDao.xml index a7bb8aa4a..6c095dbe7 100644 --- a/src/main/resources/mybatis/mapper/inv/DeviceRepairOrderDao.xml +++ b/src/main/resources/mybatis/mapper/inv/DeviceRepairOrderDao.xml @@ -13,17 +13,27 @@ t.deptCode, t.invCode, t.code, - t.status, + t.`status`, t.createUser, t.auditUser, t.msg, t.createTime, t.auditTime, t.remark, + t.repairType, + t.urgencyType, + t.planTime, + t.uploadImage, + t.repariStartTime, + t.repariEndTime, + t.repariName, + t.repariImage, + t.repariRemark, (select employeeName from auth_user where id = t.createUser) createUserName, (select employeeName from auth_user where id = t.auditUser) auditUserName, (select `name` from auth_dept where code = t.deptCode) deptName, (select `name` from auth_warehouse where code = t.invCode) invName, + (select employeeName from auth_user where id = t.repariName) repName, t1.deviceName, t1.ggxh, t1.batchNo @@ -39,12 +49,21 @@ AND t.invCode = #{invCode} + + AND t.repariName = #{repariName} + AND t.code like concat('%', #{code}, '%') AND t.status = #{status} + + and t.status in + + #{item} + + diff --git a/src/main/resources/schemas/schema_v2.2.sql b/src/main/resources/schemas/schema_v2.2.sql index 39627cec2..4642ce8a3 100644 --- a/src/main/resources/schemas/schema_v2.2.sql +++ b/src/main/resources/schemas/schema_v2.2.sql @@ -65,15 +65,15 @@ CREATE TABLE IF NOT EXISTS `device_project_set` SET FOREIGN_KEY_CHECKS = 1; -CALL Pro_Temp_ColumnWork('device_repair_order', 'repairType', 'varchar(255)', 1); +CALL Pro_Temp_ColumnWork('device_repair_order', 'repairType', 'tinyint', 1); CALL Pro_Temp_ColumnWork('device_repair_order', 'urgencyType', 'tinyint', 1); CALL Pro_Temp_ColumnWork('device_repair_order', 'planTime', 'datetime', 1); -CALL Pro_Temp_ColumnWork('device_repair_order', 'uploadImage', 'varchar(255)', 1); +CALL Pro_Temp_ColumnWork('device_repair_order', 'uploadImage', 'text', 1); CALL Pro_Temp_ColumnWork('device_repair_order', 'repariName', 'varchar(255)', 1); -CALL Pro_Temp_ColumnWork('device_repair_order', 'reparistartTime', 'varchar(255)', 1); -CALL Pro_Temp_ColumnWork('device_repair_order', 'repariEndTime', 'varchar(255)', 1); +CALL Pro_Temp_ColumnWork('device_repair_order', 'reparistartTime', 'datetime', 1); +CALL Pro_Temp_ColumnWork('device_repair_order', 'repariEndTime', 'datetime', 1); CALL Pro_Temp_ColumnWork('device_repair_order', 'repariRemark', 'varchar(255)', 1); -CALL Pro_Temp_ColumnWork('device_repair_order', 'repariImage', 'varchar(255)', 1); +CALL Pro_Temp_ColumnWork('device_repair_order', 'repariImage', 'text', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'startTime', 'datetime', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'endTime', 'datetime', 1); @@ -82,4 +82,4 @@ CALL Pro_Temp_ColumnWork('device_inspect_plan', 'frequencyUnit', 'tinyint', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'planStatus', 'tinyint', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'inspectUser', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'lastTime', 'datetime', 1); -CALL Pro_Temp_ColumnWork('device_inspect_plan', 'nextTime', 'datetime', 1); \ No newline at end of file +CALL Pro_Temp_ColumnWork('device_inspect_plan', 'nextTime', 'datetime', 1); From 76e3df3611c70016f5f94957c84535c4dd8bd392 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Mon, 7 Aug 2023 18:21:50 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E6=8A=A5=E4=BF=AE=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/req/inv/FilterDeviceRepairOrderRequest.java | 9 +++++++++ .../mybatis/mapper/inv/DeviceRepairOrderDao.xml | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/src/main/java/com/glxp/api/req/inv/FilterDeviceRepairOrderRequest.java b/src/main/java/com/glxp/api/req/inv/FilterDeviceRepairOrderRequest.java index c01a8cc8a..48774e5d4 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterDeviceRepairOrderRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterDeviceRepairOrderRequest.java @@ -45,4 +45,13 @@ public class FilterDeviceRepairOrderRequest extends ListPageRequest { */ private String repariName; + /** + * 维修类型 1:自行维修;2:外部维修 + */ + private Integer repairType; + /** + * 紧急类型 1,正常;2,较急;3,特急 + */ + private Integer urgencyType; + } diff --git a/src/main/resources/mybatis/mapper/inv/DeviceRepairOrderDao.xml b/src/main/resources/mybatis/mapper/inv/DeviceRepairOrderDao.xml index 6c095dbe7..91d30d8d5 100644 --- a/src/main/resources/mybatis/mapper/inv/DeviceRepairOrderDao.xml +++ b/src/main/resources/mybatis/mapper/inv/DeviceRepairOrderDao.xml @@ -64,6 +64,12 @@ #{item} + + and t.repairType = #{repairType} + + + and t.urgencyType = #{urgencyType} + From 6c66ec37cafc69d4843de312c0d67d77057ff3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Tue, 8 Aug 2023 09:33:26 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/common/req/UpdateRequest.java | 6 + .../java/com/glxp/api/constant/Constant.java | 5 + .../inv/DeviceInspectPlanController.java | 2 +- .../DeviceInspectPlanDelectController.java | 105 ++++++++++++++++ .../inv/DeviceInspectTakeController.java | 106 ++++++++++++++++ .../inv/DeviceInspectPlanDelectMapper.java | 9 ++ .../inv/DeviceInspectTaskDetailMapper.java | 7 +- .../api/dao/inv/DeviceInspectTaskMapper.java | 12 +- .../inv/DeviceInspectPlanDelectEntity.java | 54 +++++++++ ...ava => DeviceInspectTaskDetailEntity.java} | 7 +- ...Task.java => DeviceInspectTaskEntity.java} | 9 +- .../req/inv/AddDeviceInspectPlanRequest.java | 37 ++++++ .../inv/FilterDeviceInspectPlanRequest.java | 22 ++++ .../inv/FilterDeviceInspectTakeRequest.java | 64 ++++++++++ .../res/inv/DeviceInspectPlanResponse.java | 33 +++++ .../res/inv/DeviceInspectTakeResponse.java | 114 ++++++++++++++++++ .../inv/DeviceInspectPlanDelectService.java | 20 +++ .../service/inv/DeviceInspectPlanService.java | 3 +- .../inv/DeviceInspectTaskDetailService.java | 56 ++++++++- .../service/inv/DeviceInspectTaskService.java | 38 +++++- .../DeviceInspectPlanDelectServiceImpl.java | 56 +++++++++ .../impl/DeviceInspectPlanServiceImpl.java | 100 ++++++++++++++- .../mapper/inv/DeviceInspectPlanDao.xml | 31 ++++- .../inv/DeviceInspectPlanDelectMapper.xml | 16 +++ .../inv/DeviceInspectTaskDetailMapper.xml | 2 +- .../mapper/inv/DeviceInspectTaskMapper.xml | 72 ++++++++++- src/main/resources/schemas/schema_v2.2.sql | 5 +- 27 files changed, 962 insertions(+), 29 deletions(-) create mode 100644 src/main/java/com/glxp/api/controller/inv/DeviceInspectPlanDelectController.java create mode 100644 src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java create mode 100644 src/main/java/com/glxp/api/dao/inv/DeviceInspectPlanDelectMapper.java create mode 100644 src/main/java/com/glxp/api/entity/inv/DeviceInspectPlanDelectEntity.java rename src/main/java/com/glxp/api/entity/inv/{DeviceInspectTaskDetail.java => DeviceInspectTaskDetailEntity.java} (89%) rename src/main/java/com/glxp/api/entity/inv/{DeviceInspectTask.java => DeviceInspectTaskEntity.java} (89%) create mode 100644 src/main/java/com/glxp/api/req/inv/FilterDeviceInspectTakeRequest.java create mode 100644 src/main/java/com/glxp/api/res/inv/DeviceInspectTakeResponse.java create mode 100644 src/main/java/com/glxp/api/service/inv/DeviceInspectPlanDelectService.java create mode 100644 src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanDelectServiceImpl.java create mode 100644 src/main/resources/mybatis/mapper/inv/DeviceInspectPlanDelectMapper.xml diff --git a/src/main/java/com/glxp/api/common/req/UpdateRequest.java b/src/main/java/com/glxp/api/common/req/UpdateRequest.java index f6ac58e2b..ff27f2e72 100644 --- a/src/main/java/com/glxp/api/common/req/UpdateRequest.java +++ b/src/main/java/com/glxp/api/common/req/UpdateRequest.java @@ -2,6 +2,8 @@ package com.glxp.api.common.req; import lombok.Data; +import java.util.Date; + /** * 更新审核接口基础参数 */ @@ -43,4 +45,8 @@ public class UpdateRequest { */ private String repariRemark; + private String inspectUser; + + private Date expectedTime; + } diff --git a/src/main/java/com/glxp/api/constant/Constant.java b/src/main/java/com/glxp/api/constant/Constant.java index e8496ecaf..ffd24cc8f 100644 --- a/src/main/java/com/glxp/api/constant/Constant.java +++ b/src/main/java/com/glxp/api/constant/Constant.java @@ -58,6 +58,11 @@ public class Constant { */ public static final String DEVICE_INSPECT_PLAN_ORDER = "DIP"; + /** + * 设备巡检计划前缀 + */ + public static final String DEVICE_INSPECT_TAKE_ORDER = "DIT"; + /** * 设备报修前缀 */ diff --git a/src/main/java/com/glxp/api/controller/inv/DeviceInspectPlanController.java b/src/main/java/com/glxp/api/controller/inv/DeviceInspectPlanController.java index 6515e3eb6..c4f0d617d 100644 --- a/src/main/java/com/glxp/api/controller/inv/DeviceInspectPlanController.java +++ b/src/main/java/com/glxp/api/controller/inv/DeviceInspectPlanController.java @@ -96,7 +96,7 @@ public class DeviceInspectPlanController { if (null == updateRequest || StrUtil.isBlank(updateRequest.getOrderId())) { return ResultVOUtils.paramVerifyFail(); } - return deviceInspectPlanService.updateStatus(updateRequest.getOrderId(), updateRequest.getStatus()); + return deviceInspectPlanService.updateStatus(updateRequest.getOrderId(), updateRequest.getStatus(), updateRequest.getInspectUser(),updateRequest.getExpectedTime()); } /** diff --git a/src/main/java/com/glxp/api/controller/inv/DeviceInspectPlanDelectController.java b/src/main/java/com/glxp/api/controller/inv/DeviceInspectPlanDelectController.java new file mode 100644 index 000000000..d4df8dba3 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/inv/DeviceInspectPlanDelectController.java @@ -0,0 +1,105 @@ +package com.glxp.api.controller.inv; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity; +import com.glxp.api.entity.inv.DeviceInspectSetEntity; +import com.glxp.api.req.inv.AddDeviceInspectSetRequest; +import com.glxp.api.res.inv.DeviceInspectSetResponse; +import com.glxp.api.service.auth.CustomerService; +import com.glxp.api.service.inv.DeviceInspectPlanDelectService; +import lombok.extern.slf4j.Slf4j; +import org.apache.lucene.util.CollectionUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +@Slf4j +@RestController +public class DeviceInspectPlanDelectController { + + @Resource + DeviceInspectPlanDelectService deviceInspectPlanDelectService; + @Resource + CustomerService customerService; + + + /** + * 查询巡检设置配置项 + * + * @param deviceInspectPlanDelectEntity + * @return + */ + @GetMapping("/udiwms/inv/device/inspect/plan/selectDeviceInspectPlanDelect") + public BaseResponse selectDeviceInspectPlanDelect(DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity) { + List deviceInspectPlanDelectEntityList = deviceInspectPlanDelectService.selectDeviceInspectPlanDelect(deviceInspectPlanDelectEntity); + return ResultVOUtils.success(deviceInspectPlanDelectEntityList); + } + + /** + * 添加巡检设置配置项 + * + * @param deviceInspectPlanDelectEntity + * @return + */ + @PostMapping("/udiwms/inv/device/inspect/plan/addDeviceInspectPlanDelect") + public BaseResponse addDeviceInspectPlanDelect(@RequestBody DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity) { + + AuthAdmin authAdmin=customerService.getUserBean(); + deviceInspectPlanDelectEntity.setId(IdUtil.getSnowflakeNextId()); + deviceInspectPlanDelectEntity.setUpdateTime(new Date()); + deviceInspectPlanDelectEntity.setUpdateUser(authAdmin.getId() + ""); + Boolean falg=deviceInspectPlanDelectService.addDeviceInspectPlanDelectEntity(deviceInspectPlanDelectEntity); + if(!falg){ + return ResultVOUtils.error(999,"添加失败!"); + } + return ResultVOUtils.success(); + } + + /** + * 更新巡检设置配置项 + * + * @param deviceInspectPlanDelectEntity + * @return + */ + @PostMapping("/udiwms/inv/device/inspect/plan/uploadDeviceInspectPlanDelect") + public BaseResponse uploadDeviceInspectPlanDelect(@RequestBody DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity) { + + + AuthAdmin authAdmin=customerService.getUserBean(); + deviceInspectPlanDelectEntity.setUpdateTime(new Date()); + deviceInspectPlanDelectEntity.setUpdateUser(authAdmin.getId() + ""); + Boolean falg=deviceInspectPlanDelectService.uploadDeviceInspectPlanDelectEntity(deviceInspectPlanDelectEntity); + if(!falg){ + return ResultVOUtils.error(999,"更新失败!"); + } + return ResultVOUtils.success(); + } + + + /** + * 删除巡检设置配置项 + * + * @param deviceInspectPlanDelectEntity + * @return + */ + @PostMapping("/udiwms/inv/device/inspect/plan/delectDeviceInspectPlanDelect") + public BaseResponse delectDeviceInspectPlanDelect(@RequestBody DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity) { + + Boolean falg=deviceInspectPlanDelectService.delectDeviceInspectPlanDelectEntity(deviceInspectPlanDelectEntity); + if(!falg){ + return ResultVOUtils.error(999,"删除失败!"); + } + return ResultVOUtils.success(); + } + + +} diff --git a/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java b/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java new file mode 100644 index 000000000..2b73acdd3 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java @@ -0,0 +1,106 @@ +package com.glxp.api.controller.inv; + +import cn.hutool.core.util.StrUtil; +import com.github.pagehelper.PageInfo; +import com.glxp.api.common.req.UpdateRequest; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity; +import com.glxp.api.entity.inv.DeviceInspectPlanEntity; +import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; +import com.glxp.api.entity.inv.DeviceInspectTaskEntity; +import com.glxp.api.req.inv.AddDeviceInspectPlanRequest; +import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest; +import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest; +import com.glxp.api.req.system.DeleteRequest; +import com.glxp.api.res.inv.DeviceInspectPlanResponse; +import com.glxp.api.res.inv.DeviceInspectTakeResponse; +import com.glxp.api.service.inv.DeviceInspectPlanService; +import com.glxp.api.service.inv.DeviceInspectTaskDetailService; +import com.glxp.api.service.inv.DeviceInspectTaskService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * 设备巡检任务接口 + */ +@Slf4j +@RestController +public class DeviceInspectTakeController { + + @Resource + DeviceInspectTaskService deviceInspectTaskService; + + @Resource + DeviceInspectTaskDetailService deviceInspectTaskDetailService; + + /** + * 查询设设备巡检任务接口 + * + * @param filterDeviceInspectTakeRequest + * @return + */ + @GetMapping("/udiwms/inv/device/inspect/take/filter") + public BaseResponse filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest) { + List list = deviceInspectTaskService.filterList(filterDeviceInspectTakeRequest); + PageInfo pageInfo = new PageInfo<>(list); + return ResultVOUtils.page(pageInfo); + } + @PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceInspecTake") + public BaseResponse uploadDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { + deviceInspectTaskEntity.setUpdateTime(new Date()); + if(deviceInspectTaskEntity.getStatus() == 1){ + deviceInspectTaskEntity.setStrartTime(new Date()); + }else{ + deviceInspectTaskEntity.setEndTime(new Date()); + } + boolean falg=deviceInspectTaskService.updateById(deviceInspectTaskEntity); + if(!falg){ + return ResultVOUtils.error(999,"更新失败"); + } + return ResultVOUtils.success(); + } + + + + + + + + + //------------------------------------------ 详情方法--------------------------------------------------------------// + @GetMapping("/udiwms/inv/device/inspect/take/detail/selectDeviceInspecTakeDetail") + public BaseResponse selectDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { + List deviceInspectPlanDelectEntityList = deviceInspectTaskDetailService.selectDeviceInspectTakeDetail(deviceInspectTaskDetailEntity); + return ResultVOUtils.success(deviceInspectPlanDelectEntityList); + } + + @PostMapping("/udiwms/inv/device/inspect/take/detail/uploadDeviceInspecTakeDetail") + public BaseResponse uploadDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { + deviceInspectTaskDetailEntity.setUpdateTime(new Date()); + boolean falg=deviceInspectTaskDetailService.uploadDeviceInspecTakeDetail(deviceInspectTaskDetailEntity); + if(!falg){ + return ResultVOUtils.error(999,"更新失败"); + } + return ResultVOUtils.success(); + } + + @PostMapping("/udiwms/inv/device/inspect/take/detail/addDeviceInspecTakeDetail") + public BaseResponse addDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { + + boolean falg=deviceInspectTaskDetailService.addDeviceInspectTaskDelect(deviceInspectTaskDetailEntity); + if(!falg){ + return ResultVOUtils.error(999,"更新失败"); + } + return ResultVOUtils.success(); + } + + +} diff --git a/src/main/java/com/glxp/api/dao/inv/DeviceInspectPlanDelectMapper.java b/src/main/java/com/glxp/api/dao/inv/DeviceInspectPlanDelectMapper.java new file mode 100644 index 000000000..44f18ea93 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/inv/DeviceInspectPlanDelectMapper.java @@ -0,0 +1,9 @@ +package com.glxp.api.dao.inv; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DeviceInspectPlanDelectMapper extends BaseMapper { +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskDetailMapper.java b/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskDetailMapper.java index 9977ba8b4..dda5195c3 100644 --- a/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskDetailMapper.java +++ b/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskDetailMapper.java @@ -1,9 +1,12 @@ package com.glxp.api.dao.inv; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.glxp.api.entity.inv.DeviceInspectTaskDetail; +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.dao.purchase.PurOrderDao; +import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; +import com.glxp.api.entity.purchase.PurOrderEntity; import org.apache.ibatis.annotations.Mapper; @Mapper -public interface DeviceInspectTaskDetailMapper extends BaseMapper { +public interface DeviceInspectTaskDetailMapper extends BaseMapperPlus { } \ No newline at end of file diff --git a/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskMapper.java b/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskMapper.java index 0b805c96b..acbf6c706 100644 --- a/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskMapper.java +++ b/src/main/java/com/glxp/api/dao/inv/DeviceInspectTaskMapper.java @@ -1,9 +1,17 @@ package com.glxp.api.dao.inv; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.glxp.api.entity.inv.DeviceInspectTask; +import com.glxp.api.entity.inv.DeviceInspectTaskEntity; +import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest; +import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest; +import com.glxp.api.res.inv.DeviceInspectPlanResponse; +import com.glxp.api.res.inv.DeviceInspectTakeResponse; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + @Mapper -public interface DeviceInspectTaskMapper extends BaseMapper { +public interface DeviceInspectTaskMapper extends BaseMapper { + + List filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest); } \ No newline at end of file diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceInspectPlanDelectEntity.java b/src/main/java/com/glxp/api/entity/inv/DeviceInspectPlanDelectEntity.java new file mode 100644 index 000000000..ee3c7ea34 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/inv/DeviceInspectPlanDelectEntity.java @@ -0,0 +1,54 @@ +package com.glxp.api.entity.inv; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import lombok.Data; + +@Data +@TableName(value = "device_inspect_plan_delect") +public class DeviceInspectPlanDelectEntity { + @TableId(value = "id", type = IdType.INPUT) + private Long id; + + @TableField(value = "orderIdFk") + private String orderIdFk; + + /** + * 项目编号 + */ + @TableField(value = "code") + private String code; + + /** + * 项目内容 + */ + @TableField(value = "content") + private String content; + + /** + * 项目类型:1:巡检;2:养护 + */ + @TableField(value = "`type`") + private Integer type; + + /** + * 备注 + */ + @TableField(value = "remark") + private String remark; + + /** + * 更新人 + */ + @TableField(value = "updateUser") + private String updateUser; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private Date updateTime; +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskDetail.java b/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskDetailEntity.java similarity index 89% rename from src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskDetail.java rename to src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskDetailEntity.java index 272346058..96ff6cfd1 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskDetail.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskDetailEntity.java @@ -10,7 +10,7 @@ import lombok.Data; @Data @TableName(value = "device_inspect_task_detail") -public class DeviceInspectTaskDetail implements Serializable { +public class DeviceInspectTaskDetailEntity implements Serializable { @TableId(value = "id", type = IdType.INPUT) private Integer id; @@ -30,7 +30,7 @@ public class DeviceInspectTaskDetail implements Serializable { * 状态(1:未开始;2:已检查;3:异常;4:不巡检 */ @TableField(value = "`status`") - private String status; + private Integer status; /** * 巡检结果备注 @@ -62,5 +62,8 @@ public class DeviceInspectTaskDetail implements Serializable { @TableField(value = "taskOrderIdFk") private String taskOrderIdFk; + @TableField(exist = false) + private String inspectName; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceInspectTask.java b/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java similarity index 89% rename from src/main/java/com/glxp/api/entity/inv/DeviceInspectTask.java rename to src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java index 51969cd66..95797aadf 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceInspectTask.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java @@ -10,7 +10,7 @@ import lombok.Data; @Data @TableName(value = "device_inspect_task") -public class DeviceInspectTask implements Serializable { +public class DeviceInspectTaskEntity implements Serializable { @TableId(value = "id", type = IdType.INPUT) private Integer id; @@ -45,10 +45,10 @@ public class DeviceInspectTask implements Serializable { private String code; /** - * 状态 + * 状态 0 未巡检 1 巡检中 2 巡检结束 */ @TableField(value = "`status`") - private String status; + private Integer status; /** * 巡检人 @@ -92,5 +92,8 @@ public class DeviceInspectTask implements Serializable { @TableField(value = "updateTime") private Date updateTime; + @TableField(value = "expectedTime") + private Date expectedTime; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/glxp/api/req/inv/AddDeviceInspectPlanRequest.java b/src/main/java/com/glxp/api/req/inv/AddDeviceInspectPlanRequest.java index 8e906600e..8380db3f0 100644 --- a/src/main/java/com/glxp/api/req/inv/AddDeviceInspectPlanRequest.java +++ b/src/main/java/com/glxp/api/req/inv/AddDeviceInspectPlanRequest.java @@ -2,6 +2,8 @@ package com.glxp.api.req.inv; import lombok.Data; +import java.util.Date; + /** * 添加部门设备巡检计划参数 */ @@ -38,4 +40,39 @@ public class AddDeviceInspectPlanRequest { */ private String remark; + + /** + * 计划开始时间 + */ + private Date startTime; + /** + * 计划结束时间 + */ + private Date endTime; + /** + * 时间频率 + */ + private String frequency; + /** + * 时间频率单位(1:年;2:月:3:日;4:小时;5:分钟: 6:秒) + */ + private Integer frequencyUnit; + /** + * 计划状态(1:未启用;2:运行中;3:已结束;4:已过期 + */ + private Integer planStatus; + /** + * 巡检人 + */ + private String inspectUser; + /** + * 上次巡检时间 + */ + private Date lastTime; + /** + * 下一次巡检时间 + */ + private Date nextTime; + + } diff --git a/src/main/java/com/glxp/api/req/inv/FilterDeviceInspectPlanRequest.java b/src/main/java/com/glxp/api/req/inv/FilterDeviceInspectPlanRequest.java index 6b963e85b..3bbe659c2 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterDeviceInspectPlanRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterDeviceInspectPlanRequest.java @@ -3,6 +3,8 @@ package com.glxp.api.req.inv; import com.glxp.api.util.page.ListPageRequest; import lombok.Data; +import java.util.List; + /** * 查询设备设备巡检计划接口参数 */ @@ -41,4 +43,24 @@ public class FilterDeviceInspectPlanRequest extends ListPageRequest { */ private Integer status; + private List statusList; + + private Integer planStatus; + + + private String ksStartDate; + + private String ksEndDate; + + private String jsStartDate; + + private String jsEndDate; + + private String auditStartDate; + + private String auditEndDate; + + + + } diff --git a/src/main/java/com/glxp/api/req/inv/FilterDeviceInspectTakeRequest.java b/src/main/java/com/glxp/api/req/inv/FilterDeviceInspectTakeRequest.java new file mode 100644 index 000000000..3d82505ee --- /dev/null +++ b/src/main/java/com/glxp/api/req/inv/FilterDeviceInspectTakeRequest.java @@ -0,0 +1,64 @@ +package com.glxp.api.req.inv; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * 查询设备设备巡检计划接口参数 + */ +@Data +public class FilterDeviceInspectTakeRequest extends ListPageRequest { + + private Integer id; + + /** + * 单号 + */ + private String orderId; + + /** + * 部门编码 + */ + private String deptCode; + + /** + * 仓库编码 + */ + private String invCode; + + /** + * 资产编码 + */ + private String code; + + /** + * 计划级别(1:低级;2:中级;3:高级) + */ + private Integer level; + + /** + * 状态(1:新增;2:未审核;3:已审核) + */ + private Integer status; + + private List statusList; + + private Date expectedTime; + + private String ksStartDate; + + private String ksEndDate; + + private String jsStartDate; + + private String jsEndDate; + + private String yjjsStartDate; + + private String yjjsEndDate; + + +} diff --git a/src/main/java/com/glxp/api/res/inv/DeviceInspectPlanResponse.java b/src/main/java/com/glxp/api/res/inv/DeviceInspectPlanResponse.java index 2d2b101ba..a34e318cb 100644 --- a/src/main/java/com/glxp/api/res/inv/DeviceInspectPlanResponse.java +++ b/src/main/java/com/glxp/api/res/inv/DeviceInspectPlanResponse.java @@ -102,4 +102,37 @@ public class DeviceInspectPlanResponse { */ private String auditUserName; + /** + * 计划开始时间 + */ + private Date startTime; + /** + * 计划结束时间 + */ + private Date endTime; + /** + * 时间频率 + */ + private String frequency; + /** + * 时间频率单位(1:年;2:月:3:日;4:小时;5:分钟: 6:秒) + */ + private Integer frequencyUnit; + /** + * 计划状态(1:未启用;2:运行中;3:已结束;4:已过期 + */ + private Integer planStatus; + /** + * 巡检人 + */ + private String inspectUser; + /** + * 上次巡检时间 + */ + private Date lastTime; + /** + * 下一次巡检时间 + */ + private Date nextTime; + } diff --git a/src/main/java/com/glxp/api/res/inv/DeviceInspectTakeResponse.java b/src/main/java/com/glxp/api/res/inv/DeviceInspectTakeResponse.java new file mode 100644 index 000000000..789d05d0f --- /dev/null +++ b/src/main/java/com/glxp/api/res/inv/DeviceInspectTakeResponse.java @@ -0,0 +1,114 @@ +package com.glxp.api.res.inv; + +import lombok.Data; + +import java.util.Date; + +/** + * 设备巡检计划VO + */ +@Data +public class DeviceInspectTakeResponse { + + private Integer id; + + /** + * 单号 + */ + private String orderId; + + /** + * 部门编码 + */ + private String deptCode; + + /** + * 仓库编码 + */ + private String invCode; + + /** + * 资产编码 + */ + private String code; + + private String planOrderIdFk; + + /** + * 状态(0:未巡检;1:巡检中;2:已巡检) + */ + private Integer status; + + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 备注 + */ + private String remark; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 仓库名称 + */ + private String invName; + + /** + * 设备名称 + */ + private String deviceName; + + /** + * 规格型号 + */ + private String ggxh; + + /** + * 批次号 + */ + private String batchNo; + + /** + * 创建人名称 + */ + private String createUserName; + + /** + * 审核人名称 + */ + private String auditUserName; + + /** + * 计划开始时间 + */ + private Date strartTime; + /** + * 计划结束时间 + */ + private Date endTime; + + /** + * 计划状态(1:未启用;2:运行中;3:已结束;4:已过期 + */ + private Integer planStatus; + /** + * 巡检人 + */ + private String inspectUser; + /** + * 上次巡检时间 + */ + private Date remindTime; + private String inspectName; + private Date expectedTime; + + + +} diff --git a/src/main/java/com/glxp/api/service/inv/DeviceInspectPlanDelectService.java b/src/main/java/com/glxp/api/service/inv/DeviceInspectPlanDelectService.java new file mode 100644 index 000000000..7256023fb --- /dev/null +++ b/src/main/java/com/glxp/api/service/inv/DeviceInspectPlanDelectService.java @@ -0,0 +1,20 @@ +package com.glxp.api.service.inv; + +import com.glxp.api.dao.inv.DeviceInspectPlanDelectMapper; +import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity; +import com.baomidou.mybatisplus.extension.service.IService; + +import javax.annotation.Resource; +import java.util.List; + +public interface DeviceInspectPlanDelectService extends IService { + + List selectDeviceInspectPlanDelect(DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity); + + Boolean addDeviceInspectPlanDelectEntity(DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity); + + Boolean uploadDeviceInspectPlanDelectEntity(DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity); + + Boolean delectDeviceInspectPlanDelectEntity(DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity); + +} diff --git a/src/main/java/com/glxp/api/service/inv/DeviceInspectPlanService.java b/src/main/java/com/glxp/api/service/inv/DeviceInspectPlanService.java index 6ed4b8a9d..517340db4 100644 --- a/src/main/java/com/glxp/api/service/inv/DeviceInspectPlanService.java +++ b/src/main/java/com/glxp/api/service/inv/DeviceInspectPlanService.java @@ -6,6 +6,7 @@ import com.glxp.api.req.inv.AddDeviceInspectPlanRequest; import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest; import com.glxp.api.res.inv.DeviceInspectPlanResponse; +import java.util.Date; import java.util.List; /** @@ -52,7 +53,7 @@ public interface DeviceInspectPlanService { * @param status * @return */ - BaseResponse updateStatus(String orderId, Integer status); + BaseResponse updateStatus(String orderId, Integer status, String inspectUser, Date expectedTime); /** * 删除巡检计划 diff --git a/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskDetailService.java b/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskDetailService.java index f870cdb76..ccf059ff9 100644 --- a/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskDetailService.java +++ b/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskDetailService.java @@ -1,12 +1,60 @@ package com.glxp.api.service.inv; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.glxp.api.dao.inv.DeviceInspectTaskMapper; +import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity; +import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import java.util.List; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.glxp.api.entity.inv.DeviceInspectTaskDetail; +import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; import com.glxp.api.dao.inv.DeviceInspectTaskDetailMapper; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + @Service -public class DeviceInspectTaskDetailService extends ServiceImpl { +public class DeviceInspectTaskDetailService extends ServiceImpl { + + @Resource + private DeviceInspectTaskDetailMapper deviceInspectTaskDetailMapper; + + public Boolean addDeviceInspectTaskDelect(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity){ + deviceInspectTaskDetailEntity.setUpdateTime(new Date()); + deviceInspectTaskDetailMapper.insert(deviceInspectTaskDetailEntity); + return true; + } + + public Boolean addDeviceInspectTaskDelectList(List deviceInspectTaskDetailEntityList){ + deviceInspectTaskDetailMapper.insertBatch(deviceInspectTaskDetailEntityList); + return true; + } + + + public List selectDeviceInspectTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) { + + QueryWrapper ew = new QueryWrapper<>(); + if(deviceInspectTaskDetailEntity.getProjectCode() != null){ + ew.eq("projectCode",deviceInspectTaskDetailEntity.getProjectCode()); + } + if(deviceInspectTaskDetailEntity.getId() != null){ + ew.eq("id",deviceInspectTaskDetailEntity.getId()); + } + if(deviceInspectTaskDetailEntity.getTaskOrderIdFk() != null){ + ew.eq("taskOrderIdFk",deviceInspectTaskDetailEntity.getTaskOrderIdFk()); + } + if(deviceInspectTaskDetailEntity.getStatus() != null){ + ew.like("status",deviceInspectTaskDetailEntity.getStatus()); + } + ew.select("*, ( SELECT `employeeName` FROM auth_user WHERE id = device_inspect_task_detail.inspectUser ) inspectName"); + List deviceInspectPlanDelectEntities=deviceInspectTaskDetailMapper.selectList(ew); + return deviceInspectPlanDelectEntities; + } + + public Boolean uploadDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntityList){ + return deviceInspectTaskDetailMapper.updateById(deviceInspectTaskDetailEntityList) > 0 ? true : false; + } + + } diff --git a/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java b/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java index 75dff98bd..677080666 100644 --- a/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java +++ b/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java @@ -1,12 +1,42 @@ package com.glxp.api.service.inv; +import com.github.pagehelper.PageHelper; +import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest; +import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest; +import com.glxp.api.res.inv.DeviceInspectPlanResponse; +import com.glxp.api.res.inv.DeviceInspectTakeResponse; import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import java.util.List; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.glxp.api.dao.inv.DeviceInspectTaskMapper; -import com.glxp.api.entity.inv.DeviceInspectTask; +import com.glxp.api.entity.inv.DeviceInspectTaskEntity; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; +import java.util.List; + @Service -public class DeviceInspectTaskService extends ServiceImpl { +public class DeviceInspectTaskService extends ServiceImpl { + + @Resource + private DeviceInspectTaskMapper deviceInspectTaskMapper; + + public Boolean addDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity){ + deviceInspectTaskEntity.setUpdateTime(new Date()); + deviceInspectTaskMapper.insert(deviceInspectTaskEntity); + return true; + } + + + + public List filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest) { + if (null == filterDeviceInspectTakeRequest) { + return Collections.emptyList(); + } + if (null != filterDeviceInspectTakeRequest.getPage() && null != filterDeviceInspectTakeRequest.getLimit()) { + PageHelper.offsetPage((filterDeviceInspectTakeRequest.getPage() - 1) * filterDeviceInspectTakeRequest.getLimit(), filterDeviceInspectTakeRequest.getLimit()); + } + return deviceInspectTaskMapper.filterList(filterDeviceInspectTakeRequest); + } } diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanDelectServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanDelectServiceImpl.java new file mode 100644 index 000000000..072874859 --- /dev/null +++ b/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanDelectServiceImpl.java @@ -0,0 +1,56 @@ +package com.glxp.api.service.inv.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.api.dao.inv.DeviceInspectPlanDelectMapper; +import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity; +import com.glxp.api.service.inv.DeviceInspectPlanDelectService; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class DeviceInspectPlanDelectServiceImpl extends ServiceImpl implements DeviceInspectPlanDelectService { + + @Resource + DeviceInspectPlanDelectMapper deviceInspectPlanDelectMapper; + + @Override + public List selectDeviceInspectPlanDelect(DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity) { + + QueryWrapper ew = new QueryWrapper<>(); + if(deviceInspectPlanDelectEntity.getOrderIdFk() != null){ + ew.eq("orderIdFk",deviceInspectPlanDelectEntity.getOrderIdFk()); + } + if(deviceInspectPlanDelectEntity.getId() != null){ + ew.eq("id",deviceInspectPlanDelectEntity.getId()); + } + if(deviceInspectPlanDelectEntity.getCode() != null){ + ew.eq("code",deviceInspectPlanDelectEntity.getCode()); + } + if(deviceInspectPlanDelectEntity.getContent() != null){ + ew.like("content",deviceInspectPlanDelectEntity.getContent()); + } + if(deviceInspectPlanDelectEntity.getType() != null){ + ew.eq("type",deviceInspectPlanDelectEntity.getType()); + } + List deviceInspectPlanDelectEntities=deviceInspectPlanDelectMapper.selectList(ew); + return deviceInspectPlanDelectEntities; + } + + @Override + public Boolean addDeviceInspectPlanDelectEntity(DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity) { + return deviceInspectPlanDelectMapper.insert(deviceInspectPlanDelectEntity) > 0; + } + + @Override + public Boolean uploadDeviceInspectPlanDelectEntity(DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity) { + return deviceInspectPlanDelectMapper.updateById(deviceInspectPlanDelectEntity) > 0; + } + + @Override + public Boolean delectDeviceInspectPlanDelectEntity(DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity) { + return deviceInspectPlanDelectMapper.deleteById(deviceInspectPlanDelectEntity) > 0; + } +} diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanServiceImpl.java index a54e78390..e742c22e9 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanServiceImpl.java @@ -2,18 +2,27 @@ package com.glxp.api.service.inv.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.Constant; import com.glxp.api.dao.inv.DeviceInspectPlanDao; +import com.glxp.api.dao.inv.DeviceInspectPlanDelectMapper; +import com.glxp.api.dao.inv.DeviceInspectTaskDetailMapper; +import com.glxp.api.dao.inv.DeviceInspectTaskMapper; +import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity; import com.glxp.api.entity.inv.DeviceInspectPlanEntity; +import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; +import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import com.glxp.api.req.inv.AddDeviceInspectPlanRequest; import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest; import com.glxp.api.res.inv.DeviceInspectPlanResponse; import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.inv.DeviceInspectOrderService; import com.glxp.api.service.inv.DeviceInspectPlanService; +import com.glxp.api.service.inv.DeviceInspectTaskDetailService; +import com.glxp.api.service.inv.DeviceInspectTaskService; import com.glxp.api.util.GennerOrderUtils; import com.glxp.api.util.OrderNoTypeBean; import lombok.extern.slf4j.Slf4j; @@ -21,6 +30,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; @@ -38,6 +48,12 @@ public class DeviceInspectPlanServiceImpl implements DeviceInspectPlanService { private GennerOrderUtils gennerOrderUtils; @Resource private DeviceInspectOrderService deviceInspectOrderService; + @Resource + private DeviceInspectTaskService deviceInspectTaskService; + @Resource + private DeviceInspectPlanDelectMapper deviceInspectPlanDelectMapper; + @Resource + private DeviceInspectTaskDetailService deviceInspectTaskDetailService; @Override public List filterList(FilterDeviceInspectPlanRequest filterDeviceInspectPlanRequest) { @@ -52,6 +68,15 @@ public class DeviceInspectPlanServiceImpl implements DeviceInspectPlanService { @Override public BaseResponse addDeviceInspectPlan(AddDeviceInspectPlanRequest deviceInspectPlanRequest) { + //判断启用状态下只有一条 + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("code", deviceInspectPlanRequest.getCode()); + ew.eq("planStatus", 2); + Long count = deviceInspectPlanDao.selectCount(ew); + if (count > 0) { + return ResultVOUtils.error(999, "已存在该设备启用的计划!"); + } + DeviceInspectPlanEntity deviceInspectPlanEntity = new DeviceInspectPlanEntity(); BeanUtil.copyProperties(deviceInspectPlanRequest, deviceInspectPlanEntity); deviceInspectPlanEntity.setCreateUser(customerService.getUserIdStr()); @@ -62,16 +87,27 @@ public class DeviceInspectPlanServiceImpl implements DeviceInspectPlanService { deviceInspectPlanEntity.setCreateTime(date); deviceInspectPlanEntity.setUpdateTime(date); deviceInspectPlanDao.insert(deviceInspectPlanEntity); - return ResultVOUtils.success(); + return ResultVOUtils.success(deviceInspectPlanEntity); } @Override public BaseResponse updateDeviceInspectPlan(DeviceInspectPlanEntity deviceInspectPlanEntity) { + if(deviceInspectPlanEntity.getPlanStatus() == 2){ + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("code", deviceInspectPlanEntity.getCode()); + ew.eq("planStatus", 2); + ew.last("limit 1"); + DeviceInspectPlanEntity deviceInspectPlanEntity1 = deviceInspectPlanDao.selectOne(ew); + if (deviceInspectPlanEntity1 != null && !deviceInspectPlanEntity1.getId().equals(deviceInspectPlanEntity.getId())) { + return ResultVOUtils.error(999, "已存在该设备启用的计划!"); + } + } + DeviceInspectPlanEntity deviceInspectPlan = deviceInspectPlanDao.selectById(deviceInspectPlanEntity.getId()); BeanUtil.copyProperties(deviceInspectPlanEntity, deviceInspectPlan, "id", "createTime", "createUser"); deviceInspectPlan.setUpdateTime(new Date()); deviceInspectPlanDao.updateById(deviceInspectPlan); - return ResultVOUtils.success(); + return ResultVOUtils.success(deviceInspectPlan); } @Override @@ -87,18 +123,23 @@ public class DeviceInspectPlanServiceImpl implements DeviceInspectPlanService { } @Override - public BaseResponse updateStatus(String orderId, Integer status) { + public BaseResponse updateStatus(String orderId, Integer status, String inspectUser,Date expectedTime) { if (StrUtil.isBlank(orderId) || null == status) { return ResultVOUtils.paramVerifyFail(); } DeviceInspectPlanEntity deviceInspectPlanEntity = deviceInspectPlanDao.selectByOrderId(orderId); deviceInspectPlanEntity.setStatus(status); deviceInspectPlanEntity.setUpdateTime(new Date()); + deviceInspectPlanEntity.setInspectUser(inspectUser); if (status == 2) { - //审核通过,生成维保单 - deviceInspectOrderService.addByPlanOrderId(orderId); deviceInspectPlanEntity.setAuditTime(new Date()); deviceInspectPlanEntity.setAuditUser(customerService.getUserIdStr()); +// //审核通过,生成任务单 +// deviceInspectOrderService.addByPlanOrderId(orderId); + //生成计划主表 + DeviceInspectTaskEntity deviceInspectTaskEntity = getDeviceInspectTaskEntity(orderId,expectedTime); + //生成计划详情主表 + getDeviceInspectTaskDetailEntity(orderId, deviceInspectTaskEntity.getOrderId()); } deviceInspectPlanDao.updateById(deviceInspectPlanEntity); return ResultVOUtils.success(); @@ -113,4 +154,53 @@ public class DeviceInspectPlanServiceImpl implements DeviceInspectPlanService { return ResultVOUtils.success(); } + //组装任务实体 + public DeviceInspectTaskEntity getDeviceInspectTaskEntity(String orderId,Date expectedTime) { + //查询计划单 + DeviceInspectPlanEntity deviceInspectPlanEntity = deviceInspectPlanDao.selectByOrderId(orderId); + if (deviceInspectPlanEntity == null) { + return null; + } + String takeOrderId = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_INSPECT_TAKE_ORDER, "yyyyMMdd")); + DeviceInspectTaskEntity deviceInspectTaskEntity = new DeviceInspectTaskEntity(); + deviceInspectTaskEntity.setOrderId(takeOrderId); + deviceInspectTaskEntity.setPlanOrderIdFk(orderId); + deviceInspectTaskEntity.setExpectedTime(expectedTime); + deviceInspectTaskEntity.setDeptCode(deviceInspectPlanEntity.getDeptCode()); + deviceInspectTaskEntity.setInvCode(deviceInspectPlanEntity.getInvCode()); + deviceInspectTaskEntity.setCode(deviceInspectPlanEntity.getCode()); + deviceInspectTaskEntity.setStatus(0); + deviceInspectTaskEntity.setInspectUser(deviceInspectPlanEntity.getInspectUser()); + deviceInspectTaskEntity.setRemark(deviceInspectPlanEntity.getRemark()); + deviceInspectTaskEntity.setCreateTime(new Date()); + deviceInspectTaskEntity.setUpdateTime(new Date()); + deviceInspectTaskService.addDeviceInspectTask(deviceInspectTaskEntity); + return deviceInspectTaskEntity; + } + + //组装任务实体 + public List getDeviceInspectTaskDetailEntity(String orderId, String taskOrderIdFk) { + //查询计划详情单 + DeviceInspectPlanEntity deviceInspectPlanEntity = deviceInspectPlanDao.selectByOrderId(orderId); + List deviceInspectTaskDetailEntityLis = new ArrayList<>(); + QueryWrapper ew = new QueryWrapper<>(); + ew.eq("orderIdFK", orderId); + List deviceInspectPlanDelectEntityList = deviceInspectPlanDelectMapper.selectList(ew); + if (deviceInspectPlanDelectEntityList == null && deviceInspectPlanDelectEntityList.size() == 0) { + return null; + } + for (DeviceInspectPlanDelectEntity deviceInspectPlanDelectEntity : deviceInspectPlanDelectEntityList) { + DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity = new DeviceInspectTaskDetailEntity(); + deviceInspectTaskDetailEntity.setProjectCode(deviceInspectPlanEntity.getCode()); + deviceInspectTaskDetailEntity.setProjectContent(deviceInspectPlanDelectEntity.getContent()); + deviceInspectTaskDetailEntity.setStatus(1); + deviceInspectTaskDetailEntity.setInspectUser(deviceInspectPlanEntity.getInspectUser()); + deviceInspectTaskDetailEntity.setUpdateTime(new Date()); + deviceInspectTaskDetailEntity.setTaskOrderIdFk(taskOrderIdFk); + deviceInspectTaskDetailEntityLis.add(deviceInspectTaskDetailEntity); + } + deviceInspectTaskDetailService.addDeviceInspectTaskDelectList(deviceInspectTaskDetailEntityLis); + return deviceInspectTaskDetailEntityLis; + } + } diff --git a/src/main/resources/mybatis/mapper/inv/DeviceInspectPlanDao.xml b/src/main/resources/mybatis/mapper/inv/DeviceInspectPlanDao.xml index d903ff1ba..cf5ad3aa1 100644 --- a/src/main/resources/mybatis/mapper/inv/DeviceInspectPlanDao.xml +++ b/src/main/resources/mybatis/mapper/inv/DeviceInspectPlanDao.xml @@ -21,6 +21,14 @@ t.auditUser, t.auditTime, t.remark, + t.startTime, + t.endTime, + t.frequency, + t.frequencyUnit, + t.planStatus, + t.inspectUser, + t.lastTime, + t.nextTime, (select employeeName from auth_user where id = t.createUser) createUserName, (select employeeName from auth_user where id = t.auditUser) auditUserName, (select `name` from auth_dept where code = t.deptCode) deptName, @@ -29,7 +37,7 @@ t1.ggxh, t1.batchNo from device_inspect_plan t - left join dept_device_detail t1 on t.code = t1.code + left join dept_device_detail t1 on t.code = t1.code AND t.orderId like concat('%', #{orderId}, '%') @@ -49,6 +57,27 @@ AND t.status = #{status} + + AND t.planStatus = #{planStatus} + + + AND t.status in + + #{item,jdbcType=INTEGER} + + + + AND date_format(t.startTime, '%Y-%m-%d') between date_format(#{ksStartDate}, + '%Y-%m-%d') and date_format(#{ksEndDate}, '%Y-%m-%d') + + + AND date_format(t.endTime, '%Y-%m-%d') between date_format(#{jsStartDate}, + '%Y-%m-%d') and date_format(#{jsEndDate}, '%Y-%m-%d') + + + AND date_format(t.auditTime, '%Y-%m-%d') between date_format(#{auditStartDate}, + '%Y-%m-%d') and date_format(#{auditEndDate}, '%Y-%m-%d') + order by t.updateTime desc diff --git a/src/main/resources/mybatis/mapper/inv/DeviceInspectPlanDelectMapper.xml b/src/main/resources/mybatis/mapper/inv/DeviceInspectPlanDelectMapper.xml new file mode 100644 index 000000000..15a6555a6 --- /dev/null +++ b/src/main/resources/mybatis/mapper/inv/DeviceInspectPlanDelectMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/inv/DeviceInspectTaskDetailMapper.xml b/src/main/resources/mybatis/mapper/inv/DeviceInspectTaskDetailMapper.xml index c7e341c5f..6707f009a 100644 --- a/src/main/resources/mybatis/mapper/inv/DeviceInspectTaskDetailMapper.xml +++ b/src/main/resources/mybatis/mapper/inv/DeviceInspectTaskDetailMapper.xml @@ -1,7 +1,7 @@ - + diff --git a/src/main/resources/mybatis/mapper/inv/DeviceInspectTaskMapper.xml b/src/main/resources/mybatis/mapper/inv/DeviceInspectTaskMapper.xml index 200a32b01..ba8061422 100644 --- a/src/main/resources/mybatis/mapper/inv/DeviceInspectTaskMapper.xml +++ b/src/main/resources/mybatis/mapper/inv/DeviceInspectTaskMapper.xml @@ -1,7 +1,7 @@ - + @@ -24,4 +24,74 @@ id, orderId, planOrderIdFk, deptCode, invCode, code, `status`, inspectUser, remindTime, remark, strartTime, endTime, createTime, updateTime + + + + + + \ No newline at end of file diff --git a/src/main/resources/schemas/schema_v2.2.sql b/src/main/resources/schemas/schema_v2.2.sql index 4642ce8a3..7e5c2ecee 100644 --- a/src/main/resources/schemas/schema_v2.2.sql +++ b/src/main/resources/schemas/schema_v2.2.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS `device_inspect_task` `deptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '部门', `invCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '仓库', `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资产编码', - `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '状态', + `status` int NULL DEFAULT NULL COMMENT '状态', `inspectUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检人', `remindTime` datetime(0) NULL DEFAULT NULL COMMENT '提醒时间', `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检备注', @@ -16,6 +16,7 @@ CREATE TABLE IF NOT EXISTS `device_inspect_task` `endTime` datetime(0) NULL DEFAULT NULL COMMENT '任务结束时间', `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', `updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `expectedTime` datetime(0) NULL DEFAULT NULL COMMENT '预期结束时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 @@ -30,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `device_inspect_task_detail` `id` int NOT NULL AUTO_INCREMENT, `projectCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检项目编码', `projectContent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检内容', - `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '状态(1:未开始;2:已检查;3:异常;4:不巡检', + `status` int NULL DEFAULT NULL COMMENT '状态(1:未开始;2:已检查;3:异常;4:不巡检', `result` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检结果备注', `inspectImage` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检图片', `inspectUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检人', From 680e6b9979b1a742d5439e271ceec5210cfa0560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Tue, 8 Aug 2023 14:55:29 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/constant/DeviceStatus.java | 18 ++++++++++++++++++ .../java/com/glxp/api/constant/DeviceType.java | 10 ++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/main/java/com/glxp/api/constant/DeviceStatus.java create mode 100644 src/main/java/com/glxp/api/constant/DeviceType.java diff --git a/src/main/java/com/glxp/api/constant/DeviceStatus.java b/src/main/java/com/glxp/api/constant/DeviceStatus.java new file mode 100644 index 000000000..18f09ca48 --- /dev/null +++ b/src/main/java/com/glxp/api/constant/DeviceStatus.java @@ -0,0 +1,18 @@ +package com.glxp.api.constant; + +//设备任务状态 +public class DeviceStatus { + + public static final int DEVICE_STATUS_TEMP_SAVE = 0; //草稿 + + public static final int DEVICE_STATUS_TEMP_UNDISTRIBUTTED = 1; //未分配 + + public static final int DEVICE_STATUS_TEMP_UNINSPECTTION = 2; //未巡检 已分配 + + public static final int DEVICE_STATUS_TEMP_DURINGINSPECTTION = 3; //巡检中 + + public static final int DEVICE_STATUS_TEMP_INSPECTED = 4; //已巡检 + + + +} diff --git a/src/main/java/com/glxp/api/constant/DeviceType.java b/src/main/java/com/glxp/api/constant/DeviceType.java new file mode 100644 index 000000000..49f89c4a9 --- /dev/null +++ b/src/main/java/com/glxp/api/constant/DeviceType.java @@ -0,0 +1,10 @@ +package com.glxp.api.constant; + +public interface DeviceType { + + int TYPE_INSPECTTION = 1; //巡检 + + int TYPE_MAINTAIN = 2; //养护 + + int TYPE_REPAIR = 3; //报修 +} From 7588e50521ef2ec0d2df9c940a8082e915e35a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Tue, 8 Aug 2023 15:58:47 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DeviceInspectPlanServiceImpl.java | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanServiceImpl.java index e742c22e9..c543b46a0 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectPlanServiceImpl.java @@ -68,14 +68,6 @@ public class DeviceInspectPlanServiceImpl implements DeviceInspectPlanService { @Override public BaseResponse addDeviceInspectPlan(AddDeviceInspectPlanRequest deviceInspectPlanRequest) { - //判断启用状态下只有一条 - QueryWrapper ew = new QueryWrapper<>(); - ew.eq("code", deviceInspectPlanRequest.getCode()); - ew.eq("planStatus", 2); - Long count = deviceInspectPlanDao.selectCount(ew); - if (count > 0) { - return ResultVOUtils.error(999, "已存在该设备启用的计划!"); - } DeviceInspectPlanEntity deviceInspectPlanEntity = new DeviceInspectPlanEntity(); BeanUtil.copyProperties(deviceInspectPlanRequest, deviceInspectPlanEntity); @@ -92,17 +84,6 @@ public class DeviceInspectPlanServiceImpl implements DeviceInspectPlanService { @Override public BaseResponse updateDeviceInspectPlan(DeviceInspectPlanEntity deviceInspectPlanEntity) { - if(deviceInspectPlanEntity.getPlanStatus() == 2){ - QueryWrapper ew = new QueryWrapper<>(); - ew.eq("code", deviceInspectPlanEntity.getCode()); - ew.eq("planStatus", 2); - ew.last("limit 1"); - DeviceInspectPlanEntity deviceInspectPlanEntity1 = deviceInspectPlanDao.selectOne(ew); - if (deviceInspectPlanEntity1 != null && !deviceInspectPlanEntity1.getId().equals(deviceInspectPlanEntity.getId())) { - return ResultVOUtils.error(999, "已存在该设备启用的计划!"); - } - } - DeviceInspectPlanEntity deviceInspectPlan = deviceInspectPlanDao.selectById(deviceInspectPlanEntity.getId()); BeanUtil.copyProperties(deviceInspectPlanEntity, deviceInspectPlan, "id", "createTime", "createUser"); deviceInspectPlan.setUpdateTime(new Date()); @@ -136,10 +117,10 @@ public class DeviceInspectPlanServiceImpl implements DeviceInspectPlanService { deviceInspectPlanEntity.setAuditUser(customerService.getUserIdStr()); // //审核通过,生成任务单 // deviceInspectOrderService.addByPlanOrderId(orderId); - //生成计划主表 - DeviceInspectTaskEntity deviceInspectTaskEntity = getDeviceInspectTaskEntity(orderId,expectedTime); - //生成计划详情主表 - getDeviceInspectTaskDetailEntity(orderId, deviceInspectTaskEntity.getOrderId()); +// //生成计划主表 +// DeviceInspectTaskEntity deviceInspectTaskEntity = getDeviceInspectTaskEntity(orderId,expectedTime); +// //生成计划详情主表 +// getDeviceInspectTaskDetailEntity(orderId, deviceInspectTaskEntity.getOrderId()); } deviceInspectPlanDao.updateById(deviceInspectPlanEntity); return ResultVOUtils.success(); From 83d49b7e06a022cf28f31d0e8cfdddde2ea8bec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Tue, 8 Aug 2023 16:28:51 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/schemas/schema_v2.2.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/schemas/schema_v2.2.sql b/src/main/resources/schemas/schema_v2.2.sql index 7e5c2ecee..4ffc83b51 100644 --- a/src/main/resources/schemas/schema_v2.2.sql +++ b/src/main/resources/schemas/schema_v2.2.sql @@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS `device_inspect_task` `invCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '仓库', `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资产编码', `status` int NULL DEFAULT NULL COMMENT '状态', + `type` int NULL DEFAULT NULL COMMENT '类型', `inspectUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检人', `remindTime` datetime(0) NULL DEFAULT NULL COMMENT '提醒时间', `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '巡检备注', From ad2a95e94c897098339af69424d078135e48cfb4 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Wed, 9 Aug 2023 10:08:00 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E8=AF=8A=E6=96=AD=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E4=B8=8B=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/thrsys/ThrOrdersDlService.java | 2 +- .../thrsys/impl/ThrProductsServiceImpl.java | 13 +++++++++++-- src/main/resources/application-dev.yml | 2 +- .../mybatis/mapper/thrsys/ThrProductsDao.xml | 19 ++++++++----------- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java b/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java index a9bf3e3b2..09da17fdd 100644 --- a/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java +++ b/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java @@ -99,7 +99,7 @@ public class ThrOrdersDlService { ThrOrderEntity originEntity = thrOrderService.findByUnique(thrOrderEntity.getBillNo(), thrOrderEntity.getThirdSysFk()); if (originEntity != null) { thrOrderService.deleteById(originEntity.getId() + ""); - thrOrderDetailService.deleteByOrderIdFk(originEntity.getId() + ""); + thrOrderDetailService.deleteByOrderIdFk(originEntity.getBillNo() + ""); } thrOrderService.insertThrOrder(thrOrderEntity); List thrOrderDetailEntities = new ArrayList<>(); diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java index 317e91686..23c966a17 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java @@ -224,6 +224,7 @@ public class ThrProductsServiceImpl extends ServiceImpl= limit && !baseResponse.getData().getTotal().equals(-666)) { page++; } else { - break; + if (count == 0) { + page++; + count++; + } else + break; } } else { - return ResultVOUtils.error(500, "下载第三方系统产品信息异常"); + if (count == 0) { + page++; + count++; + } else + return ResultVOUtils.error(500, "下载第三方系统产品信息异常"); } } log.error("下载结束-------"); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 9463b3440..e043ce625 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -4,7 +4,7 @@ server: spring: datasource: driver-class-name: com.p6spy.engine.spy.P6SpyDriver - jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_zyy?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pzh?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: 123456 hikari: diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml index 2b0e09eac..e35418593 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml @@ -3,9 +3,9 @@ @@ -219,7 +219,7 @@ cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms, thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3, price, - createUser, createTime, updateUser, manufactoryCode, supCode,type) + createUser, createTime, updateUser, manufactoryCode, supCode, type) values #{item.code}, @@ -252,7 +252,7 @@ #{item.price}, #{item.createUser}, #{item.createTime}, - #{item.updateUser}, #{manufactoryCode}, #{supCode} , #{type} + #{item.updateUser}, #{manufactoryCode}, #{supCode}, #{type} @@ -330,7 +330,7 @@ price = #{price,jdbcType=VARCHAR}, manufactoryCode = #{manufactoryCode,jdbcType=VARCHAR}, supCode = #{supCode,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR} + type = #{type,jdbcType=VARCHAR} where id = #{id,jdbcType=INTEGER} @@ -338,14 +338,11 @@ - - - From 8e102c16592d3042d0d83212d1c4a7bd1ac8dcd3 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Wed, 9 Aug 2023 10:22:28 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=BF=A1=E6=81=AF=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=88=E5=9B=9E=E6=BB=9A=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/entity/thrsys/ThrProductsEntity.java | 1 + .../com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/entity/thrsys/ThrProductsEntity.java b/src/main/java/com/glxp/api/entity/thrsys/ThrProductsEntity.java index 35ff4fe61..7493bca07 100644 --- a/src/main/java/com/glxp/api/entity/thrsys/ThrProductsEntity.java +++ b/src/main/java/com/glxp/api/entity/thrsys/ThrProductsEntity.java @@ -8,6 +8,7 @@ import lombok.Data; import java.util.Date; + /** *

* diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java index 23c966a17..9fc482659 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java @@ -43,7 +43,6 @@ import java.util.List; */ @Slf4j @Service -@Transactional(rollbackFor = Exception.class) public class ThrProductsServiceImpl extends ServiceImpl implements ThrProductsService { @Resource From 1a87f29e4d9638a05dd93811c40157fb04ba5ea3 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Wed, 9 Aug 2023 11:06:00 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=20=E6=88=91=E7=9A=84=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inv/DeviceInspectTakeController.java | 35 ++++++++++++++----- .../entity/inv/DeviceInspectTaskEntity.java | 11 ++++-- .../res/inv/DeviceInspectTakeResponse.java | 1 + .../service/inv/DeviceInspectTaskService.java | 10 +++--- .../mapper/inv/DeviceInspectTaskMapper.xml | 7 ++-- 5 files changed, 44 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java b/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java index 2b73acdd3..84dc9d69f 100644 --- a/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java +++ b/src/main/java/com/glxp/api/controller/inv/DeviceInspectTakeController.java @@ -1,23 +1,17 @@ package com.glxp.api.controller.inv; -import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; -import com.glxp.api.common.req.UpdateRequest; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; -import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity; -import com.glxp.api.entity.inv.DeviceInspectPlanEntity; +import com.glxp.api.constant.Constant; import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity; import com.glxp.api.entity.inv.DeviceInspectTaskEntity; -import com.glxp.api.req.inv.AddDeviceInspectPlanRequest; -import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest; import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest; -import com.glxp.api.req.system.DeleteRequest; -import com.glxp.api.res.inv.DeviceInspectPlanResponse; import com.glxp.api.res.inv.DeviceInspectTakeResponse; -import com.glxp.api.service.inv.DeviceInspectPlanService; import com.glxp.api.service.inv.DeviceInspectTaskDetailService; import com.glxp.api.service.inv.DeviceInspectTaskService; +import com.glxp.api.util.GennerOrderUtils; +import com.glxp.api.util.OrderNoTypeBean; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -40,6 +34,8 @@ public class DeviceInspectTakeController { @Resource DeviceInspectTaskDetailService deviceInspectTaskDetailService; + @Resource + private GennerOrderUtils gennerOrderUtils; /** * 查询设设备巡检任务接口 @@ -68,6 +64,27 @@ public class DeviceInspectTakeController { return ResultVOUtils.success(); } + @PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceTake") + public BaseResponse uploadDeviceTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { + deviceInspectTaskEntity.setUpdateTime(new Date()); + boolean falg=deviceInspectTaskService.updateById(deviceInspectTaskEntity); + if(!falg){ + return ResultVOUtils.error(999,"更新失败"); + } + return ResultVOUtils.success(); + } + + + + @PostMapping("/udiwms/inv/device/inspect/take/addDeviceInspecTake") + public BaseResponse addDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { + String orderId = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_INSPECT_PLAN_ORDER, "yyyyMMdd")); + deviceInspectTaskEntity.setOrderId(orderId); + deviceInspectTaskEntity.setCreateTime(new Date()); + deviceInspectTaskService.addDeviceInspectTask(deviceInspectTaskEntity); + return ResultVOUtils.success(deviceInspectTaskEntity); + } + diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java b/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java index 95797aadf..19b83f221 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceInspectTaskEntity.java @@ -4,14 +4,15 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; @Data @TableName(value = "device_inspect_task") public class DeviceInspectTaskEntity implements Serializable { - @TableId(value = "id", type = IdType.INPUT) + @TableId(value = "id", type = IdType.AUTO) private Integer id; /** @@ -95,5 +96,9 @@ public class DeviceInspectTaskEntity implements Serializable { @TableField(value = "expectedTime") private Date expectedTime; + @TableField(value = "type") + private Integer type; + + private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/api/res/inv/DeviceInspectTakeResponse.java b/src/main/java/com/glxp/api/res/inv/DeviceInspectTakeResponse.java index 789d05d0f..3ce7a8062 100644 --- a/src/main/java/com/glxp/api/res/inv/DeviceInspectTakeResponse.java +++ b/src/main/java/com/glxp/api/res/inv/DeviceInspectTakeResponse.java @@ -108,6 +108,7 @@ public class DeviceInspectTakeResponse { private Date remindTime; private String inspectName; private Date expectedTime; + private Integer type; diff --git a/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java b/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java index 677080666..28b7e125d 100644 --- a/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java +++ b/src/main/java/com/glxp/api/service/inv/DeviceInspectTaskService.java @@ -1,14 +1,12 @@ package com.glxp.api.service.inv; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; -import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest; +import com.glxp.api.dao.inv.DeviceInspectTaskMapper; +import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest; -import com.glxp.api.res.inv.DeviceInspectPlanResponse; import com.glxp.api.res.inv.DeviceInspectTakeResponse; import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.glxp.api.dao.inv.DeviceInspectTaskMapper; -import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import javax.annotation.Resource; import java.util.Collections; @@ -40,3 +38,5 @@ public class DeviceInspectTaskService extends ServiceImpl - id, orderId, planOrderIdFk, deptCode, invCode, code, `status`, inspectUser, remindTime, + id, orderId, planOrderIdFk, deptCode, invCode, code, `status`, inspectUser, remindTime, remark, strartTime, endTime, createTime, updateTime @@ -49,7 +49,8 @@ ( SELECT `employeeName` FROM auth_user WHERE id = t.inspectUser ) inspectName, t1.deviceName, t1.ggxh, - t1.batchNo + t1.batchNo, + t.type from device_inspect_task t left join dept_device_detail t1 on t.code = t1.code @@ -94,4 +95,4 @@ - \ No newline at end of file + From cda668a04bf7fbdfcad452dde6333dee7b4985b7 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Wed, 9 Aug 2023 14:09:58 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E4=B8=8B=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/http/ErpOrderClient.java | 80 ------------------- .../service/inout/IoCheckInoutService.java | 8 ++ .../service/thrsys/ThrOrdersDlService.java | 55 ------------- 3 files changed, 8 insertions(+), 135 deletions(-) diff --git a/src/main/java/com/glxp/api/http/ErpOrderClient.java b/src/main/java/com/glxp/api/http/ErpOrderClient.java index 2d98b6321..55a522d13 100644 --- a/src/main/java/com/glxp/api/http/ErpOrderClient.java +++ b/src/main/java/com/glxp/api/http/ErpOrderClient.java @@ -61,85 +61,5 @@ public class ErpOrderClient { return null; } - public List getErpOrder(FilterThrOrderRequest filterOrderRequest) { - try { - BaseResponse> responseBaseResponse = getThrOrderResponse(filterOrderRequest); - List purchaseinResponseList = responseBaseResponse.getData().getList(); - if (purchaseinResponseList != null && purchaseinResponseList.size() > 0) { - List erpOrderEntities = new ArrayList<>(); - for (ThrOrderResponse ThrOrderResponse : purchaseinResponseList) { - for (ThrOrderResponse.SubErpOrder subPurchase : ThrOrderResponse.getSubErpOrders()) { - ThrErpOrderResponse ThrErpOrderResponse = new ThrErpOrderResponse(); - ThrErpOrderResponse.setErpOrderId(ThrOrderResponse.getBillNo()); - ThrErpOrderResponse.setCompanyid(ThrOrderResponse.getCorpId()); - ThrErpOrderResponse.setCompanyname(ThrOrderResponse.getCorpName()); - ThrErpOrderResponse.setCredate(ThrOrderResponse.getBilldate()); - ThrErpOrderResponse.setGoodsid(subPurchase.getProductId()); - ThrErpOrderResponse.setGoodsname(subPurchase.getProductName()); - ThrErpOrderResponse.setBatchNo(subPurchase.getBatchNo()); - ThrErpOrderResponse.setProductDate(subPurchase.getProductDate()); - ThrErpOrderResponse.setExpireDate(subPurchase.getExpireDate()); - ThrErpOrderResponse.setErpCount(subPurchase.getCount()); - ThrErpOrderResponse.setReCount(subPurchase.getReCount()); - ThrErpOrderResponse.setOriginType(ThrOrderResponse.getOriginType()); - ThrErpOrderResponse.setGoodsunit(subPurchase.getSpec()); - ThrErpOrderResponse.setOrderFromType(ConstantStatus.SORDER_FROM_ONLINE); - erpOrderEntities.add(ThrErpOrderResponse); - } - } - return erpOrderEntities; - } - } catch ( - Exception e) { - e.printStackTrace(); - } - return null; - } - - -// public BaseResponse submitOrder(UdiwmsOrderRequest udiwmsOrderRequest) { -// BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(udiwmsOrderRequest.getThirdSys()); -// String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/submitOrders"; -// String response = httpOkClient.uCloudPost(url, udiwmsOrderRequest); -// try { -// BaseResponse> responseBaseResponse = -// JSONObject.parseObject(response, new TypeReference>>() { -// }); -// return responseBaseResponse; -// } catch (Exception e) { -// log.error("获取订单数据异常", e); -// } -// return null; -// } - - -// public BaseResponse postBill(Map> postMap, String billAction, String uploadUrl, String thirdSysFk) { -// ERPPostBillRequest erpPostBillRequest = new ERPPostBillRequest(); -// erpPostBillRequest.setPostMap(postMap); -// erpPostBillRequest.setBillAction(billAction); -// -// //查询第三方服务授权参数 -// BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(thirdSysFk); -// String response = httpOkClient.uCloudPost(uploadUrl, erpPostBillRequest, basicThirdSysEntity); -// BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference() { -// }); -// return baseResponse; -// } -// -// public BaseResponse postBill(ERPPostBillRequest erpPostBillRequest, String uploadUrl) { -// String response = httpOkClient.uCloudPost(uploadUrl, erpPostBillRequest); -// BaseResponse baseResponse = -// JSONObject.parseObject(response, new TypeReference() { -// }); -// return baseResponse; -// } -// -// public BaseResponse signBill(USignRequest signRequest, String url) { -// String response = httpOkClient.uCloudPost(url, signRequest); -// BaseResponse baseResponse = -// JSONObject.parseObject(response, new TypeReference() { -// }); -// return baseResponse; -// } } diff --git a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java index 6262567b5..1b7d39e31 100644 --- a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java @@ -11,6 +11,7 @@ import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.basic.UdiEntity; import com.glxp.api.entity.inout.*; import com.glxp.api.entity.inv.InvPreInProductDetailEntity; +import com.glxp.api.entity.system.SystemParamConfigEntity; import com.glxp.api.res.inout.IoOrderCheckResultResponse; import com.glxp.api.res.inout.IoOrderDetailBizResponse; import com.glxp.api.res.inout.IoOrderDetailCodeResponse; @@ -18,6 +19,7 @@ import com.glxp.api.service.auth.InvWarehouseService; import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.inv.InvPreinDetailService; import com.glxp.api.service.inv.InvPreinProductDetailService; +import com.glxp.api.service.system.SystemParamConfigService; import com.glxp.api.util.CustomUtil; import com.glxp.api.util.GennerOrderUtils; import com.glxp.api.util.IntUtil; @@ -306,8 +308,14 @@ public class IoCheckInoutService { } } + SystemParamConfigService systemParamConfigService; + public String checkCode(IoCodeTempEntity codeEntity) { + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("only_vail_batch"); + +// if(systemParamConfigEntity.) + boolean isBillExit = orderDetailBizService.isExit(codeEntity.getOrderId()); if (!isBillExit) { return "请先录入业务详情"; diff --git a/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java b/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java index 09da17fdd..466133ebb 100644 --- a/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java +++ b/src/main/java/com/glxp/api/service/thrsys/ThrOrdersDlService.java @@ -352,61 +352,6 @@ public class ThrOrdersDlService { } return -1; } - - // -// public List> exportThrOrders(FilterThrOrderRequest filterThrOrderRequest) { -// BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest(); -// bussinessTypeFilterRequest.setEnabled(true); -// List bussinessTypeEntities = bussinessTypeService.filterList(bussinessTypeFilterRequest); -// BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("orderQueryUrl", filterThrOrderRequest.getThirdSysFk()); -// int page = 1; -// int limit = 100; -// List erpOrderResponseList = new ArrayList<>(); -// while (true) { -// List datas = getThrOrders(page, limit, basicThirdSysDetailEntity.getValue(), filterThrOrderRequest); -// if (datas != null && datas.size() >= limit) { -// erpOrderResponseList.addAll(datas); -// page++; -// -// } else { -// if (datas != null) { -// erpOrderResponseList.addAll(datas); -// } -// break; -// } -// } -// List> excelData = new ArrayList<>(); -// for (ErpOrderResponse erpOrderResponse : erpOrderResponseList) { -// for (ErpOrderResponse.SubErpOrder subPurchase : erpOrderResponse.getSubErpOrders()) { -// List rows = new ArrayList<>(); -// rows.add(erpOrderResponse.getBillNo()); -// rows.add(erpOrderResponse.getBilldate()); -// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByThirdId(erpOrderResponse.getCorpId(), filterThrOrderRequest.getThirdSysFk()); -//// if (basicUnitMaintainEntity != null) -//// rows.add(basicUnitMaintainEntity.getErpId()); -//// else -// rows.add(erpOrderResponse.getCorpId()); -//// rows.add(basicUnitMaintainEntity.getErpId()); -//// rows.add(erpOrderResponse.getCorpId()); -// rows.add(erpOrderResponse.getCorpName()); -// rows.add(getName(bussinessTypeEntities, erpOrderResponse.getBillType())); -//// rows.add(erpOrderResponse.getBillType()); -// rows.add(erpOrderResponse.getBillFlag()); -// rows.add(subPurchase.getProductId()); -// rows.add(subPurchase.getProductName()); -// rows.add(subPurchase.getSpec()); -// rows.add(subPurchase.getBatchNo()); -// rows.add(subPurchase.getProductDate()); -// rows.add(subPurchase.getExpireDate()); -// rows.add(subPurchase.getCount() + ""); -// rows.add(subPurchase.getReCount() + ""); -// rows.add(erpOrderResponse.getOriginType()); -// excelData.add(rows); -// } -// } -// return excelData; -// } -// public List getThrOrders(FilterThrOrderRequest filterThrOrderRequest) { ThrSystemDetailEntity thrSystemDetailEntity = thrSystemDetailService.selectByKey("orderQueryUrl", filterThrOrderRequest.getThirdSysFk()); int page = 1; From d086c63ab2a1b6c85a6f750504b473ecdfbec2a5 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Wed, 9 Aug 2023 14:38:31 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B9=EF=BC=8C=E4=B8=8D=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=97=A5=E6=9C=9F=E5=92=8C=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/dao/inout/IoOrderDetailBizDao.java | 1 + .../service/inout/IoCheckInoutService.java | 27 +++++++++++++++---- .../inout/IoOrderDetailBizService.java | 1 + .../impl/IoOrderDetailBizServiceImpl.java | 9 +++++-- .../mapper/inout/IoOrderDetailBizDao.xml | 21 +++++++++++++++ 5 files changed, 52 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java index 4d3c9acf0..1e56cf232 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java +++ b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java @@ -34,6 +34,7 @@ public interface IoOrderDetailBizDao extends BaseMapperPlus + limit 1 + + +