瀏覽代碼

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractServiceImpl.java
caozj 1 年之前
父節點
當前提交
a2762b33d1

+ 86 - 14
hx-account/src/main/java/com/fjhx/account/flow/AccountRequestFundsFlow.java

@@ -14,15 +14,21 @@ import com.fjhx.account.service.account.AccountPaymentService;
 import com.fjhx.account.service.account.AccountRequestFundsDetailService;
 import com.fjhx.account.service.account.AccountRequestFundsService;
 import com.fjhx.common.constant.SourceConstant;
+import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.utils.Assert;
 import com.fjhx.file.utils.ObsFileUtil;
 import com.fjhx.flow.core.FlowDelegate;
+import com.fjhx.flow.core.FlowThreadLocalUtil;
 import com.fjhx.flow.enums.FlowStatusEnum;
+import com.fjhx.flow.enums.HandleTypeEnum;
+import com.ruoyi.common.core.domain.BasePo;
 import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -59,23 +65,30 @@ public class AccountRequestFundsFlow extends FlowDelegate {
      */
     @Override
     public Long start(Long flowId, JSONObject submitData) {
+//
+//        // 获取提交数据
+//        AccountRequestFundsDto accountRequestFundsDto = submitData.toJavaObject(AccountRequestFundsDto.class);
+//
+//        // 添加请款表的信息
+//        accountRequestFundsDto.setStatus(AccountRequestFundsStatusEnum.UNDER_REVIEW.getKey());
+//        accountRequestFundsService.save(accountRequestFundsDto);
+//
+//        // 添加请款详情表的信息
+//        List<AccountRequestFundsDetail> accountRequestFundsDetailList = accountRequestFundsDto.getAccountRequestFundsDetailList();
+//        if (CollectionUtils.isNotEmpty(accountRequestFundsDetailList)) {
+//            accountRequestFundsDetailList.forEach(item -> item.setAccountRequestFundsId(accountRequestFundsDto.getId()));
+//            accountRequestFundsDetailService.saveBatch(accountRequestFundsDetailList);
+//        }
+//
+//        // 添加附件信息
+//        ObsFileUtil.saveFile(accountRequestFundsDto.getFileList(), accountRequestFundsDto.getId());
+//
+//        return accountRequestFundsDto.getId();
 
         // 获取提交数据
         AccountRequestFundsDto accountRequestFundsDto = submitData.toJavaObject(AccountRequestFundsDto.class);
 
-        // 添加请款表的信息
-        accountRequestFundsDto.setStatus(AccountRequestFundsStatusEnum.UNDER_REVIEW.getKey());
-        accountRequestFundsService.save(accountRequestFundsDto);
-
-        // 添加请款详情表的信息
-        List<AccountRequestFundsDetail> accountRequestFundsDetailList = accountRequestFundsDto.getAccountRequestFundsDetailList();
-        if (CollectionUtils.isNotEmpty(accountRequestFundsDetailList)) {
-            accountRequestFundsDetailList.forEach(item -> item.setAccountRequestFundsId(accountRequestFundsDto.getId()));
-            accountRequestFundsDetailService.saveBatch(accountRequestFundsDetailList);
-        }
-
-        // 添加附件信息
-        ObsFileUtil.saveFile(accountRequestFundsDto.getFileList(), accountRequestFundsDto.getId());
+        accountRequestFundsDto = commStart(accountRequestFundsDto, 0);
 
         return accountRequestFundsDto.getId();
     }
@@ -117,7 +130,19 @@ public class AccountRequestFundsFlow extends FlowDelegate {
 
     @Override
     public void defaultMethod(Long flowId, Long businessId, FlowStatusEnum flowStatusEnum, JSONObject submitData) {
-
+        //重新发起
+        if (FlowStatusEnum.READY_START.equals(flowStatusEnum)) {
+           reStart();
+        }
+        //驳回
+        if (FlowStatusEnum.REJECT.equals(flowStatusEnum)) {
+            accountRequestFundsService.update(q -> q
+                    .eq(AccountRequestFunds::getId, businessId)
+                    .set(AccountRequestFunds::getStatus, FlowStatusEnum1.REJECT.getKey())//20为驳回
+                    .set(BasePo::getUpdateTime, new Date())
+                    .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+            );
+        }
     }
 
     /**
@@ -157,4 +182,51 @@ public class AccountRequestFundsFlow extends FlowDelegate {
         accountPaymentService.save(accountPayment);
     }
 
+
+    /**
+     * 开始公共代码抽取
+     *
+     * @param opType 操作类型 0直接发起 1重新发起
+     */
+    private AccountRequestFundsDto commStart(AccountRequestFundsDto accountRequestFundsDto, Integer opType) {
+        if (opType == 1) {
+            Assert.notEmpty(accountRequestFundsDto.getId(), "请款id不能为空");
+        }
+
+        // 添加请款表的信息
+        accountRequestFundsDto.setStatus(AccountRequestFundsStatusEnum.UNDER_REVIEW.getKey());
+        accountRequestFundsService.saveOrUpdate(accountRequestFundsDto);
+
+        // 添加请款详情表的信息
+        List<AccountRequestFundsDetail> accountRequestFundsDetailList = accountRequestFundsDto.getAccountRequestFundsDetailList();
+        if (CollectionUtils.isNotEmpty(accountRequestFundsDetailList)) {
+            if (opType == 1) {
+                //先删除被删除的产品
+                accountRequestFundsDetailService.editLinked(accountRequestFundsDetailList, AccountRequestFundsDetail::getContractId, accountRequestFundsDto.getId());
+            }
+
+            accountRequestFundsDetailList.forEach(item -> item.setAccountRequestFundsId(accountRequestFundsDto.getId()));
+            accountRequestFundsDetailService.saveOrUpdateBatch(accountRequestFundsDetailList);
+        }
+
+        if (opType == 1) {
+            // 编辑附件信息
+            ObsFileUtil.editFile(accountRequestFundsDto.getFileList(), accountRequestFundsDto.getId());
+        } else {
+            // 添加附件信息
+            ObsFileUtil.saveFile(accountRequestFundsDto.getFileList(), accountRequestFundsDto.getId());
+        }
+        return accountRequestFundsDto;
+    }
+
+    /**
+     * 重新发起
+     */
+    public void reStart() {
+            JSONObject submitData = FlowThreadLocalUtil.getCurrentData();
+            // 获取提交数据
+            AccountRequestFundsDto accountRequestFundsDto = submitData.toJavaObject(AccountRequestFundsDto.class);
+            commStart(accountRequestFundsDto, 1);
+    }
+
 }

+ 2 - 2
hx-common/src/main/java/com/fjhx/common/enums/FlowStatusEnum.java → hx-common/src/main/java/com/fjhx/common/enums/FlowStatusEnum1.java

@@ -11,7 +11,7 @@ import java.util.Map;
  */
 @Getter
 @AllArgsConstructor
-public enum FlowStatusEnum {
+public enum FlowStatusEnum1 {
 
     DRAFT(0, "草稿"),
     UNDER_REVIEW(10, "审批中"),
@@ -25,7 +25,7 @@ public enum FlowStatusEnum {
     private static final Map<Integer, String> map = new LinkedHashMap<>();
 
     static {
-        for (FlowStatusEnum ms : values()) {
+        for (FlowStatusEnum1 ms : values()) {
             map.put(ms.key, ms.value);
         }
     }

+ 2 - 1
hx-common/src/main/java/com/fjhx/common/service/documentary/impl/DocumentaryRecordServiceImpl.java

@@ -87,7 +87,8 @@ public class DocumentaryRecordServiceImpl extends ServiceImpl<DocumentaryRecordM
                     if (noRecordDocumentaryId != null) {
                         // 排除业务id
                         excludeBusinessId = listObject(DocumentaryRecord::getBusinessId,
-                                q -> q.eq(DocumentaryRecord::getDocumentaryId, noRecordDocumentaryId));
+                                q -> q.eq(DocumentaryRecord::getDocumentaryId, noRecordDocumentaryId)
+                                        .isNotNull(DocumentaryRecord::getBusinessId));
                     }
 
                     Page<? extends DocumentaryData> page = bean.getDocumentaryPage(dto.getCondition(), dto, excludeBusinessId);

+ 7 - 6
hx-sale/src/main/java/com/fjhx/sale/flow/ContractFlow.java

@@ -6,9 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.fjhx.area.utils.CustomizeAreaUtil;
 import com.fjhx.common.enums.CodingRuleEnum;
-import com.fjhx.common.enums.FlowStatusEnum;
+import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.service.coding.CodingRuleService;
-import com.fjhx.common.utils.ExchangeRateUtil;
 import com.fjhx.file.utils.ObsFileUtil;
 import com.fjhx.flow.core.FlowDelegate;
 import com.fjhx.sale.entity.contract.dto.ContractDto;
@@ -20,6 +19,7 @@ import com.fjhx.sale.service.contract.ContractProductService;
 import com.fjhx.sale.service.contract.ContractProjectService;
 import com.fjhx.sale.service.contract.ContractService;
 import com.fjhx.sale.service.contract.ContractShipmentService;
+import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -103,7 +103,7 @@ public class ContractFlow extends FlowDelegate {
         }
 
         // 修改采购状态为审批通过
-        contract.setStatus(FlowStatusEnum.PASS.getKey());
+        contract.setStatus(FlowStatusEnum1.PASS.getKey());
         contract.setApprovedDate(new Date());
         contractService.updateById(contract);
     }
@@ -121,8 +121,9 @@ public class ContractFlow extends FlowDelegate {
         CustomizeAreaUtil.setAreaId(contract);
 
         contract.setId(contractId);
-        contract.setUserName(SecurityUtils.getUsername());
-        contract.setStatus(FlowStatusEnum.UNDER_REVIEW.getKey());
+        SysUser loginUser = SecurityUtils.getLoginUser().getUser();
+        contract.setUserName(loginUser.getNickName());
+        contract.setStatus(FlowStatusEnum1.UNDER_REVIEW.getKey());
         contract.setBuyCityId(contract.getCityId());
         contract.setBuyCountryId(contract.getCountryId());
         contract.setBuyProvinceId(contract.getProvinceId());
@@ -135,7 +136,7 @@ public class ContractFlow extends FlowDelegate {
             for (ContractProduct c : contractProductList) {
                 c.setId(IdWorker.getId());
                 c.setContractId(contractId);
-                ObsFileUtil.saveFile(c.getFileList(), c.getId());
+//                ObsFileUtil.saveFile(c.getFileList(), c.getId());
             }
             contractProductService.saveBatch(contractProductList);
         }

+ 2 - 2
hx-sale/src/main/java/com/fjhx/sale/flow/ContractUpdateFlow.java

@@ -3,7 +3,7 @@ package com.fjhx.sale.flow;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.fjhx.common.enums.FlowStatusEnum;
+import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.utils.Assert;
 import com.fjhx.flow.core.FlowDelegate;
 import com.fjhx.sale.entity.contract.dto.ContractDto;
@@ -126,7 +126,7 @@ public class ContractUpdateFlow extends FlowDelegate {
         if (oldContract == null) {
             throw new ServiceException("原合同不存在");
         }
-        oldContract.setStatus(FlowStatusEnum.UPDATE.getKey());
+        oldContract.setStatus(FlowStatusEnum1.UPDATE.getKey());
         oldContract.setIsChange("1");
         contractService.updateById(oldContract);
     }

+ 3 - 3
hx-sale/src/main/java/com/fjhx/sale/flow/SampleFlow.java

@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.fjhx.area.utils.CustomizeAreaUtil;
 import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.common.enums.CodingRuleEnum;
-import com.fjhx.common.enums.FlowStatusEnum;
+import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.file.utils.ObsFileUtil;
 import com.fjhx.flow.core.FlowDelegate;
@@ -73,7 +73,7 @@ public class SampleFlow extends FlowDelegate {
         sample.setBuyProvinceId(sample.getProvinceId());
 //        sample.setCode(CodeEnum.SAMPLE_CODE.getCode());
         sample.setCode(codingRuleService.createCode(CodingRuleEnum.SAMPLE.getKey(),sample.getBuyCorporationId()));
-        sample.setStatus(FlowStatusEnum.UNDER_REVIEW.getKey());
+        sample.setStatus(FlowStatusEnum1.UNDER_REVIEW.getKey());
         sample.setUserName(SecurityUtils.getUsername());
 
         sampleService.save(sample);
@@ -124,7 +124,7 @@ public class SampleFlow extends FlowDelegate {
             throw new ServiceException("样品单不存在");
         }
         //修改样品单状态为审批通过
-        sample.setStatus(FlowStatusEnum.PASS.getKey());
+        sample.setStatus(FlowStatusEnum1.PASS.getKey());
         sample.setApprovedDate(new Date());
         sampleService.updateById(sample);
     }

+ 2 - 2
hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractProductServiceImpl.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.common.entity.contract.po.ContractTemplate;
-import com.fjhx.common.enums.FlowStatusEnum;
+import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.service.contract.ContractTemplateService;
 import com.fjhx.common.service.corporation.CorporationService;
 import com.fjhx.customer.service.customer.CustomerService;
@@ -91,7 +91,7 @@ public class ContractProductServiceImpl extends ServiceImpl<ContractProductMappe
         IWrapper<ContractProduct> wrapper = getWrapper();
         wrapper.orderByDesc("t1", ContractProduct::getCreateTime);
         wrapper.ne("t1", ContractProduct::getExpendQuantity, 0);
-        wrapper.between("t2", Contract::getStatus, FlowStatusEnum.PASS.getKey(), FlowStatusEnum.CANCELLATION.getKey() - 1);
+        wrapper.between("t2", Contract::getStatus, FlowStatusEnum1.PASS.getKey(), FlowStatusEnum1.CANCELLATION.getKey() - 1);
         if (ObjectUtil.isNotEmpty(dto.getDataType()) && dto.getDataType() == 0) {//合同交接单
             wrapper.ne("t1", ContractProduct::getExpendQuantity, BigDecimal.ZERO);
         }

+ 11 - 8
hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractServiceImpl.java

@@ -28,7 +28,7 @@ import com.fjhx.common.entity.contract.po.ContractTemplate;
 import com.fjhx.common.entity.corporation.po.Corporation;
 import com.fjhx.common.entity.currency.po.CurrencyRate;
 import com.fjhx.common.entity.documentary.bo.DocumentaryData;
-import com.fjhx.common.enums.FlowStatusEnum;
+import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.service.contract.ContractTemplateService;
 import com.fjhx.common.service.corporation.CorporationService;
 import com.fjhx.common.service.currency.CurrencyRateService;
@@ -258,7 +258,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
     private Page<ContractVo> pageCommon(ContractSelectDto dto, IWrapper<Contract> wrapper) {
         wrapper.orderByDesc("t1", Contract::getCreateTime);
         wrapper.eq("t1", Contract::getIsChange, "0");//列表只展示未变更得数据
-        wrapper.between("t1", Contract::getStatus, FlowStatusEnum.DRAFT.getKey(), FlowStatusEnum.CANCELLATION.getKey() - 1);
+        wrapper.between("t1", Contract::getStatus, FlowStatusEnum1.DRAFT.getKey(), FlowStatusEnum1.CANCELLATION.getKey() - 1);
         if (StringUtils.isNotEmpty(dto.getStatus())) {
             wrapper.eq("t1", Contract::getStatus, dto.getStatus());
         }
@@ -351,7 +351,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
     public Page<ContractBudgetVo> getProfitBudgetPage(ContractSelectDto dto) {
         IWrapper<Contract> wrapper = getWrapper();
         wrapper.orderByDesc("t1", Contract::getCreateTime);
-        wrapper.between("t1", Contract::getStatus, FlowStatusEnum.PASS.getKey(), FlowStatusEnum.CANCELLATION.getKey() - 1);
+        wrapper.between("t1", Contract::getStatus, FlowStatusEnum1.PASS.getKey(), FlowStatusEnum1.CANCELLATION.getKey() - 1);
         if (StringUtils.isNotEmpty(dto.getCustomerId())) {
             wrapper.eq("t1", Contract::getBuyCorporationId, dto.getCustomerId());
         }
@@ -375,9 +375,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
             Map<Long, String> ehsdAmountMap = ehsdAmountList.stream().collect(Collectors.toMap(EhsdPurchaseProductVo::getContractId, EhsdPurchaseProductVo::getCurrencyAmount));
             List<PurchaseDetailVo> otherAmountList = purchaseDetailService.getSumCountInDataResourceIds(contractIds);
             Map<Long, String> otherAmountMap = otherAmountList.stream().collect(Collectors.toMap(PurchaseDetailVo::getDataResourceId, PurchaseDetailVo::getSumAmountCurrency));
-//            //通过合同ID查询到退税数据
-//            List<TaxRefundDetails> refundDetails = taxRefundDetailsService.getSumMoneyByContractIds(contractIds);
-//            Map<Long,List<TaxRefundDetails>> refundDetailsMap = refundDetails.stream().collect(Collectors.groupingBy(TaxRefundDetails::getContractId));
+            //通过合同ID查询到退税数据
+            List<TaxRefundDetails> refundDetails = taxRefundDetailsService.getSumMoneyByContractIds(contractIds);
+            Map<Long, List<TaxRefundDetails>> refundDetailsMap = refundDetails.stream().collect(Collectors.groupingBy(TaxRefundDetails::getContractId));
 
             //取出默认汇率
 //            List<CurrencyRate> currencyRateList = currencyRateService.getList();
@@ -462,7 +462,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
     public Page<ContractBudgetVo> getProfitClearingPage(ContractSelectDto dto) {
         IWrapper<Contract> wrapper = getWrapper();
         wrapper.orderByDesc("t1", Contract::getCreateTime);
-        wrapper.between("t1", Contract::getStatus, FlowStatusEnum.PASS.getKey(), FlowStatusEnum.CANCELLATION.getKey() - 1);
+        wrapper.between("t1", Contract::getStatus, FlowStatusEnum1.PASS.getKey(), FlowStatusEnum1.CANCELLATION.getKey() - 1);
         if (StringUtils.isNotEmpty(dto.getCustomerId())) {
             wrapper.eq("t1", Contract::getBuyCorporationId, dto.getCustomerId());
         }
@@ -961,7 +961,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
         if (buyCorporationId != null) {
             List<Contract> list = list(q -> q
                     .eq(Contract::getBuyCorporationId, buyCorporationId)
-                    .eq(Contract::getStatus, FlowStatusEnum.PASS.getKey())
+                    .eq(Contract::getStatus, FlowStatusEnum1.PASS.getKey())
                     .orderByDesc(BaseIdPo::getId)
                     .last("limit 3")
             );
@@ -1261,6 +1261,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
             item.setCustomerName(customer.getName());
         });
 
+        //赋值业务员名称
+        UserUtil.assignmentNickName(records, Contract::getCreateUser, Contract::setUserName);
+
         return page;
     }
 

+ 26 - 27
hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java

@@ -22,7 +22,6 @@ import com.fjhx.customer.entity.customer.po.Customer;
 import com.fjhx.customer.entity.customer.vo.CustomerVo;
 import com.fjhx.customer.service.customer.CustomerService;
 import com.fjhx.flow.service.flow.FlowExampleService;
-import com.fjhx.sale.entity.contract.vo.ContractProductVo;
 import com.fjhx.sale.entity.contract.vo.ContractVo;
 import com.fjhx.sale.entity.quotation.po.QuotationPay;
 import com.fjhx.sale.entity.quotation.po.QuotationProduct;
@@ -109,9 +108,9 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
 
         // 赋值用户名称
         UserUtil.assignmentNickName(saleQuotationVoList, BasePo::getCreateUser, SaleQuotationVo::setUserName);
-        // 赋值买方公司名称
-        corporationService.attributeAssign(saleQuotationVoList, SaleQuotationVo::getBuyCorporationId, (item, corporation) -> {
-            item.setBuyCorporationName(corporation.getName());
+        // 赋值买方公司名称(客户)
+        customerService.attributeAssign(saleQuotationVoList, SaleQuotationVo::getBuyCorporationId, (item, customer) -> {
+            item.setBuyCorporationName(customer.getName());
         });
         // 赋值卖方公司名称
         corporationService.attributeAssign(saleQuotationVoList, SaleQuotationVo::getSellCorporationId, (item, corporation) -> {
@@ -134,17 +133,17 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         if (ObjectUtil.isNotEmpty(result)) {
             //赋值合同模板名称
             ContractTemplate contractTemplate = contractTemplateService.getById(result.getContractTemplateId());
-            if(ObjectUtil.isNotEmpty(contractTemplate)){
+            if (ObjectUtil.isNotEmpty(contractTemplate)) {
                 result.setContractTemplateName(contractTemplate.getTemplateName());
             }
             //赋值买方公司名称(客户)
             Customer customer = customerService.getById(result.getBuyCorporationId());
-            if(ObjectUtil.isNotEmpty(customer)){
+            if (ObjectUtil.isNotEmpty(customer)) {
                 result.setBuyCorporationName(customer.getName());
             }
             //赋值卖方公司名称(多公司)
             Corporation corporation = corporationService.getById(result.getSellCorporationId());
-            if(ObjectUtil.isNotEmpty(corporation)){
+            if (ObjectUtil.isNotEmpty(corporation)) {
                 result.setSellCorporationName(corporation.getName());
             }
 
@@ -353,7 +352,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         Map<String, Object> map = new HashMap<>();
 
         //存放来源存量与增量的数据列表
-        List<Map<String,Object>> stockList = new ArrayList<>();
+        List<Map<String, Object>> stockList = new ArrayList<>();
 
 
         //来源存量(在指定时间外的数量)
@@ -397,28 +396,28 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
 
         Map<String, List<CustomerVo>> sourceStockMap = sourceStockList.stream().collect(Collectors.groupingBy(Customer::getSource));
 
-        if (dictTenantDataVos.size()==0){
+        if (dictTenantDataVos.size() == 0) {
             throw new ServiceException("数据有误:该租户没有配客户来源字典");
         }
 
         //赋值 增量 存量数据
         for (DictTenantDataVo dictTenantDataVo : dictTenantDataVos) {
             //存放来源存量与增量的数据
-            Map<String,Object>  stockMap = new HashMap<>();
+            Map<String, Object> stockMap = new HashMap<>();
             //赋值初使值
-            stockMap.put("source",dictTenantDataVo.getDictValue());
-            stockMap.put("stockAmount",0);
-            stockMap.put("incrementAmount",0);
+            stockMap.put("source", dictTenantDataVo.getDictValue());
+            stockMap.put("stockAmount", 0);
+            stockMap.put("incrementAmount", 0);
 
             //赋值增量数据
             List<CustomerVo> customers = sourceIncrementMap.get(dictTenantDataVo.getDictKey());
-            if (ObjectUtil.isNotEmpty(customers)){
-                stockMap.put("incrementAmount",customers.get(0).getCount());
+            if (ObjectUtil.isNotEmpty(customers)) {
+                stockMap.put("incrementAmount", customers.get(0).getCount());
             }
             //赋值存量数据
             List<CustomerVo> customerVos = sourceStockMap.get(dictTenantDataVo.getDictKey());
-            if (ObjectUtil.isNotEmpty(customerVos)){
-                stockMap.put("stockAmount",customerVos.get(0).getCount());
+            if (ObjectUtil.isNotEmpty(customerVos)) {
+                stockMap.put("stockAmount", customerVos.get(0).getCount());
             }
             stockList.add(stockMap);
         }
@@ -439,7 +438,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         Map<String, Object> map = new HashMap<>();
 
         //存放询盘数据 成交单的列表
-        List<Map<String,Object>> saleList = new ArrayList<>();
+        List<Map<String, Object>> saleList = new ArrayList<>();
 
         QueryWrapper<Object> query = Wrappers.query();
         query.ge("DATE_FORMAT(sq.create_time,'%Y-%m')", dto.getBeginTime());
@@ -472,7 +471,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         DynamicDataSourceContextHolder.push(SourceConstant.BASE);
         List<DictTenantDataVo> dictTenantDataVoList = getDict("customer_status");
 
-        if (dictTenantDataVoList.size()==0){
+        if (dictTenantDataVoList.size() == 0) {
             throw new ServiceException("数据有误:该租户没有配客户类型字典");
         }
 
@@ -481,20 +480,20 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
             //存放询盘数据 成交单的数据
             Map<String, Object> saleMap = new HashMap<>();
             //赋值初使值
-            saleMap.put("status",dictTenantDataVo.getDictValue());
-            saleMap.put("contractAmount",0);
-            saleMap.put("saleAmount",0);
+            saleMap.put("status", dictTenantDataVo.getDictValue());
+            saleMap.put("contractAmount", 0);
+            saleMap.put("saleAmount", 0);
 
             //赋值询盘数据
             List<SaleQuotationVo> saleQuotationVoList = saleStatisticsMap.get(dictTenantDataVo.getDictKey());
-            if (ObjectUtil.isNotEmpty(saleQuotationVoList)){
-                saleMap.put("saleAmount",saleQuotationVoList.get(0).getCount());
+            if (ObjectUtil.isNotEmpty(saleQuotationVoList)) {
+                saleMap.put("saleAmount", saleQuotationVoList.get(0).getCount());
             }
 
             //赋值成交单数据
             List<SaleQuotationVo> saleQuotationList = contractStatisticsMap.get(dictTenantDataVo.getDictKey());
-            if (ObjectUtil.isNotEmpty(saleQuotationList)){
-                saleMap.put("contractAmount",saleQuotationList.get(0).getCount());
+            if (ObjectUtil.isNotEmpty(saleQuotationList)) {
+                saleMap.put("contractAmount", saleQuotationList.get(0).getCount());
             }
             saleList.add(saleMap);
         }
@@ -641,7 +640,7 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
 
 
     //根据字典编码获取字典的数据
-    private List<DictTenantDataVo> getDict(String code){
+    private List<DictTenantDataVo> getDict(String code) {
         DictTenantDataSelectDto dto = new DictTenantDataSelectDto();
         dto.setDictCode(code);
         return dictTenantDataService.getList(dto);

+ 2 - 3
hx-sale/src/main/java/com/fjhx/sale/service/sample/impl/SampleServiceImpl.java

@@ -10,12 +10,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.account.entity.account.po.AccountManagement;
 import com.fjhx.account.service.account.AccountManagementService;
-import com.fjhx.area.entity.po.CustomizeArea;
 import com.fjhx.area.utils.CustomizeAreaUtil;
 import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.common.entity.contract.po.ContractTemplate;
 import com.fjhx.common.entity.corporation.po.Corporation;
-import com.fjhx.common.enums.FlowStatusEnum;
+import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.service.contract.ContractTemplateService;
 import com.fjhx.common.service.corporation.CorporationService;
 import com.fjhx.common.utils.Assert;
@@ -124,7 +123,7 @@ public class SampleServiceImpl extends ServiceImpl<SampleMapper, Sample> impleme
     public Page<SampleVo> getPage(SampleSelectDto dto) {
         IWrapper<Sample> wrapper = getWrapper();
         wrapper.orderByDesc("t1", Sample::getCreateTime);
-        wrapper.between("t1", Sample::getStatus, FlowStatusEnum.DRAFT.getKey(), FlowStatusEnum.CANCELLATION.getKey() - 1);
+        wrapper.between("t1", Sample::getStatus, FlowStatusEnum1.DRAFT.getKey(), FlowStatusEnum1.CANCELLATION.getKey() - 1);
         if (StringUtils.isNotEmpty(dto.getStatus())) {
             wrapper.eq("t1", Sample::getStatus, dto.getStatus());
         }