diff --git a/src/main/java/com/glxp/api/constant/ConstantStatus.java b/src/main/java/com/glxp/api/constant/ConstantStatus.java index 98dfd6aee..82f1ce3b5 100644 --- a/src/main/java/com/glxp/api/constant/ConstantStatus.java +++ b/src/main/java/com/glxp/api/constant/ConstantStatus.java @@ -308,6 +308,10 @@ public class ConstantStatus { public static final String BUS_ORDER_CGJH = "CGJH"; public static final String BUS_ORDER_CGDD = "CGDD"; + public static final String BUS_ORDER_DECPSG = "DECPSG"; + public static final String BUS_ORDER_DECGJH = "DECGJH"; + public static final String BUS_ORDER_DECGDD = "DECGDD"; + // 1:领用单据类型;2.产品申购类型;3.采购计划单据类型 4.盘点单据类型,5:采购订单 public static final int BUS_TYPE_LY = 1; diff --git a/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java b/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java index 9644692db..a0d4f4b78 100644 --- a/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java +++ b/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java @@ -17,6 +17,7 @@ import com.glxp.api.entity.inout.PurReceiveEntity; import com.glxp.api.entity.purchase.*; import com.glxp.api.service.basic.IBasicBusTypeChangeService; import com.glxp.api.service.basic.IBasicBussinessTypeService; +import com.glxp.api.service.basic.SysApprovalFlowService; import com.glxp.api.service.inout.IoOrderDetailBizService; import com.glxp.api.service.inout.IoOrderService; import com.glxp.api.service.inout.impl.ReceiveDetailService; @@ -26,6 +27,7 @@ import com.glxp.api.service.purchase.impl.PurApplyDetailService; import com.glxp.api.service.purchase.impl.PurApplyService; import com.glxp.api.service.purchase.impl.PurOrderDetailService; import com.glxp.api.service.purchase.impl.PurPlanDetailService; +import com.glxp.api.service.system.SystemParamConfigService; import com.glxp.api.util.*; import org.springframework.stereotype.Service; @@ -64,6 +66,11 @@ public class IoPurChangeService { @Resource IoOrderService ioOrderService; + + @Resource + SysApprovalFlowService sysApprovalFlowService; + @Resource + SystemParamConfigService systemParamConfigService; @Resource IoOrderDetailBizService ioOrderDetailBizService; @Resource @@ -89,11 +96,28 @@ public class IoPurChangeService { PurPlanEntity purPlanEntity = new PurPlanEntity(); List purPlanDetailEntityList = new ArrayList<>(); if (purApplyEntity.getStatus() == 3) { - basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(ConstantStatus.BUS_ORDER_CPSG); + Integer pageType = purApplyEntity.getPageType(); + if (pageType==2){ + basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(ConstantStatus.BUS_ORDER_DECPSG); + }else { + basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(ConstantStatus.BUS_ORDER_CPSG); + } if (basicBusTypeChangeEntity != null && StrUtil.isNotEmpty(basicBusTypeChangeEntity.getTargetBusAction()) && basicBusTypeChangeEntity.isEnable() == true) { purPlanEntity.setBillNo(gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.JH_ORDER, "yyyyMMdd"))); purPlanEntity.setBillDate(purApplyEntity.getBillDate()); purPlanEntity.setStatus(basicBusTypeChangeEntity.getBusAuditStatus()); + Integer busAuditStatus = basicBusTypeChangeEntity.getBusAuditStatus(); + boolean sys_approval_flow = "1".equals(systemParamConfigService.selectValueByParamKey("sys_approval_flow")); + if (busAuditStatus == 2 && sys_approval_flow){//提交审核 + String approvalFlowId = sysApprovalFlowService.getApprovalFlowId(); + purPlanEntity.setApprovalFlowId(approvalFlowId); + sysApprovalFlowService.generateFlow(approvalFlowId,purPlanEntity.getBillNo(),"cgjh"); + } + if (busAuditStatus == 3 && sys_approval_flow){//提交审核 + String approvalFlowId = sysApprovalFlowService.getApprovalFlowId(); + purPlanEntity.setApprovalFlowId(approvalFlowId); + sysApprovalFlowService.generateFlowTG(approvalFlowId,purPlanEntity.getBillNo(),"cgjh"); + } purPlanEntity.setRemark(purApplyEntity.getRemark()); purPlanEntity.setEmergency(purApplyEntity.getEmergency()); purPlanEntity.setArrivalTime(purApplyEntity.getArrivalTime()); @@ -106,6 +130,7 @@ public class IoPurChangeService { purPlanEntity.setApplyInv(purApplyEntity.getInvCode()); purPlanEntity.setApplyBillNo(purApplyEntity.getBillNo()); purPlanEntity.setApplyRemark(purApplyEntity.getRemark()); + purPlanEntity.setPageType(purApplyEntity.getPageType()); if (basicBusTypeChangeEntity.getBusBeforeTime() != null) { purPlanEntity.setCreateTime(MsDateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime())); purPlanEntity.setUpdateTime(MsDateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime())); @@ -170,7 +195,12 @@ public class IoPurChangeService { //根据供应商分组 Map> purPlanDetailMap = purPlanDetailEntityList1.stream().collect(Collectors.groupingBy(PurPlanDetailEntity::getSupId)); purPlanDetailMap.put("not", purPlanDetailEntityList2); - basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(ConstantStatus.BUS_ORDER_CGJH); + Integer pageType = purPlanEntity.getPageType(); + if (pageType==2){ + basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(ConstantStatus.BUS_ORDER_DECGJH); + }else { + basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(ConstantStatus.BUS_ORDER_CGJH); + } if (basicBusTypeChangeEntity != null && StrUtil.isNotEmpty(basicBusTypeChangeEntity.getTargetBusAction()) && basicBusTypeChangeEntity.isEnable() == true) { for (String key : purPlanDetailMap.keySet()) { PurOrderEntity purOrderEntity = new PurOrderEntity(); @@ -184,6 +214,18 @@ public class IoPurChangeService { purOrderEntity.setSupId(key); } purOrderEntity.setStatus(basicBusTypeChangeEntity.getBusAuditStatus()); + Integer busAuditStatus = basicBusTypeChangeEntity.getBusAuditStatus(); + boolean sys_approval_flow = "1".equals(systemParamConfigService.selectValueByParamKey("sys_approval_flow")); + if (busAuditStatus == 2 && sys_approval_flow){//提交审核 + String approvalFlowId = sysApprovalFlowService.getApprovalFlowId(); + purOrderEntity.setApprovalFlowId(approvalFlowId); + sysApprovalFlowService.generateFlow(approvalFlowId,purOrderEntity.getBillNo(),"cgdd"); + } + if (busAuditStatus == 3 && sys_approval_flow){//提交审核 + String approvalFlowId = sysApprovalFlowService.getApprovalFlowId(); + purOrderEntity.setApprovalFlowId(approvalFlowId); + sysApprovalFlowService.generateFlowTG(approvalFlowId,purOrderEntity.getBillNo(),"cgdd"); + } purOrderEntity.setRemark(purPlanEntity.getRemark()); purOrderEntity.setEmergency(purPlanEntity.getEmergency()); purOrderEntity.setArrivalTime(purPlanEntity.getArrivalTime()); @@ -197,6 +239,7 @@ public class IoPurChangeService { purOrderEntity.setUpdateUser(purPlanEntity.getAuditUser()); purOrderEntity.setBillType(ConstantStatus.BUS_ORDER_CGDD); purOrderEntity.setPurPlanId(purPlanEntity.getBillNo()); + purOrderEntity.setPageType(purPlanEntity.getPageType()); if (basicBusTypeChangeEntity.getBusBeforeTime() != null) { purOrderEntity.setCreateTime(MsDateUtil.timeProcess(new Date(), basicBusTypeChangeEntity.getBusBeforeTime())); purOrderEntity.setUpdateTime(new Date()); @@ -552,4 +595,15 @@ public class IoPurChangeService { } } + public PurReceiveEntity getPurReceiveEntityByApprovalFlowId(String approvalFlowId) { + return receiveService.getPurReceiveEntityByApprovalFlowId(approvalFlowId); + } + + public PurApplyEntity getPurApplyEntityByApprovalFlowId(String approvalFlowId) { + return purApplyService.getPurApplyEntityByApprovalFlowId(approvalFlowId); + } + + public PurPlanEntity getPurPlanEntityByApprovalFlowId(String approvalFlowId) { + return purPlanService.getPurPlanEntityByApprovalFlowId(approvalFlowId); + } } diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java index df3f269c7..91711dd15 100644 --- a/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java +++ b/src/main/java/com/glxp/api/entity/dev/DeviceRepairApplyDetailEntity.java @@ -220,4 +220,10 @@ public class DeviceRepairApplyDetailEntity { */ @TableField(value = "livePath") private String livePath; + + /** + * 诊断图片 + */ + @TableField(value = "diagnosisLivePath") + private String diagnosisLivePath; } diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java index c7d4a3552..325904a56 100644 --- a/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java +++ b/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java @@ -271,6 +271,11 @@ public class DeviceRepairEntity { @TableField(value = "livePath") private String livePath; + /** + * 诊断图片 + */ + @TableField(value = "diagnosisLivePath") + private String diagnosisLivePath; /** * 维修后现场图片 diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyAddParam.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyAddParam.java index 69654aa5f..05dd6b1eb 100644 --- a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyAddParam.java +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyAddParam.java @@ -96,7 +96,7 @@ public class DeviceRepairApplyAddParam { public List getDetailEntityList(Long applyId, DeviceInfoService deviceInfoService, AuthAdmin user) { List enums = new ArrayList<>(); enums.add( DeviceStatusEnum.NORMAL); - List list = deviceInfoService.listVoByCodes(details.stream().map(ApplyDetail::getDeviceCode).collect(Collectors.toList()), user.getLocDeptCode(), enums); + List list = deviceInfoService.listVoByCodes(details.stream().map(ApplyDetail::getDeviceCode).collect(Collectors.toList()), null, enums); if (list.size() != details.size()) { throw new JsonException("设备状态异常或信息不符,请确认"); } diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java index e7928a228..e8893edd3 100644 --- a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java @@ -22,6 +22,8 @@ public class DeviceRepairApplyDetailDiagnosisParam { @NotBlank(message = "诊断信息不能为空") String diagnosisInfo; + String diagnosisLivePath; + Boolean innerFlag; String repairUserName; diff --git a/src/main/java/com/glxp/api/res/purchase/PurApplyResponse.java b/src/main/java/com/glxp/api/res/purchase/PurApplyResponse.java index bb9dfb93a..7ef0c94a3 100644 --- a/src/main/java/com/glxp/api/res/purchase/PurApplyResponse.java +++ b/src/main/java/com/glxp/api/res/purchase/PurApplyResponse.java @@ -95,6 +95,6 @@ public class PurApplyResponse { private String flowAuditByName; private String approvalFlowId; - + private Integer pageType; } diff --git a/src/main/java/com/glxp/api/res/purchase/PurOrderResponse.java b/src/main/java/com/glxp/api/res/purchase/PurOrderResponse.java index 253572dd2..9c987860b 100644 --- a/src/main/java/com/glxp/api/res/purchase/PurOrderResponse.java +++ b/src/main/java/com/glxp/api/res/purchase/PurOrderResponse.java @@ -91,4 +91,6 @@ public class PurOrderResponse { private String flowAuditByName; private String approvalFlowId; + + private Integer pageType; } diff --git a/src/main/java/com/glxp/api/res/purchase/PurPlanResponse.java b/src/main/java/com/glxp/api/res/purchase/PurPlanResponse.java index 19368ecc0..83239aa53 100644 --- a/src/main/java/com/glxp/api/res/purchase/PurPlanResponse.java +++ b/src/main/java/com/glxp/api/res/purchase/PurPlanResponse.java @@ -96,4 +96,6 @@ public class PurPlanResponse { */ @TableField(value = "importStatus") private Integer importStatus; + + private Integer pageType; } diff --git a/src/main/java/com/glxp/api/service/basic/SysApprovalFlowService.java b/src/main/java/com/glxp/api/service/basic/SysApprovalFlowService.java index f22c4abee..6fe742615 100644 --- a/src/main/java/com/glxp/api/service/basic/SysApprovalFlowService.java +++ b/src/main/java/com/glxp/api/service/basic/SysApprovalFlowService.java @@ -20,4 +20,6 @@ public interface SysApprovalFlowService extends IService { SysApprovalFlow getApprovalFlowByMxId(String approvalFlowMxId); boolean nodePermissions(String id); + + void generateFlowTG(String approvalFlowId, String billNo, String cgjh); } diff --git a/src/main/java/com/glxp/api/service/basic/impl/SysApprovalFlowServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/SysApprovalFlowServiceImpl.java index bb281c673..8842a29a2 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/SysApprovalFlowServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/SysApprovalFlowServiceImpl.java @@ -5,12 +5,16 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.api.controller.purchase.IoPurChangeService; import com.glxp.api.dao.basic.SysApprovalFlowMapper; import com.glxp.api.dao.basic.SysApprovalFlowMxMapper; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.basic.SysApprovalFlow; import com.glxp.api.entity.basic.SysApprovalFlowConfigMx; import com.glxp.api.entity.basic.SysApprovalFlowMx; +import com.glxp.api.entity.inout.PurReceiveEntity; +import com.glxp.api.entity.purchase.PurApplyEntity; +import com.glxp.api.entity.purchase.PurPlanEntity; import com.glxp.api.enums.ApprovalFlowEnum; import com.glxp.api.enums.ApprovalStatusEnum; import com.glxp.api.exception.JsonException; @@ -38,6 +42,8 @@ public class SysApprovalFlowServiceImpl extends ServiceImpl qw = new QueryWrapper<>(); @@ -225,6 +252,24 @@ public class SysApprovalFlowServiceImpl extends ServiceImpl { } + public PurReceiveEntity getPurReceiveEntityByApprovalFlowId(String approvalFlowId) { + return receiveDao.selectOne(new QueryWrapper().eq("approvalFlowId", approvalFlowId).last("limit 1")); + } } diff --git a/src/main/java/com/glxp/api/service/purchase/PurPlanService.java b/src/main/java/com/glxp/api/service/purchase/PurPlanService.java index ffb5afc27..ce82211de 100644 --- a/src/main/java/com/glxp/api/service/purchase/PurPlanService.java +++ b/src/main/java/com/glxp/api/service/purchase/PurPlanService.java @@ -24,4 +24,5 @@ public interface PurPlanService { PurPlanEntity selectByBillNo(String billNo); + PurPlanEntity getPurPlanEntityByApprovalFlowId(String approvalFlowId); } diff --git a/src/main/java/com/glxp/api/service/purchase/impl/PurApplyService.java b/src/main/java/com/glxp/api/service/purchase/impl/PurApplyService.java index 600b5426b..e016d6969 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/PurApplyService.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/PurApplyService.java @@ -59,4 +59,8 @@ public class PurApplyService extends ServiceImpl { public Boolean deleteById(long id) { return purApplyDao.deleteById(id); } + + public PurApplyEntity getPurApplyEntityByApprovalFlowId(String approvalFlowId) { + return purApplyDao.selectOne(new QueryWrapper().eq("approvalFlowId", approvalFlowId).last("limit 1")); + } } diff --git a/src/main/java/com/glxp/api/service/purchase/impl/PurPlanServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/PurPlanServiceImpl.java index 2de5353b5..8c0ee272b 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/PurPlanServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/PurPlanServiceImpl.java @@ -63,4 +63,9 @@ public class PurPlanServiceImpl implements PurPlanService { public PurPlanEntity selectByBillNo(String billNo) { return purPlanDao.selectOne(new QueryWrapper().eq("billNo", billNo).last("limit 1")); } + + @Override + public PurPlanEntity getPurPlanEntityByApprovalFlowId(String approvalFlowId) { + return purPlanDao.selectOne(new QueryWrapper().eq("approvalFlowId", approvalFlowId).last("limit 1")); + } } diff --git a/src/main/resources/schemas/schema_v2.4.sql b/src/main/resources/schemas/schema_v2.4.sql index db898d4fe..a0effe7c2 100644 --- a/src/main/resources/schemas/schema_v2.4.sql +++ b/src/main/resources/schemas/schema_v2.4.sql @@ -3379,3 +3379,13 @@ CALL Pro_Temp_ColumnWork('device_repair', 'livePath', CALL Pro_Temp_ColumnWork('device_repair', 'serviceLivePath', 'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修后现场照片''', 1); +CALL Pro_Temp_ColumnWork('device_repair', 'diagnosisLivePath', + 'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''诊断照片''', + 1); +CALL Pro_Temp_ColumnWork('device_repair_apply_detail', 'diagnosisLivePath', + 'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''诊断照片''', + 1); + +INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`, `createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`, `busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`) VALUES (1724370174626394116, 'DECPSG', '设备产品申购', NULL, 2, 1, NULL, '1', NULL, '2023-11-14 18:14:44', NULL, 2, 3, 'DECGJH', NULL, NULL); +INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`, `createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`, `busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`) VALUES (1724370174626394117, 'DECGJH', '设备采购计划', NULL, 3, 1, NULL, '1', NULL, '2023-11-14 18:14:34', NULL, 2, 1, 'DECGDD', NULL, NULL); +INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`, `createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`, `busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`) VALUES (1724370174626394118, 'DECGDD', '设备采购订单', NULL, 5, 1, NULL, '1', NULL, '2023-11-14 18:14:22', NULL, 2, 2, NULL, NULL, NULL);