Showing
6 changed files
with
585 additions
and
12 deletions
| ... | ... | @@ -18,6 +18,8 @@ import com.lframework.xingyun.basedata.entity.Workshop; |
| 18 | 18 | import com.lframework.xingyun.basedata.service.workshop.WorkshopService; |
| 19 | 19 | import com.lframework.xingyun.sc.entity.*; |
| 20 | 20 | import com.lframework.xingyun.sc.enums.CustomerDevelopStatus; |
| 21 | +import com.lframework.xingyun.sc.procurement.entity.ProcurementDomesticCustomerCredit; | |
| 22 | +import com.lframework.xingyun.sc.procurement.service.credit.ProcurementDomesticCustomerCreditService; | |
| 21 | 23 | import com.lframework.xingyun.sc.service.contract.ContractDistributorLineService; |
| 22 | 24 | import com.lframework.xingyun.sc.service.contract.ContractDistributorStandardService; |
| 23 | 25 | import com.lframework.xingyun.sc.service.contract.ContractStdProcessingLineService; |
| ... | ... | @@ -143,6 +145,8 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
| 143 | 145 | private SampleResultTrackingService sampleResultTrackingService; |
| 144 | 146 | @Resource |
| 145 | 147 | private OrderDetailReportService orderDetailReportService; |
| 148 | + @Resource | |
| 149 | + private ProcurementDomesticCustomerCreditService procurementDomesticCustomerCreditService; | |
| 146 | 150 | |
| 147 | 151 | |
| 148 | 152 | |
| ... | ... | @@ -218,6 +222,9 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
| 218 | 222 | case "RESULT_TRACKING": |
| 219 | 223 | handleResultTrackingData(flowStatus, businessId); |
| 220 | 224 | break; |
| 225 | + case "CUSTOMER_CREDIT_IN": | |
| 226 | + handleResultDomesticCustomerCreditData(flowStatus, businessId); | |
| 227 | + break; | |
| 221 | 228 | default: |
| 222 | 229 | break; |
| 223 | 230 | } |
| ... | ... | @@ -973,4 +980,38 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
| 973 | 980 | vo.setCreateBy(orderDetailReport.getCreateBy()); |
| 974 | 981 | orderDetailReportService.create(vo); |
| 975 | 982 | } |
| 983 | + | |
| 984 | + //采购-内贸资信 | |
| 985 | + private void handleResultDomesticCustomerCreditData(String flowStatus, String businessId) { | |
| 986 | + Object o = redisHandler.get(businessId); | |
| 987 | + ProcurementDomesticCustomerCredit vo = null; | |
| 988 | + if (o != null) { | |
| 989 | + String jsonString = o.toString(); | |
| 990 | + // 2. 反序列化为 ProcurementDomesticCustomerCredit 对象 | |
| 991 | + vo = JsonUtil.parseObject(jsonString, ProcurementDomesticCustomerCredit.class); | |
| 992 | + } | |
| 993 | + if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus) | |
| 994 | + || FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) { | |
| 995 | + //变更通过,更新数据 | |
| 996 | + if (vo != null) { | |
| 997 | + vo.setStatus("PASS"); | |
| 998 | + vo.setFreeze(Boolean.FALSE); | |
| 999 | + procurementDomesticCustomerCreditService.updateNoFlowInstance(vo); | |
| 1000 | + //清除缓存 | |
| 1001 | + redisHandler.del(businessId); | |
| 1002 | + } else { | |
| 1003 | + //非变更审核 | |
| 1004 | + procurementDomesticCustomerCreditService.updateStatus(businessId, "PASS"); | |
| 1005 | + } | |
| 1006 | + } else if (FlowInstanceStatus.REVOKE.getCode().equals(flowStatus) | |
| 1007 | + || FlowInstanceStatus.REFUSE.getCode().equals(flowStatus) | |
| 1008 | + || FlowInstanceStatus.TERMINATION.getCode().equals(flowStatus)) { | |
| 1009 | + //变更拒绝 | |
| 1010 | + if (vo != null) { | |
| 1011 | + //清除缓存 | |
| 1012 | + redisHandler.del(businessId); | |
| 1013 | + } | |
| 1014 | + procurementDomesticCustomerCreditService.updateStatus(businessId, "REFUSE"); | |
| 1015 | + } | |
| 1016 | + } | |
| 976 | 1017 | } | ... | ... |
| 1 | 1 | package com.lframework.xingyun.sc.procurement.controller.credit; |
| 2 | 2 | |
| 3 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | |
| 3 | 4 | import com.lframework.starter.web.core.annotations.security.HasPermission; |
| 5 | +import com.lframework.starter.web.core.components.redis.RedisHandler; | |
| 4 | 6 | import com.lframework.starter.web.core.components.resp.InvokeResult; |
| 5 | 7 | import com.lframework.starter.web.core.components.resp.InvokeResultBuilder; |
| 6 | 8 | import com.lframework.starter.web.core.components.resp.PageResult; |
| 7 | 9 | import com.lframework.starter.web.core.controller.DefaultBaseController; |
| 10 | +import com.lframework.starter.web.core.utils.JsonUtil; | |
| 8 | 11 | import com.lframework.xingyun.sc.procurement.entity.ProcurementDomesticCustomerCredit; |
| 9 | 12 | import com.lframework.xingyun.sc.procurement.service.credit.ProcurementDomesticCustomerCreditService; |
| 10 | 13 | import com.lframework.xingyun.sc.procurement.vo.credit.CreateProcurementDomesticCustomerCreditVo; |
| 11 | 14 | import com.lframework.xingyun.sc.procurement.vo.credit.QueryProcurementDomesticCustomerCreditVo; |
| 15 | +import com.lframework.xingyun.sc.procurement.vo.credit.UpdateProcurementDomesticCustomerCreditVo; | |
| 12 | 16 | import io.swagger.annotations.Api; |
| 13 | 17 | import io.swagger.annotations.ApiImplicitParam; |
| 14 | 18 | import io.swagger.annotations.ApiOperation; |
| 15 | 19 | import javax.annotation.Resource; |
| 16 | 20 | import javax.validation.Valid; |
| 17 | 21 | import javax.validation.constraints.NotBlank; |
| 22 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 18 | 23 | import org.springframework.validation.annotation.Validated; |
| 19 | -import org.springframework.web.bind.annotation.GetMapping; | |
| 20 | -import org.springframework.web.bind.annotation.PostMapping; | |
| 21 | -import org.springframework.web.bind.annotation.RequestBody; | |
| 22 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 23 | -import org.springframework.web.bind.annotation.RestController; | |
| 24 | +import org.springframework.web.bind.annotation.*; | |
| 24 | 25 | |
| 25 | 26 | @Api(tags = "采购内贸资信调查表") |
| 26 | 27 | @Validated |
| ... | ... | @@ -30,6 +31,8 @@ public class ProcurementDomesticCustomerCreditController extends DefaultBaseCont |
| 30 | 31 | |
| 31 | 32 | @Resource |
| 32 | 33 | private ProcurementDomesticCustomerCreditService procurementDomesticCustomerCreditService; |
| 34 | + @Autowired | |
| 35 | + private RedisHandler redisHandler; | |
| 33 | 36 | |
| 34 | 37 | @ApiOperation("新增") |
| 35 | 38 | @HasPermission({"procure-manage:domestic-trade:add"}) |
| ... | ... | @@ -49,11 +52,64 @@ public class ProcurementDomesticCustomerCreditController extends DefaultBaseCont |
| 49 | 52 | } |
| 50 | 53 | |
| 51 | 54 | @ApiOperation("详情") |
| 52 | - @HasPermission({"procure-manage:domestic-trade:query"}) | |
| 55 | + @HasPermission({"procure-manage:domestic-trade:query","procure-manage:domestic-trade:review"}) | |
| 53 | 56 | @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) |
| 54 | 57 | @GetMapping("/get") |
| 55 | 58 | public InvokeResult<ProcurementDomesticCustomerCredit> get( |
| 56 | 59 | @NotBlank(message = "id不能为空!") String id) { |
| 57 | 60 | return InvokeResultBuilder.success(procurementDomesticCustomerCreditService.findById(id)); |
| 58 | 61 | } |
| 62 | + | |
| 63 | + /** | |
| 64 | + * 修改/变更 | |
| 65 | + */ | |
| 66 | + @ApiOperation("修改/变更") | |
| 67 | + @HasPermission({"procure-manage:domestic-trade:modify","procure-manage:domestic-trade:approve","procure-manage:domestic-trade:change"}) | |
| 68 | + @PutMapping | |
| 69 | + public InvokeResult<Void> update(@Valid @RequestBody UpdateProcurementDomesticCustomerCreditVo vo) { | |
| 70 | + | |
| 71 | + procurementDomesticCustomerCreditService.update(vo); | |
| 72 | + | |
| 73 | + return InvokeResultBuilder.success(); | |
| 74 | + } | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * 取消 | |
| 78 | + */ | |
| 79 | + @ApiOperation("取消") | |
| 80 | + @HasPermission({"procure-manage:domestic-trade:cancel"}) | |
| 81 | + @GetMapping("/cancel") | |
| 82 | + public InvokeResult<Void> cancel(@NotBlank(message = "id不能为空!") String id, | |
| 83 | + @NotBlank(message = "status不能为空!") String status) { | |
| 84 | + | |
| 85 | + procurementDomesticCustomerCreditService.updateStatus(id, status); | |
| 86 | + | |
| 87 | + return InvokeResultBuilder.success(); | |
| 88 | + } | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * 根据ID查询变更审核的数据 | |
| 92 | + */ | |
| 93 | + @ApiOperation("根据ID查询变更审核的数据") | |
| 94 | + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | |
| 95 | + @HasPermission({"procure-manage:domestic-trade:approve", "procure-manage:domestic-trade:review"}) | |
| 96 | + @GetMapping("/getExamineById") | |
| 97 | + public InvokeResult<ProcurementDomesticCustomerCredit> getExamineById(@NotBlank(message = "id不能为空!") String id) { | |
| 98 | + | |
| 99 | + Object o = redisHandler.get(id); | |
| 100 | + ProcurementDomesticCustomerCredit result = null; | |
| 101 | + if (o != null) { | |
| 102 | + String jsonString = o.toString(); | |
| 103 | + // 2. 反序列化为 ProcurementDomesticCustomerCredit 对象 | |
| 104 | + result = JsonUtil.parseObject(jsonString, ProcurementDomesticCustomerCredit.class); | |
| 105 | + return InvokeResultBuilder.success(result); | |
| 106 | + } else { | |
| 107 | + ProcurementDomesticCustomerCredit data = procurementDomesticCustomerCreditService.findById(id); | |
| 108 | + if (data == null) { | |
| 109 | + throw new DefaultClientException("客户资信表不存在!"); | |
| 110 | + } | |
| 111 | + | |
| 112 | + return InvokeResultBuilder.success(data); | |
| 113 | + } | |
| 114 | + } | |
| 59 | 115 | } | ... | ... |
| ... | ... | @@ -276,6 +276,18 @@ public class ProcurementDomesticCustomerCredit extends BaseEntity implements Bas |
| 276 | 276 | private Boolean freeze; |
| 277 | 277 | |
| 278 | 278 | /** |
| 279 | + * 是否展示审核按钮(非持久化字段) | |
| 280 | + */ | |
| 281 | + @TableField(exist = false) | |
| 282 | + private Boolean showExamine = false; | |
| 283 | + | |
| 284 | + /** | |
| 285 | + * 是否展示审核详情按钮(非持久化字段) | |
| 286 | + */ | |
| 287 | + @TableField(exist = false) | |
| 288 | + private Boolean showExamineDetail; | |
| 289 | + | |
| 290 | + /** | |
| 279 | 291 | * 创建人ID |
| 280 | 292 | */ |
| 281 | 293 | @TableField(fill = FieldFill.INSERT) | ... | ... |
| 1 | 1 | package com.lframework.xingyun.sc.procurement.impl.credit; |
| 2 | 2 | |
| 3 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
| 4 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
| 5 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
| 3 | 6 | import com.github.pagehelper.PageInfo; |
| 7 | +import com.lframework.starter.bpm.dto.FlowTaskDto; | |
| 8 | +import com.lframework.starter.bpm.entity.FlowInstanceWrapper; | |
| 9 | +import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper; | |
| 10 | +import com.lframework.starter.bpm.service.FlowInstanceWrapperService; | |
| 11 | +import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo; | |
| 4 | 12 | import com.lframework.starter.common.exceptions.impl.DefaultClientException; |
| 5 | 13 | import com.lframework.starter.common.utils.Assert; |
| 14 | +import com.lframework.starter.common.utils.ObjectUtil; | |
| 6 | 15 | import com.lframework.starter.web.core.annotations.oplog.OpLog; |
| 16 | +import com.lframework.starter.web.core.components.redis.RedisHandler; | |
| 7 | 17 | import com.lframework.starter.web.core.components.resp.PageResult; |
| 8 | 18 | import com.lframework.starter.web.core.components.security.SecurityUtil; |
| 9 | 19 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; |
| 10 | -import com.lframework.starter.web.core.utils.IdUtil; | |
| 11 | -import com.lframework.starter.web.core.utils.OpLogUtil; | |
| 12 | -import com.lframework.starter.web.core.utils.PageHelperUtil; | |
| 13 | -import com.lframework.starter.web.core.utils.PageResultUtil; | |
| 20 | +import com.lframework.starter.web.core.utils.*; | |
| 14 | 21 | import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; |
| 15 | 22 | import com.lframework.starter.web.inner.entity.SysUser; |
| 16 | 23 | import com.lframework.starter.web.inner.service.system.SysUserService; |
| 24 | +import com.lframework.xingyun.sc.entity.CustomerCredit; | |
| 17 | 25 | import com.lframework.xingyun.sc.procurement.entity.ProcurementDomesticCustomerCredit; |
| 18 | 26 | import com.lframework.xingyun.sc.procurement.mappers.credit.ProcurementDomesticCustomerCreditMapper; |
| 19 | 27 | import com.lframework.xingyun.sc.procurement.service.credit.ProcurementDomesticCustomerCreditService; |
| 20 | 28 | import com.lframework.xingyun.sc.procurement.vo.credit.CreateProcurementDomesticCustomerCreditVo; |
| 21 | 29 | import com.lframework.xingyun.sc.procurement.vo.credit.QueryProcurementDomesticCustomerCreditVo; |
| 30 | +import com.lframework.xingyun.sc.procurement.vo.credit.UpdateProcurementDomesticCustomerCreditVo; | |
| 31 | + | |
| 32 | +import java.util.ArrayList; | |
| 22 | 33 | import java.util.List; |
| 34 | +import java.util.stream.Collectors; | |
| 23 | 35 | import javax.annotation.Resource; |
| 36 | +import org.apache.commons.lang3.StringUtils; | |
| 37 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 24 | 38 | import org.springframework.stereotype.Service; |
| 25 | 39 | import org.springframework.transaction.annotation.Transactional; |
| 26 | 40 | |
| ... | ... | @@ -28,9 +42,16 @@ import org.springframework.transaction.annotation.Transactional; |
| 28 | 42 | public class ProcurementDomesticCustomerCreditServiceImpl |
| 29 | 43 | extends BaseMpServiceImpl<ProcurementDomesticCustomerCreditMapper, ProcurementDomesticCustomerCredit> |
| 30 | 44 | implements ProcurementDomesticCustomerCreditService { |
| 45 | + private static final String BPM_FLAG = "CUSTOMER_CREDIT_IN"; | |
| 31 | 46 | |
| 32 | 47 | @Resource |
| 33 | 48 | private SysUserService sysUserService; |
| 49 | + @Resource | |
| 50 | + private FlowInstanceWrapperService flowInstanceWrapperService; | |
| 51 | + @Autowired | |
| 52 | + private RedisHandler redisHandler; | |
| 53 | + @Resource | |
| 54 | + private FlowTaskWrapperMapper flowTaskWrapperMapper; | |
| 34 | 55 | |
| 35 | 56 | @Override |
| 36 | 57 | public PageResult<ProcurementDomesticCustomerCredit> query(Integer pageIndex, Integer pageSize, |
| ... | ... | @@ -40,6 +61,34 @@ public class ProcurementDomesticCustomerCreditServiceImpl |
| 40 | 61 | |
| 41 | 62 | PageHelperUtil.startPage(pageIndex, pageSize); |
| 42 | 63 | List<ProcurementDomesticCustomerCredit> datas = this.query(vo); |
| 64 | + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(datas)) { | |
| 65 | + //流程数据 | |
| 66 | + List<FlowInstanceWrapper> flowByConditionList = flowInstanceWrapperService.getFlowByBusinessIdList( | |
| 67 | + datas.stream().map(ProcurementDomesticCustomerCredit::getId).collect(Collectors.toList())); | |
| 68 | + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(flowByConditionList)) { | |
| 69 | + List<String> idList = flowByConditionList.stream().map(FlowInstanceWrapper::getBusinessId).collect(Collectors.toList()); | |
| 70 | + for (ProcurementDomesticCustomerCredit customerCredit : datas) { | |
| 71 | + if (idList.contains(customerCredit.getId())) { | |
| 72 | + customerCredit.setShowExamineDetail(true); | |
| 73 | + } else { | |
| 74 | + customerCredit.setShowExamineDetail(false); | |
| 75 | + } | |
| 76 | + } | |
| 77 | + } | |
| 78 | + // 获取当前人员的待办任务数据 | |
| 79 | + List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId()); | |
| 80 | + if (CollectionUtils.isEmpty(flowTaskList)) { | |
| 81 | + return PageResultUtil.convert(new PageInfo<>(datas)); | |
| 82 | + } | |
| 83 | + List<String> ids = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList()); | |
| 84 | + for (ProcurementDomesticCustomerCredit customerCredit : datas) { | |
| 85 | + if (ids.contains(customerCredit.getId())) { | |
| 86 | + customerCredit.setShowExamine(true); | |
| 87 | + } else { | |
| 88 | + customerCredit.setShowExamine(false); | |
| 89 | + } | |
| 90 | + } | |
| 91 | + } | |
| 43 | 92 | return PageResultUtil.convert(new PageInfo<>(datas)); |
| 44 | 93 | } |
| 45 | 94 | |
| ... | ... | @@ -50,7 +99,26 @@ public class ProcurementDomesticCustomerCreditServiceImpl |
| 50 | 99 | |
| 51 | 100 | @Override |
| 52 | 101 | public ProcurementDomesticCustomerCredit findById(String id) { |
| 53 | - return getBaseMapper().findById(id); | |
| 102 | + ProcurementDomesticCustomerCredit customerCredit = getBaseMapper().findById(id); | |
| 103 | + //流程数据 | |
| 104 | + List<String> ids = new ArrayList<>(); | |
| 105 | + ids.add(customerCredit.getId()); | |
| 106 | + List<FlowInstanceWrapper> flowByBusinessIdList = flowInstanceWrapperService.getFlowByBusinessIdList(ids); | |
| 107 | + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(flowByBusinessIdList)) { | |
| 108 | + List<String> collect = flowByBusinessIdList.stream().map(FlowInstanceWrapper::getBusinessId).collect(Collectors.toList()); | |
| 109 | + customerCredit.setShowExamineDetail(collect.contains(customerCredit.getId())); | |
| 110 | + } else { | |
| 111 | + customerCredit.setShowExamineDetail(false); | |
| 112 | + } | |
| 113 | + // 获取当前人员的待办任务数据 | |
| 114 | + List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId()); | |
| 115 | + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(flowTaskList)) { | |
| 116 | + List<String> businessIds = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList()); | |
| 117 | + customerCredit.setShowExamine(businessIds.contains(customerCredit.getId())); | |
| 118 | + } else { | |
| 119 | + customerCredit.setShowExamine(false); | |
| 120 | + } | |
| 121 | + return customerCredit; | |
| 54 | 122 | } |
| 55 | 123 | |
| 56 | 124 | @OpLog(type = OtherOpLogType.class, name = "新增采购内贸资信调查表,ID:{}", params = {"#id"}) |
| ... | ... | @@ -111,13 +179,141 @@ public class ProcurementDomesticCustomerCreditServiceImpl |
| 111 | 179 | data.setInvestigatorName(currentUser.getName()); |
| 112 | 180 | data.setPurchaseDepartment(vo.getPurchaseDepartment()); |
| 113 | 181 | data.setReviewValidUntil(vo.getReviewValidUntil()); |
| 114 | -// data.setStatus("AUDIT"); | |
| 182 | + data.setStatus("AUDIT"); | |
| 115 | 183 | data.setFreeze(Boolean.FALSE); |
| 116 | 184 | |
| 117 | 185 | getBaseMapper().insert(data); |
| 118 | 186 | |
| 187 | + //开启审核 | |
| 188 | + flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, data); | |
| 189 | + | |
| 119 | 190 | OpLogUtil.setVariable("id", data.getId()); |
| 120 | 191 | OpLogUtil.setExtra(vo); |
| 121 | 192 | return data.getId(); |
| 122 | 193 | } |
| 194 | + | |
| 195 | + @OpLog(type = OtherOpLogType.class, name = "修改采购内贸资信调查表,ID:{}", params = {"#vo.id"}) | |
| 196 | + @Transactional(rollbackFor = Exception.class) | |
| 197 | + @Override | |
| 198 | + public void update(UpdateProcurementDomesticCustomerCreditVo vo) { | |
| 199 | + if (ObjectUtil.isNull(vo.getId())) { | |
| 200 | + throw new DefaultClientException("资信ID不能为空!"); | |
| 201 | + } | |
| 202 | + | |
| 203 | + ProcurementDomesticCustomerCredit data = this.findById(vo.getId()); | |
| 204 | + if (ObjectUtil.isNull(data)) { | |
| 205 | + throw new DefaultClientException("采购内贸资信调查表不存在!"); | |
| 206 | + } | |
| 207 | + | |
| 208 | + SysUser currentUser = sysUserService.findById(vo.getInvestigatorId()); | |
| 209 | + if (currentUser == null) { | |
| 210 | + throw new DefaultClientException("资信调查人不存在!"); | |
| 211 | + } | |
| 212 | + | |
| 213 | + data.setId(vo.getId()); | |
| 214 | + data.setUnitName(vo.getUnitName()); | |
| 215 | + data.setCompanyNature(vo.getCompanyNature()); | |
| 216 | + data.setBankName(vo.getBankName()); | |
| 217 | + data.setBankAccount(vo.getBankAccount()); | |
| 218 | + data.setRegisteredCapital(vo.getRegisteredCapital()); | |
| 219 | + data.setLegalRepresentative(vo.getLegalRepresentative()); | |
| 220 | + data.setCompanyEstablishedTime(vo.getCompanyEstablishedTime()); | |
| 221 | + data.setAddress(vo.getAddress()); | |
| 222 | + data.setBusinessPrincipal(vo.getBusinessPrincipal()); | |
| 223 | + data.setBusinessPrincipalPosition(vo.getBusinessPrincipalPosition()); | |
| 224 | + data.setBusinessPrincipalPhone(vo.getBusinessPrincipalPhone()); | |
| 225 | + data.setLegalBusinessRelation(vo.getLegalBusinessRelation()); | |
| 226 | + data.setFactoryOfficeProperty(vo.getFactoryOfficeProperty()); | |
| 227 | + data.setFactoryOfficeArea(vo.getFactoryOfficeArea()); | |
| 228 | + data.setWarehouseYardProperty(vo.getWarehouseYardProperty()); | |
| 229 | + data.setWarehouseYardArea(vo.getWarehouseYardArea()); | |
| 230 | + data.setMainEquipment(vo.getMainEquipment()); | |
| 231 | + data.setNormalInventory(vo.getNormalInventory()); | |
| 232 | + data.setMainVarieties(vo.getMainVarieties()); | |
| 233 | + data.setMonthlyPurchaseVolume(vo.getMonthlyPurchaseVolume()); | |
| 234 | + data.setPurchaseSource(vo.getPurchaseSource()); | |
| 235 | + data.setStockInProductName(vo.getStockInProductName()); | |
| 236 | + data.setProductName(vo.getProductName()); | |
| 237 | + data.setCapacity(vo.getCapacity()); | |
| 238 | + data.setSalesChannel(vo.getSalesChannel()); | |
| 239 | + data.setHasPreferentialPolicy(vo.getHasPreferentialPolicy()); | |
| 240 | + data.setInvestInFutures(vo.getInvestInFutures()); | |
| 241 | + data.setHasPenaltyRecord(vo.getHasPenaltyRecord()); | |
| 242 | + data.setBusinessScopeMatch(vo.getBusinessScopeMatch()); | |
| 243 | + data.setFirstCooperationYear(vo.getFirstCooperationYear()); | |
| 244 | + data.setIsNewDevelopment(vo.getIsNewDevelopment()); | |
| 245 | + data.setOperationMode(vo.getOperationMode()); | |
| 246 | + data.setHasFailedPlanRecord(vo.getHasFailedPlanRecord()); | |
| 247 | + data.setHasPlanPerformanceIssue(vo.getHasPlanPerformanceIssue()); | |
| 248 | + data.setAccountingProcess(vo.getAccountingProcess()); | |
| 249 | + data.setInvoiceNameMatch(vo.getInvoiceNameMatch()); | |
| 250 | + data.setOutboundProcessStandard(vo.getOutboundProcessStandard()); | |
| 251 | + data.setTransportMode(vo.getTransportMode()); | |
| 252 | + data.setCommonMaterialIssue(vo.getCommonMaterialIssue()); | |
| 253 | + data.setOtherIssue(vo.getOtherIssue()); | |
| 254 | + data.setAttachmentFileIds(vo.getAttachmentFileIds()); | |
| 255 | + data.setAttachmentFileNames(vo.getAttachmentFileNames()); | |
| 256 | + data.setInvestigatorId(vo.getInvestigatorId()); | |
| 257 | + data.setInvestigatorName(currentUser.getName()); | |
| 258 | + data.setPurchaseDepartment(vo.getPurchaseDepartment()); | |
| 259 | + data.setReviewValidUntil(vo.getReviewValidUntil()); | |
| 260 | + data.setStatus("AUDIT"); | |
| 261 | + | |
| 262 | + //变更-审核通过再更新入库 | |
| 263 | + if ("CHANGE".equals(vo.getType())) { | |
| 264 | + String jsonString = JsonUtil.toJsonString(data); | |
| 265 | + //存入缓存 | |
| 266 | + redisHandler.set(data.getId(), jsonString); | |
| 267 | + } else { | |
| 268 | + //编辑-直接更新入库 | |
| 269 | + getBaseMapper().updateById(data); | |
| 270 | + } | |
| 271 | + | |
| 272 | + //开启审核 | |
| 273 | + flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, data); | |
| 274 | + | |
| 275 | + OpLogUtil.setExtra(vo); | |
| 276 | + } | |
| 277 | + | |
| 278 | + @Override | |
| 279 | + public void updateStatus(String id, String status) { | |
| 280 | + if (StringUtils.isBlank(id) || StringUtils.isBlank(status)) { | |
| 281 | + throw new DefaultClientException("资信ID、审核状态不能为空!"); | |
| 282 | + } | |
| 283 | + LambdaUpdateWrapper<ProcurementDomesticCustomerCredit> updateWrapper = Wrappers.lambdaUpdate(ProcurementDomesticCustomerCredit.class) | |
| 284 | + .set(ProcurementDomesticCustomerCredit::getStatus, status) | |
| 285 | + .eq(ProcurementDomesticCustomerCredit::getId, id); | |
| 286 | + getBaseMapper().update(updateWrapper); | |
| 287 | + } | |
| 288 | + | |
| 289 | + @Override | |
| 290 | + public void updateFreeze(List<String> ids, Boolean freeze) { | |
| 291 | + if (CollectionUtils.isEmpty(ids) || freeze == null) { | |
| 292 | + throw new DefaultClientException("资信IDs、冻结状态不能为空!"); | |
| 293 | + } | |
| 294 | + LambdaUpdateWrapper<ProcurementDomesticCustomerCredit> updateWrapper = Wrappers.lambdaUpdate(ProcurementDomesticCustomerCredit.class) | |
| 295 | + .set(ProcurementDomesticCustomerCredit::getFreeze, freeze) | |
| 296 | + .in(ProcurementDomesticCustomerCredit::getId, ids); | |
| 297 | + getBaseMapper().update(updateWrapper); | |
| 298 | + } | |
| 299 | + | |
| 300 | + @Override | |
| 301 | + public void updateNoFlowInstance(ProcurementDomesticCustomerCredit customerCredit) { | |
| 302 | + if (ObjectUtil.isNull(customerCredit.getId())) { | |
| 303 | + throw new DefaultClientException("资信ID不能为空!"); | |
| 304 | + } | |
| 305 | + | |
| 306 | + ProcurementDomesticCustomerCredit data = this.findById(customerCredit.getId()); | |
| 307 | + if (ObjectUtil.isNull(data)) { | |
| 308 | + throw new DefaultClientException("采购内贸资信调查表不存在!"); | |
| 309 | + } | |
| 310 | + | |
| 311 | + SysUser currentUser = sysUserService.findById(customerCredit.getInvestigatorId()); | |
| 312 | + if (currentUser == null) { | |
| 313 | + throw new DefaultClientException("资信调查人不存在!"); | |
| 314 | + } | |
| 315 | + | |
| 316 | + getBaseMapper().updateById(customerCredit); | |
| 317 | + OpLogUtil.setExtra(data); | |
| 318 | + } | |
| 123 | 319 | } | ... | ... |
| ... | ... | @@ -5,6 +5,7 @@ import com.lframework.starter.web.core.service.BaseMpService; |
| 5 | 5 | import com.lframework.xingyun.sc.procurement.entity.ProcurementDomesticCustomerCredit; |
| 6 | 6 | import com.lframework.xingyun.sc.procurement.vo.credit.CreateProcurementDomesticCustomerCreditVo; |
| 7 | 7 | import com.lframework.xingyun.sc.procurement.vo.credit.QueryProcurementDomesticCustomerCreditVo; |
| 8 | +import com.lframework.xingyun.sc.procurement.vo.credit.UpdateProcurementDomesticCustomerCreditVo; | |
| 8 | 9 | import java.util.List; |
| 9 | 10 | |
| 10 | 11 | public interface ProcurementDomesticCustomerCreditService extends BaseMpService<ProcurementDomesticCustomerCredit> { |
| ... | ... | @@ -43,4 +44,25 @@ public interface ProcurementDomesticCustomerCreditService extends BaseMpService< |
| 43 | 44 | * @return ID |
| 44 | 45 | */ |
| 45 | 46 | String create(CreateProcurementDomesticCustomerCreditVo vo); |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 修改 | |
| 50 | + * @param vo | |
| 51 | + */ | |
| 52 | + void update(UpdateProcurementDomesticCustomerCreditVo vo); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 更新审核状态 | |
| 56 | + */ | |
| 57 | + void updateStatus(String id, String status); | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 更新冻结状态 | |
| 61 | + */ | |
| 62 | + void updateFreeze(List<String> ids, Boolean freeze); | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 修改(不走审核) | |
| 66 | + */ | |
| 67 | + void updateNoFlowInstance(ProcurementDomesticCustomerCredit customerCredit); | |
| 46 | 68 | } | ... | ... |
| 1 | +package com.lframework.xingyun.sc.procurement.vo.credit; | |
| 2 | + | |
| 3 | +import com.lframework.starter.web.core.vo.BaseVo; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import org.hibernate.validator.constraints.Length; | |
| 7 | + | |
| 8 | +import javax.validation.constraints.Digits; | |
| 9 | +import javax.validation.constraints.NotBlank; | |
| 10 | +import javax.validation.constraints.NotNull; | |
| 11 | +import java.io.Serializable; | |
| 12 | +import java.math.BigDecimal; | |
| 13 | +import java.time.LocalDate; | |
| 14 | + | |
| 15 | +@Data | |
| 16 | +public class UpdateProcurementDomesticCustomerCreditVo implements BaseVo, Serializable { | |
| 17 | + | |
| 18 | + private static final long serialVersionUID = 1L; | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * ID | |
| 22 | + */ | |
| 23 | + @ApiModelProperty(value = "ID", required = true) | |
| 24 | + @NotBlank(message = "id不能为空!") | |
| 25 | + private String id; | |
| 26 | + | |
| 27 | + @ApiModelProperty(value = "单位名称", required = true) | |
| 28 | + @NotBlank(message = "单位名称不能为空!") | |
| 29 | + @Length(max = 200, message = "单位名称最多允许200个字符!") | |
| 30 | + private String unitName; | |
| 31 | + | |
| 32 | + @ApiModelProperty(value = "公司性质", required = true) | |
| 33 | + @NotBlank(message = "公司性质不能为空!") | |
| 34 | + @Length(max = 200, message = "公司性质最多允许200个字符!") | |
| 35 | + private String companyNature; | |
| 36 | + | |
| 37 | + @ApiModelProperty(value = "开户行", required = true) | |
| 38 | + @NotBlank(message = "开户行不能为空!") | |
| 39 | + @Length(max = 200, message = "开户行最多允许200个字符!") | |
| 40 | + private String bankName; | |
| 41 | + | |
| 42 | + @ApiModelProperty(value = "账号", required = true) | |
| 43 | + @NotBlank(message = "账号不能为空!") | |
| 44 | + @Length(max = 200, message = "账号最多允许200个字符!") | |
| 45 | + private String bankAccount; | |
| 46 | + | |
| 47 | + @ApiModelProperty(value = "注册资金(万元)", required = true) | |
| 48 | + @NotNull(message = "注册资金不能为空!") | |
| 49 | + @Digits(integer = 14, fraction = 4, message = "注册资金最多支持14位整数和4位小数!") | |
| 50 | + private BigDecimal registeredCapital; | |
| 51 | + | |
| 52 | + @ApiModelProperty(value = "法人代表", required = true) | |
| 53 | + @NotBlank(message = "法人代表不能为空!") | |
| 54 | + @Length(max = 200, message = "法人代表最多允许200个字符!") | |
| 55 | + private String legalRepresentative; | |
| 56 | + | |
| 57 | + @ApiModelProperty(value = "公司成立时间", required = true) | |
| 58 | + @NotNull(message = "公司成立时间不能为空!") | |
| 59 | + private LocalDate companyEstablishedTime; | |
| 60 | + | |
| 61 | + @ApiModelProperty(value = "地址", required = true) | |
| 62 | + @NotBlank(message = "地址不能为空!") | |
| 63 | + @Length(max = 500, message = "地址最多允许500个字符!") | |
| 64 | + private String address; | |
| 65 | + | |
| 66 | + @ApiModelProperty(value = "业务负责人", required = true) | |
| 67 | + @NotBlank(message = "业务负责人不能为空!") | |
| 68 | + @Length(max = 200, message = "业务负责人最多允许200个字符!") | |
| 69 | + private String businessPrincipal; | |
| 70 | + | |
| 71 | + @ApiModelProperty(value = "职务", required = true) | |
| 72 | + @NotBlank(message = "职务不能为空!") | |
| 73 | + @Length(max = 200, message = "职务最多允许200个字符!") | |
| 74 | + private String businessPrincipalPosition; | |
| 75 | + | |
| 76 | + @ApiModelProperty(value = "电话", required = true) | |
| 77 | + @NotBlank(message = "电话不能为空!") | |
| 78 | + @Length(max = 200, message = "电话最多允许200个字符!") | |
| 79 | + private String businessPrincipalPhone; | |
| 80 | + | |
| 81 | + @ApiModelProperty(value = "法人与业务负责人关系", required = true) | |
| 82 | + @NotBlank(message = "法人与业务负责人关系不能为空!") | |
| 83 | + @Length(max = 500, message = "法人与业务负责人关系最多允许500个字符!") | |
| 84 | + private String legalBusinessRelation; | |
| 85 | + | |
| 86 | + @ApiModelProperty(value = "生产厂房及办公楼产权", required = true) | |
| 87 | + @NotBlank(message = "生产厂房及办公楼产权不能为空!") | |
| 88 | + @Length(max = 500, message = "生产厂房及办公楼产权最多允许500个字符!") | |
| 89 | + private String factoryOfficeProperty; | |
| 90 | + | |
| 91 | + @ApiModelProperty(value = "生产厂房及办公楼面积", required = true) | |
| 92 | + @NotBlank(message = "生产厂房及办公楼面积不能为空!") | |
| 93 | + @Length(max = 500, message = "生产厂房及办公楼面积最多允许500个字符!") | |
| 94 | + private String factoryOfficeArea; | |
| 95 | + | |
| 96 | + @ApiModelProperty(value = "仓库或货场产权", required = true) | |
| 97 | + @NotBlank(message = "仓库或货场产权不能为空!") | |
| 98 | + @Length(max = 500, message = "仓库或货场产权最多允许500个字符!") | |
| 99 | + private String warehouseYardProperty; | |
| 100 | + | |
| 101 | + @ApiModelProperty(value = "仓库或货场产权面积", required = true) | |
| 102 | + @NotBlank(message = "仓库或货场产权面积不能为空!") | |
| 103 | + @Length(max = 500, message = "仓库或货场产权面积最多允许500个字符!") | |
| 104 | + private String warehouseYardArea; | |
| 105 | + | |
| 106 | + @ApiModelProperty(value = "主要生产设备", required = true) | |
| 107 | + @NotBlank(message = "主要生产设备不能为空!") | |
| 108 | + @Length(max = 65535, message = "主要生产设备内容过长!") | |
| 109 | + private String mainEquipment; | |
| 110 | + | |
| 111 | + @ApiModelProperty(value = "正常库存量", required = true) | |
| 112 | + @NotBlank(message = "正常库存量不能为空!") | |
| 113 | + @Length(max = 500, message = "正常库存量最多允许500个字符!") | |
| 114 | + private String normalInventory; | |
| 115 | + | |
| 116 | + @ApiModelProperty(value = "主要品种", required = true) | |
| 117 | + @NotBlank(message = "主要品种不能为空!") | |
| 118 | + @Length(max = 500, message = "主要品种最多允许500个字符!") | |
| 119 | + private String mainVarieties; | |
| 120 | + | |
| 121 | + @ApiModelProperty(value = "月度收购量", required = true) | |
| 122 | + @NotBlank(message = "月度收购量不能为空!") | |
| 123 | + @Length(max = 500, message = "月度收购量最多允许500个字符!") | |
| 124 | + private String monthlyPurchaseVolume; | |
| 125 | + | |
| 126 | + @ApiModelProperty(value = "收购来源", required = true) | |
| 127 | + @NotBlank(message = "收购来源不能为空!") | |
| 128 | + @Length(max = 500, message = "收购来源最多允许500个字符!") | |
| 129 | + private String purchaseSource; | |
| 130 | + | |
| 131 | + @ApiModelProperty(value = "入库品名", required = true) | |
| 132 | + @NotBlank(message = "入库品名不能为空!") | |
| 133 | + @Length(max = 500, message = "入库品名最多允许500个字符!") | |
| 134 | + private String stockInProductName; | |
| 135 | + | |
| 136 | + @ApiModelProperty(value = "产品名称", required = true) | |
| 137 | + @NotBlank(message = "产品名称不能为空!") | |
| 138 | + @Length(max = 500, message = "产品名称最多允许500个字符!") | |
| 139 | + private String productName; | |
| 140 | + | |
| 141 | + @ApiModelProperty(value = "产能", required = true) | |
| 142 | + @NotBlank(message = "产能不能为空!") | |
| 143 | + @Length(max = 500, message = "产能最多允许500个字符!") | |
| 144 | + private String capacity; | |
| 145 | + | |
| 146 | + @ApiModelProperty(value = "销售渠道", required = true) | |
| 147 | + @NotBlank(message = "销售渠道不能为空!") | |
| 148 | + @Length(max = 65535, message = "销售渠道内容过长!") | |
| 149 | + private String salesChannel; | |
| 150 | + | |
| 151 | + @ApiModelProperty(value = "是否享有优惠政策", required = true) | |
| 152 | + @NotNull(message = "是否享有优惠政策不能为空!") | |
| 153 | + private Boolean hasPreferentialPolicy; | |
| 154 | + | |
| 155 | + @ApiModelProperty(value = "是否投资期货", required = true) | |
| 156 | + @NotNull(message = "是否投资期货不能为空!") | |
| 157 | + private Boolean investInFutures; | |
| 158 | + | |
| 159 | + @ApiModelProperty(value = "是否有被处罚记录", required = true) | |
| 160 | + @NotNull(message = "是否有被处罚记录不能为空!") | |
| 161 | + private Boolean hasPenaltyRecord; | |
| 162 | + | |
| 163 | + @ApiModelProperty(value = "实际经营范围与法定经营范围是否相符", required = true) | |
| 164 | + @NotNull(message = "实际经营范围与法定经营范围是否相符不能为空!") | |
| 165 | + private Boolean businessScopeMatch; | |
| 166 | + | |
| 167 | + @ApiModelProperty("首次合作年份") | |
| 168 | + @Length(max = 4, message = "首次合作年份最多允许4个字符!") | |
| 169 | + private String firstCooperationYear; | |
| 170 | + | |
| 171 | + @ApiModelProperty(value = "是否新开发", required = true) | |
| 172 | + @NotBlank(message = "是否新开发不能为空!") | |
| 173 | + @Length(max = 20, message = "是否新开发最多允许20个字符!") | |
| 174 | + private String isNewDevelopment; | |
| 175 | + | |
| 176 | + @ApiModelProperty(value = "操作方式", required = true) | |
| 177 | + @NotBlank(message = "操作方式不能为空!") | |
| 178 | + @Length(max = 200, message = "操作方式最多允许200个字符!") | |
| 179 | + private String operationMode; | |
| 180 | + | |
| 181 | + @ApiModelProperty(value = "是否有计划落空的不良记录", required = true) | |
| 182 | + @NotNull(message = "是否有计划落空的不良记录不能为空!") | |
| 183 | + private Boolean hasFailedPlanRecord; | |
| 184 | + | |
| 185 | + @ApiModelProperty(value = "是否有计划履行不到位现象", required = true) | |
| 186 | + @NotNull(message = "是否有计划履行不到位现象不能为空!") | |
| 187 | + private Boolean hasPlanPerformanceIssue; | |
| 188 | + | |
| 189 | + @ApiModelProperty(value = "进销账务如何处理", required = true) | |
| 190 | + @NotBlank(message = "进销账务如何处理不能为空!") | |
| 191 | + @Length(max = 65535, message = "进销账务如何处理内容过长!") | |
| 192 | + private String accountingProcess; | |
| 193 | + | |
| 194 | + @ApiModelProperty(value = "开票品名与出库单品名是否一致", required = true) | |
| 195 | + @NotNull(message = "开票品名与出库单品名是否一致不能为空!") | |
| 196 | + private Boolean invoiceNameMatch; | |
| 197 | + | |
| 198 | + @ApiModelProperty(value = "出库流程是否规范", required = true) | |
| 199 | + @NotNull(message = "出库流程是否规范不能为空!") | |
| 200 | + private Boolean outboundProcessStandard; | |
| 201 | + | |
| 202 | + @ApiModelProperty(value = "运输方式", required = true) | |
| 203 | + @NotBlank(message = "运输方式不能为空!") | |
| 204 | + @Length(max = 200, message = "运输方式最多允许200个字符!") | |
| 205 | + private String transportMode; | |
| 206 | + | |
| 207 | + @ApiModelProperty("常见料质问题") | |
| 208 | + @Length(max = 65535, message = "常见料质问题内容过长!") | |
| 209 | + private String commonMaterialIssue; | |
| 210 | + | |
| 211 | + @ApiModelProperty("合作中的其它问题") | |
| 212 | + @Length(max = 65535, message = "合作中的其它问题内容过长!") | |
| 213 | + private String otherIssue; | |
| 214 | + | |
| 215 | + @ApiModelProperty("附件文件ID集合") | |
| 216 | + @Length(max = 65535, message = "附件文件ID集合内容过长!") | |
| 217 | + private String attachmentFileIds; | |
| 218 | + | |
| 219 | + @ApiModelProperty("附件文件名称集合") | |
| 220 | + @Length(max = 65535, message = "附件文件名称集合内容过长!") | |
| 221 | + private String attachmentFileNames; | |
| 222 | + | |
| 223 | + /** | |
| 224 | + * 资信调查人ID | |
| 225 | + */ | |
| 226 | + @ApiModelProperty("资信调查人ID") | |
| 227 | + @NotBlank(message = "资信调查人ID!") | |
| 228 | + @Length(max = 200, message = "资信调查人ID内容过长!") | |
| 229 | + private String investigatorId; | |
| 230 | + | |
| 231 | + @ApiModelProperty(value = "采购处", required = true) | |
| 232 | + @NotBlank(message = "采购处不能为空!") | |
| 233 | + @Length(max = 200, message = "采购处最多允许200个字符!") | |
| 234 | + private String purchaseDepartment; | |
| 235 | + | |
| 236 | + @ApiModelProperty(value = "评审有效期", required = true) | |
| 237 | + @NotNull(message = "评审有效期不能为空!") | |
| 238 | + private LocalDate reviewValidUntil; | |
| 239 | + | |
| 240 | + /** | |
| 241 | + * 操作类型:修改(UPDATE)、变更(CHANGE) | |
| 242 | + */ | |
| 243 | + @ApiModelProperty(value = "操作类型") | |
| 244 | + @NotNull(message = "操作类型不能为空!") | |
| 245 | + private String type; | |
| 246 | +} | ... | ... |