Browse Source

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu 6 months ago
parent
commit
75eb576bf6

+ 3 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/listvo/order/PunishOrderVO.java

@@ -48,6 +48,9 @@ public class PunishOrderVO {
     private String orderBaseId;
     @ApiModelProperty("处罚工单类型")
     private String orderSmallTypeText;
+    @ApiModelProperty("处罚网点编号")
+    private String websitId;
+
     @ApiModelProperty("处罚网点名称")
     private String websitName;
     @ZfireField(tbName = "b")

+ 4 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/listvo/workorder/OrderBase2VO.java

@@ -63,6 +63,10 @@ public class OrderBase2VO {
 //    private String companyWechatName;
 
     @ZfireField(sortNum = 13)
+    @ApiModelProperty(value = "网点编号")
+    private String websitId;
+
+    @ZfireField(sortNum = 13)
     @ApiModelProperty(value = "网点名称")
     private String websitName;
 

+ 4 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/listvo/workorder/OrderBaseAppraiseVO.java

@@ -16,6 +16,10 @@ public class OrderBaseAppraiseVO {
 //    @ZfireField(sortNum = 2)
 //    @ApiModelProperty(value = "所属商户")
 //    private String companyWechatName;
+
+    @ZfireField(sortNum = 3)
+    @ApiModelProperty(value = "网点编号")
+    private String websitId;
     @ZfireField(sortNum = 3)
     @ApiModelProperty(value = "网点名称")
     private String websitName;

+ 5 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/listvo/workorder/OrderBaseVO.java

@@ -23,6 +23,11 @@ public class OrderBaseVO     {
 //    @ZfireField(sortNum = 2)
 //    @ApiModelProperty(value = "所属商户")
 //    private String companyWechatName;
+
+
+    @ZfireField(sortNum = 3)
+    @ApiModelProperty(value = "网点编号")
+    private String websitId;
     @ZfireField(sortNum = 3)
     @ApiModelProperty(value = "网点名称")
     private String websitName;

+ 2 - 1
mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/AgreementAddUp.java

@@ -2,6 +2,7 @@ package com.gree.mall.manager.bean.policy;
 
 import com.gree.mall.manager.plus.entity.Agreement;
 import com.gree.mall.manager.plus.entity.AgreementPolicy;
+import com.gree.mall.manager.plus.entity.Policy;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -13,5 +14,5 @@ import java.util.List;
 public class AgreementAddUp extends Agreement {
 
     @ApiModelProperty(value = "绑定政策")
-    private List<AgreementPolicy> agreementPolicies;
+    private List<Policy> policy;
 }

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/PolicyVo.java

@@ -38,7 +38,7 @@ public class PolicyVo   {
     @ApiModelProperty(value = "结束日期")
     private Date endTime;
 
-    @ApiModelProperty(value = "是否允许购买 YES 是 NO否")
+    @ApiModelProperty(value = "是否允许购买")
     private IsYesNoEnum isBuy;
 
     @ApiModelProperty(value = "创建时间")

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/ExamineProjectVO.java

@@ -25,7 +25,7 @@ public class ExamineProjectVO {
 //    @ApiModelProperty(value = "商户名称")
 //    private String companyWechatName;
 
-    @ZfireField(hide = true)
+
     @ApiModelProperty(value = "网点编号")
     private String websitId;
 

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/SettleOrderVO.java

@@ -30,7 +30,7 @@ public class SettleOrderVO {
 //    @ApiModelProperty(value = "商户名称")
 //    private String companyWechatName;
 
-    @ZfireField(hide = true)
+
     @ApiModelProperty(value = "网点编号")
     private String websitId;
 

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/SettlePoolVO.java

@@ -25,7 +25,7 @@ public class SettlePoolVO {
 //    @ApiModelProperty(value = "商户名称")
 //    private String companyWechatName;
 
-    @ZfireField(hide = true)
+ 
     @ApiModelProperty(value = "网点编号")
     private String websitId;
 

+ 4 - 1
mall-server-api/src/main/java/com/gree/mall/manager/controller/admin/AdminWebsitController.java

@@ -45,6 +45,8 @@ public class AdminWebsitController {
     public ResponseHelper<List<AdminWebsit>> list(
             @ApiParam(value = "A=平台 B=商户网点 C=普通网点") @RequestParam(required = false) String type,
             @RequestParam(required = false) Boolean isAll,
+            @RequestParam(required = false) String websitId,
+            @RequestParam(required = false) String websitName,
             @RequestParam(required = false) Boolean status,
             @RequestParam(required = false) Boolean isIncre,
             @RequestParam(required = false) String streetCode,
@@ -53,9 +55,10 @@ public class AdminWebsitController {
             @RequestParam(required = false) String orderSourceId,
             @RequestParam(required = false) String orderSmallId,
             @RequestParam(required = false) Boolean queryPartsWebsit,
+            @RequestParam(required = false)   @ApiParam(value = "网点属性 SELF=自建网点 MAJOR=第三方专业网点 MERCHANT=第三方经销商家网点")String attr,
             @RequestParam(required = false) Integer level
     ) {
-        List<AdminWebsit> list = adminWebsitLogic.list(type, isAll, isIncre, status, streetCode, channelId, categoryId, orderSmallId, orderSourceId, queryPartsWebsit, level);
+        List<AdminWebsit> list = adminWebsitLogic.list(attr,websitId,websitName,type, isAll, isIncre, status, streetCode, channelId, categoryId, orderSmallId, orderSourceId, queryPartsWebsit, level);
         return ResponseHelper.success(list);
     }
 

+ 6 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/admin/AdminWebsitLogic.java

@@ -131,7 +131,7 @@ public class AdminWebsitLogic {
         return parentList;
     }
 
-    public List<AdminWebsit> list(String type, Boolean isAll, Boolean isIncre, Boolean status, String streetCode, String channelId, String categoryId,
+    public List<AdminWebsit> list(String attr,String websitId,String websitName,String type, Boolean isAll, Boolean isIncre, Boolean status, String streetCode, String channelId, String categoryId,
                                   String orderSmallId, String orderSourceId, Boolean queryPartsWebsit, Integer level) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
 
@@ -145,6 +145,8 @@ public class AdminWebsitLogic {
                     .eq(!StringUtil.isEmpty(categoryId), WebsitDispatch::getCategoryId, categoryId)
                     .eq(!StringUtil.isEmpty(orderSmallId), WebsitDispatch::getOrderSmallId, orderSmallId)
                     .eq(!StringUtil.isEmpty(orderSourceId), WebsitDispatch::getOrderSource, orderSourceId)
+                    .like(!StringUtil.isEmpty(websitId), WebsitDispatch::getWebsitId, websitId)
+                    .like(!StringUtil.isEmpty(websitName), WebsitDispatch::getWebsitName, websitName)
                     .list().stream().map(WebsitDispatch::getWebsitId).collect(Collectors.toList());
         }
 
@@ -155,6 +157,9 @@ public class AdminWebsitLogic {
                 .in(StringUtils.isNotBlank(streetCode) && !CollectionUtils.isEmpty(websitIds), AdminWebsit::getWebsitId, websitIds)
                 .eq(isIncre != null, AdminWebsit::getIsIncre, isIncre)
                 .eq(status != null, AdminWebsit::getStatus, status)
+                .like(!StringUtil.isEmpty(websitId), AdminWebsit::getWebsitId, websitId)
+                .like(!StringUtil.isEmpty(websitName), AdminWebsit::getName, websitName)
+                .eq(!StringUtil.isEmpty(attr), AdminWebsit::getAttr, attr)
                 .in(CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds()) && (isAll == null || !isAll), AdminWebsit::getWebsitId, adminUser.getAdminWebsitIds())
                 .in(CollectionUtils.isNotEmpty(adminUser.getCompanyWechatIds()), AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatIds())
                 .and(Objects.nonNull(queryPartsWebsit) && queryPartsWebsit, v -> v.isNotNull(AdminWebsit::getPartsWebsitId)

+ 20 - 6
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/AgreementLogic.java

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -70,7 +71,7 @@ public class AgreementLogic {
         List<AgreementPolicy> agreementPolicies = agreementPolicyService.lambdaQuery().eq(AgreementPolicy::getAgreementId, agreement.getId()).list();
 
 
-        List<String> aggre = agreementPolicies.stream().map(AgreementPolicy::getAgreementId).collect(Collectors.toList());
+        List<String> aggre = agreementPolicies.stream().map(AgreementPolicy::getPolicyId).collect(Collectors.toList());
 
 
         List<Policy> policyList = policyService.lambdaQuery().in(Policy::getId, aggre).list();
@@ -85,14 +86,21 @@ public class AgreementLogic {
     @Transactional(rollbackFor = Exception.class)
     public void add(AgreementAddUp agreementAddUp) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
+
         agreementAddUp.setCompanyWechatId(adminUser.getCompanyWechatId());
         agreementAddUp.setCompanyWechatName(adminUser.getCompanyName());
         agreementAddUp.insert();
 
-        for (AgreementPolicy agreementPolicy : agreementAddUp.getAgreementPolicies()) {
+        List<AgreementPolicy> agreementPolicies = new ArrayList<>();
+
+        for (Policy policy : agreementAddUp.getPolicy()) {
+            AgreementPolicy agreementPolicy = new AgreementPolicy();
+            agreementPolicy.setPolicyId(policy.getId());
             agreementPolicy.setAgreementId(agreementAddUp.getId());
+
+            agreementPolicies.add(agreementPolicy);
         }
-        agreementPolicyService.saveBatch(agreementAddUp.getAgreementPolicies());
+        agreementPolicyService.saveBatch(agreementPolicies);
     }
 
 
@@ -104,10 +112,16 @@ public class AgreementLogic {
 
         agreementPolicyService.lambdaUpdate().eq(AgreementPolicy::getAgreementId,agreementAddUp.getId()).remove();
 
-        for (AgreementPolicy agreementPolicy : agreementAddUp.getAgreementPolicies()) {
+        List<AgreementPolicy> agreementPolicies = new ArrayList<>();
+
+        for (Policy policy : agreementAddUp.getPolicy()) {
+            AgreementPolicy agreementPolicy = new AgreementPolicy();
+            agreementPolicy.setPolicyId(policy.getId());
             agreementPolicy.setAgreementId(agreementAddUp.getId());
+
+            agreementPolicies.add(agreementPolicy);
         }
-        agreementPolicyService.saveBatch(agreementAddUp.getAgreementPolicies());
+        agreementPolicyService.saveBatch(agreementPolicies);
     }
 
     public MailboxAdd detailMailbox() {
@@ -140,7 +154,7 @@ public class AgreementLogic {
 
         for (MailboxReceive mailboxReceive : mailbox.getMailboxReceives()) {
 
-            mailboxReceive.setMailboxId("id");
+            mailboxReceive.setMailboxId("1");
         }
 
         mailboxReceiveService.saveBatch(mailbox.getMailboxReceives());

+ 24 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/PolicyLogic.java

@@ -7,10 +7,13 @@ import com.gree.mall.manager.bean.admin.AdminUserCom;
 import com.gree.mall.manager.bean.policy.PolicyDetail;
 import com.gree.mall.manager.bean.policy.PolicyVo;
 import com.gree.mall.manager.commonmapper.PolicyCMapper;
+import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.plus.entity.AdminWebsit;
 import com.gree.mall.manager.plus.entity.Policy;
 import com.gree.mall.manager.plus.entity.PolicyRange;
 import com.gree.mall.manager.plus.entity.PolicyWebsit;
+import com.gree.mall.manager.plus.service.AdminWebsitService;
 import com.gree.mall.manager.plus.service.PolicyRangeService;
 import com.gree.mall.manager.plus.service.PolicyService;
 import com.gree.mall.manager.plus.service.PolicyWebsitService;
@@ -40,6 +43,9 @@ public class PolicyLogic {
     @Autowired
     PolicyWebsitService policyWebsitService;
 
+    @Autowired
+    AdminWebsitService adminWebsitService;
+
 
 
     public IPage<PolicyVo> list(Page page, ZfireParamBean zfireParam) {
@@ -76,6 +82,9 @@ public class PolicyLogic {
 
         AdminUserCom adminUser = commonLogic.getAdminUser();
 
+        if (policyService.lambdaQuery().eq(Policy::getPolicyName,policyDetail.getPolicyName()).count() > 0)
+            throw new RemoteServiceException("保险名称不能重复");
+
         policyDetail.setCompanyWechatId(adminUser.getCompanyWechatId());
         policyDetail.setCompanyWechatName(adminUser.getCompanyName());
 
@@ -86,7 +95,13 @@ public class PolicyLogic {
         }
 
         for (PolicyWebsit policyWebsit : policyDetail.getPolicyWebsits()) {
+
+            AdminWebsit adminWebsit = adminWebsitService.getById(policyWebsit.getWebsitId());
+
             policyWebsit.setPolicyId(policyDetail.getId());
+            policyWebsit.setWebsitName(adminWebsit.getName());
+            policyWebsit.setBelongCompany(adminWebsit.getBelongCompany());
+            policyWebsit.setBelongCompanyCode(adminWebsit.getBelongCompanyCode());
         }
 
 
@@ -97,6 +112,10 @@ public class PolicyLogic {
     @Transactional(rollbackFor = Exception.class)
     public void update(PolicyDetail policyDetail) {
 
+        if (policyService.lambdaQuery().eq(Policy::getPolicyName,policyDetail.getPolicyName())
+                .ne(Policy::getId,policyDetail.getId()).count() > 0)
+            throw new RemoteServiceException("保险名称不能重复");
+
         policyDetail.updateById();
 
         policyRangeService.lambdaUpdate().eq(PolicyRange::getPolicyId,policyDetail.getId()).remove();
@@ -107,7 +126,12 @@ public class PolicyLogic {
         }
 
         for (PolicyWebsit policyWebsit : policyDetail.getPolicyWebsits()) {
+            AdminWebsit adminWebsit = adminWebsitService.getById(policyWebsit.getWebsitId());
+
             policyWebsit.setPolicyId(policyDetail.getId());
+            policyWebsit.setWebsitName(adminWebsit.getName());
+            policyWebsit.setBelongCompany(adminWebsit.getBelongCompany());
+            policyWebsit.setBelongCompanyCode(adminWebsit.getBelongCompanyCode());
         }
 
 

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/WorkerManagerLogic.java

@@ -140,7 +140,7 @@ public class WorkerManagerLogic {
 
         WorkerManagerDetail workerManagerDetail = BeanUtil.toBean(websitUser, WorkerManagerDetail.class);
 
-        workerManagerDetail.setUser(userService.getById(workerManagerDetail.getUser()));
+        workerManagerDetail.setUser(userService.getById(workerManagerDetail.getUserId()));
 
         List<WorkerImg> list = workerImgService.lambdaQuery().eq(WorkerImg::getWorkerId, websitUser.getUserId()).list();