Browse Source

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

FengChaoYu 5 months ago
parent
commit
95ad8e3460
26 changed files with 837 additions and 248 deletions
  1. 1 0
      mall-server-api/src/main/java/com/gree/mall/manager/annotation/ZfireField.java
  2. 6 1
      mall-server-api/src/main/java/com/gree/mall/manager/bean/listvo/workorder/OrderBaseVO.java
  3. 15 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/notice/NoticeWebsitBean.java
  4. 59 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/notice/NoticeWebsitRecordVO.java
  5. 70 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/notice/NoticeWebsitVO.java
  6. 2 2
      mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/DispatchVO.java
  7. 1 1
      mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/WebsitDispatchAdd.java
  8. 2 5
      mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/WebsitDispatchRe.java
  9. 2 2
      mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/WebsitDispatchVO.java
  10. 9 3
      mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/NoticeRecordBeanMapper.java
  11. 7 14
      mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/workorder/IncreMapper.java
  12. 2 0
      mall-server-api/src/main/java/com/gree/mall/manager/config/aop/ZfireFiledAop.java
  13. 154 0
      mall-server-api/src/main/java/com/gree/mall/manager/controller/notice/NoticeWebsitController.java
  14. 11 0
      mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/ChangeOrderController.java
  15. 16 26
      mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/DispatchController.java
  16. 23 0
      mall-server-api/src/main/java/com/gree/mall/manager/enums/NoticeWebsitEnum.java
  17. 20 0
      mall-server-api/src/main/java/com/gree/mall/manager/enums/NoticeWebsitStatusEnum.java
  18. 47 39
      mall-server-api/src/main/java/com/gree/mall/manager/logic/big/BigLogic.java
  19. 201 0
      mall-server-api/src/main/java/com/gree/mall/manager/logic/notice/NoticeWebsitLogic.java
  20. 25 12
      mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/AgreementLogic.java
  21. 84 19
      mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/ChangeOrderLogic.java
  22. 44 0
      mall-server-api/src/main/resources/mapper/NoticeRecordBeanMapper.xml
  23. 36 124
      mall-server-api/src/main/resources/mapper/workorder/IncreMapper.xml
  24. BIN
      mall-server-api/src/main/resources/template/自动派工配置.xlsx
  25. BIN
      mall-server-api/src/main/resources/template/质保金新增模板.xlsx
  26. BIN
      mall-server-api/src/main/resources/template/质保金缴费模板.xlsx

+ 1 - 0
mall-server-api/src/main/java/com/gree/mall/manager/annotation/ZfireField.java

@@ -18,6 +18,7 @@ public @interface ZfireField {
     boolean hide() default false;
     boolean isQuery() default true;//是否支持查询
     boolean multiple() default false;//是否支持多选
+    boolean isCutting() default true;//是否支持切割
     int sortNum() default 999;
 
     boolean ignoreSelect() default false;//是否忽略查询该字段

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

@@ -3,6 +3,7 @@ package com.gree.mall.manager.bean.listvo.workorder;
 import com.gree.mall.manager.annotation.ZfireField;
 import com.gree.mall.manager.enums.workorder.OrderBaseStatusEnum;
 import com.gree.mall.manager.enums.workorder.SaleTypeEnum;
+import com.gree.mall.manager.plus.entity.PgOrderBase;
 import com.gree.mall.manager.plus.entity.PgOrderFlag;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -24,6 +25,10 @@ public class OrderBaseVO     {
 //    @ApiModelProperty(value = "所属商户")
 //    private String companyWechatName;
 
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "是否为4.0工单导入 true/false")
+    private Boolean isImportExcel;
+
 
     @ZfireField(sortNum = 3)
     @ApiModelProperty(value = "网点编号")
@@ -39,7 +44,7 @@ public class OrderBaseVO     {
     @ApiModelProperty("结算费用")
     private BigDecimal settleServiceAmount;
 
-    @ZfireField(sortNum = 5)
+    @ZfireField(sortNum = 5,multiple = true,isCutting = true)
     @ApiModelProperty(value = "工单单号")
     private String id;
     @ZfireField(sortNum = 5,multiple = true)

+ 15 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/notice/NoticeWebsitBean.java

@@ -0,0 +1,15 @@
+package com.gree.mall.manager.bean.notice;
+
+import com.gree.mall.manager.plus.entity.NoticeWebsit;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class NoticeWebsitBean extends NoticeWebsit {
+
+    @ApiModelProperty(value = "网点id")
+    private List<String> websitIds;
+
+}

+ 59 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/notice/NoticeWebsitRecordVO.java

@@ -0,0 +1,59 @@
+package com.gree.mall.manager.bean.notice;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.enums.NoticeWebsitEnum;
+import com.gree.mall.manager.plus.entity.NoticeWebsit;
+import com.gree.mall.manager.plus.entity.NoticeWebsitRecord;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@ZfireField(tbName = "a")
+public class NoticeWebsitRecordVO    {
+
+
+    @ZfireField(tbName = "a",hide = true)
+    @TableId(value = "notice_websit_id", type = IdType.ID_WORKER_STR)
+    private String noticeWebsitId;
+
+    @ZfireField(tbName = "a")
+    @ApiModelProperty(value = "文件标题")
+    private String title;
+    @ZfireField(tbName = "a")
+    @ApiModelProperty(value = "来源部门")
+    private String deptName;
+    @ZfireField(tbName = "a")
+    @ApiModelProperty(value = "文件编号")
+    private String code;
+    @ZfireField(tbName = "a")
+    @ApiModelProperty(value = "通知类型")
+    private NoticeWebsitEnum type;
+
+    @ZfireField(tbName = "a")
+    @ApiModelProperty(value = "发布日期")
+    private Date issueTime;
+    @ZfireField(tbName = "a")
+    @ApiModelProperty(value = "发布人名称")
+    private String issueNickName;
+
+    @ZfireField(hide = true,tbName = "b")
+    @TableId(value = "id", type = IdType.ID_WORKER_STR)
+    private String id;
+    @ZfireField(tbName = "b")
+    @ApiModelProperty(value = "接收时间")
+    private Date readTime;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty(value = "网点编号")
+    private String adminWebsitId;
+    @ZfireField(tbName = "b")
+    @ApiModelProperty(value = "网点名称")
+    private String adminWebsitName;
+
+}

+ 70 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/notice/NoticeWebsitVO.java

@@ -0,0 +1,70 @@
+package com.gree.mall.manager.bean.notice;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.enums.NoticeWebsitEnum;
+import com.gree.mall.manager.enums.NoticeWebsitStatusEnum;
+import com.gree.mall.manager.plus.entity.NoticeWebsit;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+
+@Data
+public class NoticeWebsitVO   {
+
+    @ZfireField(hide = true)
+    @TableId(value = "notice_websit_id", type = IdType.ID_WORKER_STR)
+    private String noticeWebsitId;
+
+    @ApiModelProperty(value = "文件标题")
+    private String title;
+
+    @ApiModelProperty(value = "来源部门")
+    private String deptName;
+
+    @ApiModelProperty(value = "文件编号")
+    private String code;
+
+
+    @ApiModelProperty(value = "通知类型")
+    private NoticeWebsitEnum type;
+
+    @ApiModelProperty(value = "状态")
+    private NoticeWebsitStatusEnum status;
+
+    @ApiModelProperty(value = "发布日期")
+    private Date issueTime;
+
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "发布人id")
+    private String issueUserId;
+
+    @ApiModelProperty(value = "发布人名称")
+    private String issueNickName;
+
+
+    @ApiModelProperty(value = "创建人(制单人)")
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新人")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateBy;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "接收网点数量")
+    private Integer num;
+
+}

+ 2 - 2
mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/DispatchVO.java

@@ -66,11 +66,11 @@ public class DispatchVO {
 
 
     @ZfireField(tbName = "e",colName = "dict_value")
-    @ApiModelProperty(value = "承接渠道")
+    @ApiModelProperty(value = "销售类型")
     private String saleTypeName;
 
     @ZfireField(tbName = "e",hide = true,colName = "dict_code")
-    @ApiModelProperty(value = "承接渠道")
+    @ApiModelProperty(value = "销售类型")
     private String saleTypeId;
 
 

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

@@ -18,7 +18,7 @@ public class WebsitDispatchAdd {
     private String streetCode;
 
     @ApiModelProperty(value = "承接渠道ids")
-    private List<String> salesTypeIds;
+    private List<String> saleIds;
 
     @ApiModelProperty(value = "工单类型")
     private List<String> orderSmallIds;

+ 2 - 5
mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/WebsitDispatchRe.java

@@ -24,15 +24,12 @@ public class WebsitDispatchRe {
     @ApiModelProperty(value = "街道id")
     private String streetCode;
 
-    @ApiModelProperty(value = "工单渠道id")
-    private List<String> dictCode;
-
     @ApiModelProperty(value = "工单类型id")
     private List<String> orderSmallId;
 
     @ApiModelProperty(value = "产品大类id")
     private List<String> categoryId;
 
-    @ApiModelProperty(value = "工单来源id")
-    private List<String> orderSourceId;
+    @ApiModelProperty(value = "销量类型ids")
+    private List<String> saleIds;
 }

+ 2 - 2
mall-server-api/src/main/java/com/gree/mall/manager/bean/workorder/WebsitDispatchVO.java

@@ -56,10 +56,10 @@ public class WebsitDispatchVO    {
     @ApiModelProperty(value = "产品大类id")
     private String categoryId;
 
-    @ApiModelProperty(value = "承接渠道")
+    @ApiModelProperty(value = "销售类型")
     private String saleTypeName;
     @ZfireField(hide = true)
-    @ApiModelProperty(value = "承接渠道id")
+    @ApiModelProperty(value = "销售类型")
     private String saleTypeId;
 
     @ApiModelProperty(value = "网点编号")

+ 9 - 3
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/NoticeRecordBeanMapper.java

@@ -2,9 +2,8 @@ package com.gree.mall.manager.commonmapper;
 
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.gree.mall.manager.bean.notice.NoticeRecordReadBean;
-import com.gree.mall.manager.bean.notice.NoticeRecordReadVOBean;
-import com.gree.mall.manager.bean.notice.NoticeVO;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.bean.notice.*;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -36,4 +35,11 @@ public interface NoticeRecordBeanMapper {
                                              @Param("ex") ZfireParamBean zfireParam,
                                              @Param("adminUserId") String adminUserId,
                                              @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+
+    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
+    IPage<NoticeWebsitVO> listNoticeWebsit(Page page,@Param("ex") ZfireParamBean zfireParam,@Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
+    IPage<NoticeWebsitRecordVO> listWebsit(Page page,@Param("ex") ZfireParamBean zfireParam,@Param("adminCompanyIds")  List<String> adminCompanyIds);
 }

+ 7 - 14
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/workorder/IncreMapper.java

@@ -29,10 +29,9 @@ public interface IncreMapper {
                                @Param("cityCode") String cityCode,
                                @Param("areaCode") String areaCode,
                                @Param("streetCode") String streetCode,
-                               @Param("dictCode") List<String> dictCode,
+                               @Param("sales") List<String> sales,
                                @Param("orderSmallId") List<String> orderSmallId,
                                @Param("categoryId") List<String> categoryId,
-                               @Param("orderSourceId") List<String> orderSourceId,
                                 @Param("adminCompanyIds") List<String> adminCompanyIds);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
@@ -41,10 +40,9 @@ public interface IncreMapper {
             @Param("cityCode") String cityCode,
             @Param("areaCode") String areaCode,
             @Param("streetCode") String streetCode,
-            @Param("dictCode") List<String> dictCode,
+            @Param("sales") List<String> sales,
             @Param("orderSmallId") List<String> orderSmallId,
             @Param("categoryId") List<String> categoryId,
-            @Param("orderSourceId") List<String> orderSourceId,
             @Param("adminCompanyIds") List<String> adminCompanyIds);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
@@ -52,10 +50,9 @@ public interface IncreMapper {
                                  @Param("cityCode") String cityCode,
                                  @Param("areaCode") String areaCode,
                                  @Param("streetCode") String streetCode,
-                                 @Param("dictCode") List<String> dictCode,
+                                 @Param("sales") List<String> sales,
                                  @Param("orderSmallId") List<String> orderSmallId,
                                  @Param("categoryId") List<String> categoryId,
-                                 @Param("orderSourceId") List<String> orderSourceId,
                                  @Param("adminCompanyIds") List<String> adminCompanyIds);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
@@ -63,10 +60,9 @@ public interface IncreMapper {
                                @Param("cityCode") String cityCode,
                                @Param("areaCode") String areaCode,
                                @Param("streetCode") String streetCode,
-                               @Param("dictCode") List<String> dictCode,
+                               @Param("sales") List<String> sales,
                                @Param("orderSmallId") List<String> orderSmallId,
                                @Param("categoryId") List<String> categoryId,
-                               @Param("orderSourceId") List<String> orderSourceId,
                                @Param("adminCompanyIds") List<String> adminCompanyIds);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
@@ -86,10 +82,9 @@ public interface IncreMapper {
                                      @Param("cityCode") String cityCode,
                                      @Param("areaCode") String areaCode,
                                      @Param("streetCode") String streetCode,
-                                     @Param("dictCode") List<String> dictCode,
+                                     @Param("sales") List<String> sales,
                                      @Param("orderSmallId") List<String> orderSmallId,
                                      @Param("categoryId") List<String> categoryId,
-                                     @Param("orderSourceId") List<String> orderSourceId,
                                      @Param("adminCompanyIds") List<String> adminCompanyIds);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
@@ -97,10 +92,9 @@ public interface IncreMapper {
                                        @Param("cityCode") String cityCode,
                                        @Param("areaCode") String areaCode,
                                        @Param("streetCode") String streetCode,
-                                       @Param("dictCode") List<String> dictCode,
+                                       @Param("sales") List<String> sales,
                                        @Param("orderSmallId") List<String> orderSmallId,
                                        @Param("categoryId") List<String> categoryId,
-                                       @Param("orderSourceId") List<String> orderSourceId,
                                        @Param("adminCompanyIds") List<String> adminCompanyIds);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
@@ -109,10 +103,9 @@ public interface IncreMapper {
             @Param("cityCode") String cityCode,
             @Param("areaCode") String areaCode,
             @Param("streetCode") String streetCode,
-            @Param("dictCode") List<String> dictCode,
+            @Param("sales") List<String> sales,
             @Param("orderSmallId") List<String> orderSmallId,
             @Param("categoryId") List<String> categoryId,
-            @Param("orderSourceId") List<String> orderSourceId,
             @Param("adminCompanyIds") List<String> adminCompanyIds);
 
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")

+ 2 - 0
mall-server-api/src/main/java/com/gree/mall/manager/config/aop/ZfireFiledAop.java

@@ -216,6 +216,7 @@ public class ZfireFiledAop {
         fieldBean.setTiling(true);
         fieldBean.setIsShow(true);
         fieldBean.setIsQuery(true);
+        fieldBean.setIsCutting(true);
 
 
         Annotation[] annotations = field.getAnnotations();
@@ -248,6 +249,7 @@ public class ZfireFiledAop {
                 fieldBean.setFixed(zfireField.fixed());
                 fieldBean.setPk(pk);
                 fieldBean.setMultiple(zfireField.multiple());
+                fieldBean.setIsCutting(zfireField.isCutting());
 
             }else if(annotation instanceof ApiModelProperty){
                 ApiModelProperty property = (ApiModelProperty) annotation;

+ 154 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/notice/NoticeWebsitController.java

@@ -0,0 +1,154 @@
+package com.gree.mall.manager.controller.notice;
+
+import cn.hutool.core.lang.TypeReference;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.annotation.ZfireList;
+import com.gree.mall.manager.bean.notice.*;
+import com.gree.mall.manager.exception.RemoteServiceException;
+import com.gree.mall.manager.helper.ResponseHelper;
+import com.gree.mall.manager.logic.notice.NoticeLogic;
+import com.gree.mall.manager.logic.notice.NoticeWebsitLogic;
+import com.gree.mall.manager.plus.entity.NoticeWebsit;
+import com.gree.mall.manager.plus.entity.NoticeWebsitRecord;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+@Slf4j
+@RestController
+@Api(value = "网点通知API", tags = {"网点通知API"})
+@RequestMapping(value = "/noticeWebsit", produces = "application/json; charset=utf-8")
+public class NoticeWebsitController {
+
+    @Autowired
+    private NoticeWebsitLogic noticeWebsitLogic;
+
+
+    @ZfireList
+    @PostMapping("/list")
+    @ApiOperation(value = "通知列表")
+    public ResponseHelper<IPage<NoticeWebsitVO>> list(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) throws RemoteServiceException {
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
+        IPage<NoticeWebsitVO> stockBeanIPage = noticeWebsitLogic.list(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
+        return ResponseHelper.success(stockBeanIPage, new TypeReference<NoticeWebsitVO>() {});
+    }
+
+    @PostMapping("/list/export")
+    @ApiOperation(value = "通知列表导出")
+    public void listExport(
+            @RequestBody ZfireParamBean zfireParamBean,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        //1.组装查询条件
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
+        //2.查询要导出的内容
+        IPage<NoticeWebsitVO> stockBeanIPage = noticeWebsitLogic.list(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
+        //3.导出
+        FieldUtils.exportData(stockBeanIPage.getRecords(), zfireParam.getExportFields(), request, response);
+    }
+
+    @GetMapping("/detail")
+    @ApiOperation(value = "消息详情")
+    public ResponseHelper<NoticeWebsit> detail(
+            @ApiParam(value = "id", required = true) @RequestParam(required = true) String id
+    ){
+        NoticeWebsit detail = noticeWebsitLogic.detail(id);
+        return ResponseHelper.success(detail);
+    }
+
+    @PostMapping("/add")
+    @ApiOperation(value = "通知-新增")
+    public ResponseHelper add(@RequestBody NoticeWebsitBean noticeBean) {
+        noticeWebsitLogic.add(noticeBean);
+        return ResponseHelper.success();
+    }
+
+
+    @PostMapping("/update")
+    @ApiOperation(value = "通知-修改")
+    public ResponseHelper update(@RequestBody NoticeWebsitBean noticeBean) {
+        noticeWebsitLogic.update(noticeBean);
+        return ResponseHelper.success();
+    }
+
+
+    @PostMapping("/ofOrSend")
+    @ApiOperation(value = "通知-关闭修改")
+    public ResponseHelper ofOrSend(
+            @ApiParam(value = "id", required = true) @RequestParam(required = true) String id,
+            @ApiParam(value = "SEND 发布 OFF 关闭", required = true) @RequestParam(required = true) String status
+
+    ) {
+        noticeWebsitLogic.ofOrSend(id,status);
+        return ResponseHelper.success();
+    }
+
+
+    @ZfireList
+    @PostMapping("/listWebsit")
+    @ApiOperation(value = "网点通知信息列表")
+    public ResponseHelper<IPage<NoticeWebsitRecordVO>> listWebsit(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) throws RemoteServiceException {
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
+        IPage<NoticeWebsitRecordVO> stockBeanIPage = noticeWebsitLogic.listWebsit(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
+        return ResponseHelper.success(stockBeanIPage, new TypeReference<NoticeWebsitRecordVO>() {});
+    }
+
+    @PostMapping("/listWebsit/export")
+    @ApiOperation(value = "网点通知信息列表导出")
+    public void listWebsitExport(
+            @RequestBody ZfireParamBean zfireParamBean,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        //1.组装查询条件
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
+        //2.查询要导出的内容
+        IPage<NoticeWebsitRecordVO> stockBeanIPage = noticeWebsitLogic.listWebsit(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
+        //3.导出
+        FieldUtils.exportData(stockBeanIPage.getRecords(), zfireParam.getExportFields(), request, response);
+    }
+
+
+    @PostMapping("/list/count")
+    @ApiOperation(value = "未读已读消息数量")
+    public ResponseHelper<Integer> unreadCount(
+                                                 @ApiParam(value = "YES 已读  NO 未读", required = false) @RequestParam String readFlag,
+                                                 HttpServletRequest request) {
+        return ResponseHelper.success(noticeWebsitLogic.unreadCount(request,readFlag));
+    }
+
+
+    @PostMapping("/mark/read")
+    @ApiOperation(value = "标记消息已读")
+    public ResponseHelper markRead(
+            @ApiParam(value = "通知消息id数组", required = true) @RequestParam List<String> noticeWebsitIds
+    ) throws Exception {
+        noticeWebsitLogic.markRead(noticeWebsitIds);
+        return ResponseHelper.success();
+    }
+
+
+    @PostMapping("/mark/read/all")
+    @ApiOperation(value = "全部标记已读")
+    public ResponseHelper markReadAll(HttpServletRequest request) {
+        noticeWebsitLogic.markReadAll(request);
+        return ResponseHelper.success();
+    }
+
+
+}

+ 11 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/ChangeOrderController.java

@@ -66,6 +66,17 @@ public class ChangeOrderController {
     }
 
 
+    @PostMapping("/changWebsit")
+    @ApiOperation("自动派工")
+    public ResponseHelper changWebsit(
+            @RequestBody ChangeWorkerVO changeWorkerVO,
+            HttpServletRequest request
+    ) throws ParseException {
+        changeOrderLogic.changWebsit(changeWorkerVO.getIds());
+        return ResponseHelper.success();
+    }
+
+
 
     @PostMapping("/getOrderProduct")
     @ApiOperation("完工明细")

+ 16 - 26
mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/DispatchController.java

@@ -146,8 +146,8 @@ public class DispatchController {
 
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.pList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
-                websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getSaleIds(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getCategoryId());
         return ResponseHelper.success(dispatchCherVOS);
     }
 
@@ -158,8 +158,8 @@ public class DispatchController {
 
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.cList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
-                websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getSaleIds(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getCategoryId());
         return ResponseHelper.success(dispatchCherVOS);
     }
 
@@ -170,8 +170,8 @@ public class DispatchController {
 
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.aList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
-                websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getSaleIds(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getCategoryId());
         return ResponseHelper.success(dispatchCherVOS);
     }
 
@@ -181,23 +181,13 @@ public class DispatchController {
             @RequestBody WebsitDispatchRe websitDispatchRe
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.sList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
-                websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getSaleIds(), websitDispatchRe.getOrderSmallId(),
+                websitDispatchRe.getCategoryId());
         return ResponseHelper.success(dispatchCherVOS);
     }
 
 
-    @PostMapping("/channel")
-    @ApiOperation(value = "工单渠道")
-    public ResponseHelper<List<DispatchCherVO>> channel(
-            @RequestBody WebsitDispatchRe websitDispatchRe
-    ) {
-        List<DispatchCherVO> dispatchCherVOS = changeOrderLogic.channel(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
-                websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
 
-        return ResponseHelper.success(dispatchCherVOS);
-    }
 
     @PostMapping("/smallList")
     @ApiOperation(value = "工单类型")
@@ -206,8 +196,8 @@ public class DispatchController {
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
                 .smallList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                        websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
-                        websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+                        websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getSaleIds(), websitDispatchRe.getOrderSmallId(),
+                        websitDispatchRe.getCategoryId());
 
         return ResponseHelper.success(dispatchCherVOS);
     }
@@ -219,20 +209,20 @@ public class DispatchController {
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
                 .categoryList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                        websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
-                        websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+                        websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getSaleIds(), websitDispatchRe.getOrderSmallId(),
+                        websitDispatchRe.getCategoryId());
         return ResponseHelper.success(dispatchCherVOS);
     }
 
-    @PostMapping("/sourceList")
-    @ApiOperation(value = "工单来源")
+    @PostMapping("/salesList")
+    @ApiOperation(value = "销售类型")
     public ResponseHelper sourceList(
             @RequestBody WebsitDispatchRe websitDispatchRe
     ) {
         List<DispatchCherVO> dispatchCherVOS = changeOrderLogic
                 .sourceList(websitDispatchRe.getProvinceCode(), websitDispatchRe.getCityCode(),
-                        websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getDictCode(), websitDispatchRe.getOrderSmallId(),
-                        websitDispatchRe.getCategoryId(), websitDispatchRe.getOrderSmallId());
+                        websitDispatchRe.getAreaCode(), websitDispatchRe.getStreetCode(), websitDispatchRe.getSaleIds(), websitDispatchRe.getOrderSmallId(),
+                        websitDispatchRe.getCategoryId());
         return ResponseHelper.success(dispatchCherVOS);
     }
 

+ 23 - 0
mall-server-api/src/main/java/com/gree/mall/manager/enums/NoticeWebsitEnum.java

@@ -0,0 +1,23 @@
+package com.gree.mall.manager.enums;
+
+import com.gree.mall.manager.enums.base.BaseEnum;
+import lombok.AccessLevel;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor(access = AccessLevel.PRIVATE)
+public enum NoticeWebsitEnum implements BaseEnum {
+    GL("GL","管理通知"),
+
+    JS("JS","技术通知"),
+
+    QT("QT","其他通知"),
+    ZC("ZC","政策通知"),
+    ZX("ZX","技术资讯"),
+            ;
+
+
+    private final String key;
+    private final String remark;
+}

+ 20 - 0
mall-server-api/src/main/java/com/gree/mall/manager/enums/NoticeWebsitStatusEnum.java

@@ -0,0 +1,20 @@
+package com.gree.mall.manager.enums;
+
+import com.gree.mall.manager.enums.base.BaseEnum;
+import lombok.AccessLevel;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor(access = AccessLevel.PRIVATE)
+public enum  NoticeWebsitStatusEnum implements BaseEnum {
+    SEND("SEND", "已发布"),
+
+    OFF("OFF", "已关闭"),
+
+    ;
+
+
+    private final String key;
+    private final String remark;
+}

+ 47 - 39
mall-server-api/src/main/java/com/gree/mall/manager/logic/big/BigLogic.java

@@ -85,6 +85,23 @@ public class BigLogic {
     @Autowired
     WebsitUserService websitUserService;
 
+    @Autowired
+    WebsitPartsSalesService websitPartsSalesService;
+
+
+
+    @Autowired
+    WebsitPartsNewRefundManageService websitPartsNewRefundManageService;
+
+    @Autowired
+    WebsitPartsNewRefundManageItemService websitPartsNewRefundManageItemService;
+
+    @Autowired
+    WebsitPartsOldRefundManageService websitPartsOldRefundManageService;
+
+    @Autowired
+    WebsitPartsOldRefundManageItemService websitPartsOldRefundManageItemService;
+
 
     public String getRegion(String country, String province, String city, String area) {
 
@@ -424,9 +441,13 @@ public class BigLogic {
                 item.getGoodsType().equals("M")
         ).count()));
 
-        largeMpBean.setPjxs(Convert.toInt(websitSales.stream().filter(item ->
-                item.getGoodsType().equals("P")
-        ).count()));
+
+        List<WebsitPartsSales> websitPartsSales = websitPartsSalesService.lambdaQuery().in(!StringUtil.isEmpty(adminUser.getCompanyWechatId()), WebsitPartsSales::getCompanyWechatId, adminUser.getCompanyWechatId())
+                .in(!CollectionUtils.isEmpty(websitIds) && !adminUser.getIsMaster(), WebsitPartsSales::getWebsitId, websitIds)
+                .eq(WebsitPartsSales::getDel, false)
+                .select(WebsitPartsSales::getId).list();
+
+        largeMpBean.setPjxs(Convert.toInt(websitPartsSales.stream().count()));
 
 
         List<WebsitSalesRet> websitSalesRets = websitSalesRetService.lambdaQuery()
@@ -441,52 +462,39 @@ public class BigLogic {
         ).count()));
 
 
-        largeMpBean.setPjth(Convert.toInt(websitSalesRets.stream().filter(item ->
-                item.getGoodsType().equals("P")
-        ).count()));
-
-
-        List<WebsitPartsRet> websitPartsRets = websitPartsRetService.lambdaQuery()
-                .in(!StringUtil.isEmpty(adminUser.getCompanyWechatId()), WebsitPartsRet::getCompanyWechatId, adminUser.getCompanyWechatId())
-                .in(!CollectionUtils.isEmpty(websitIds)  && !adminUser.getIsMaster(), WebsitPartsRet::getWebsitId, websitIds)
-                .eq(WebsitPartsRet::getFlag, "SUBMIT")
-                .between(WebsitPartsRet::getCreateTime, DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -30), new Date())
-                .select(WebsitPartsRet::getFlag, WebsitPartsRet::getGoodsType, WebsitPartsRet::getPartsRetId, WebsitPartsRet::getType)
-                .list();
-
-        List<String> partRetIds = websitPartsRets.stream().map(WebsitPartsRet::getPartsRetId).collect(Collectors.toList());
+        List<WebsitPartsNewRefundManage> websitPartsNewRefundManages = websitPartsNewRefundManageService.lambdaQuery()
+                .in(!StringUtil.isEmpty(adminUser.getCompanyWechatId()), WebsitPartsNewRefundManage::getCompanyWechatId, adminUser.getCompanyWechatId())
+                .in(!CollectionUtils.isEmpty(websitIds) && !adminUser.getIsMaster(), WebsitPartsNewRefundManage::getReceiveWebsitId, websitIds)
+                .select(WebsitPartsNewRefundManage::getApplyNo).list();
 
-        if (!CollectionUtils.isEmpty(partRetIds)) {
+        List<String> partsNewIds = websitPartsNewRefundManages.stream().map(WebsitPartsNewRefundManage::getApplyNo).collect(Collectors.toList());
+        if (!CollectionUtils.isEmpty(partsNewIds)){
 
-            List<WebsitPartsRetItem> websitPartsRetItemList = websitPartsRetItemService.lambdaQuery()
-                    .in(WebsitPartsRetItem::getPartsRetId, partRetIds)
-                    .select(WebsitPartsRetItem::getNewRefundQty, WebsitPartsRetItem::getOldRefundQty, WebsitPartsRetItem::getPartsRetId).list();
+            List<WebsitPartsNewRefundManageItem> websitPartsNewRefundManageItems = websitPartsNewRefundManageItemService.lambdaQuery()
+                    .in(WebsitPartsNewRefundManageItem::getApplyNo, partsNewIds)
+                    .select(WebsitPartsNewRefundManageItem::getQty).list();
 
+            largeMpBean.setXjdfh(websitPartsNewRefundManageItems.stream()
+                    .map(WebsitPartsNewRefundManageItem::getQty).reduce(BigDecimal::add).orElse(Convert.toBigDecimal("0")));
 
-            List<String> partRetNewIds = websitPartsRets.stream()
-                    .filter(item -> item.getType().equals("NEW"))
-                    .map(WebsitPartsRet::getPartsRetId).collect(Collectors.toList());
+        }
 
-            largeMpBean.setXjdfh(websitPartsRetItemList.stream().filter(item -> partRetNewIds.contains(item.getPartsRetId()))
-                    .map(WebsitPartsRetItem::getNewRefundQty).reduce(BigDecimal::add).orElse(Convert.toBigDecimal("0"))
-            );
 
-            List<String> partRetOldIds = websitPartsRets.stream()
-                    .filter(item -> item.getType().equals("OLD"))
-                    .map(WebsitPartsRet::getPartsRetId).collect(Collectors.toList());
 
-            largeMpBean.setJjdfh(websitPartsRetItemList.stream().filter(item -> partRetOldIds.contains(item.getPartsRetId()))
-                    .map(WebsitPartsRetItem::getOldRefundQty).reduce(BigDecimal::add).orElse(Convert.toBigDecimal("0"))
-            );
+        List<WebsitPartsOldRefundManage> websitPartsOldRefundManages = websitPartsOldRefundManageService.lambdaQuery()
+                .in(!StringUtil.isEmpty(adminUser.getCompanyWechatId()), WebsitPartsOldRefundManage::getCompanyWechatId, adminUser.getCompanyWechatId())
+                .in(!CollectionUtils.isEmpty(websitIds) && !adminUser.getIsMaster(), WebsitPartsOldRefundManage::getReceiveWebsitId, websitIds)
+                .select(WebsitPartsOldRefundManage::getApplyNo).list();
 
+        List<String> partsOldIds = websitPartsOldRefundManages.stream().map(WebsitPartsOldRefundManage::getApplyNo).collect(Collectors.toList());
+        if (!CollectionUtils.isEmpty(partsOldIds)){
 
-            List<String> partRetFaIds = websitPartsRets.stream()
-                    .filter(item -> item.getType().equals("FACTORY"))
-                    .map(WebsitPartsRet::getPartsRetId).collect(Collectors.toList());
+            List<WebsitPartsOldRefundManageItem> websitPartsOldRefundManageItems = websitPartsOldRefundManageItemService.lambdaQuery()
+                    .in(WebsitPartsOldRefundManageItem::getApplyNo, partsOldIds)
+                    .select(WebsitPartsOldRefundManageItem::getQty).list();
 
-            largeMpBean.setJjdfc(websitPartsRetItemList.stream().filter(item -> partRetFaIds.contains(item.getPartsRetId()))
-                    .map(WebsitPartsRetItem::getOldRefundQty).reduce(BigDecimal::add).orElse(Convert.toBigDecimal("0"))
-            );
+            largeMpBean.setJjdfh(websitPartsOldRefundManageItems.stream()
+                    .map(WebsitPartsOldRefundManageItem::getQty).reduce(BigDecimal::add).orElse(Convert.toBigDecimal("0")));
 
         }
 

+ 201 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/notice/NoticeWebsitLogic.java

@@ -0,0 +1,201 @@
+package com.gree.mall.manager.logic.notice;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.bean.admin.AdminUserCom;
+import com.gree.mall.manager.bean.notice.NoticeWebsitBean;
+import com.gree.mall.manager.bean.notice.NoticeWebsitRecordVO;
+import com.gree.mall.manager.bean.notice.NoticeWebsitVO;
+import com.gree.mall.manager.bean.workorder.WebsitDispatchVO;
+import com.gree.mall.manager.commonmapper.NoticeRecordBeanMapper;
+import com.gree.mall.manager.enums.IsYesNoEnum;
+import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.plus.entity.*;
+import com.gree.mall.manager.plus.service.AdminWebsitService;
+import com.gree.mall.manager.plus.service.NoticeWebsitRecordService;
+import com.gree.mall.manager.plus.service.NoticeWebsitService;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Service
+@Slf4j
+public class NoticeWebsitLogic {
+
+    @Autowired
+    CommonLogic commonLogic;
+
+    @Autowired
+    NoticeRecordBeanMapper noticeRecordMapper;
+
+    @Autowired
+    NoticeWebsitService noticeWebsitService;
+
+    @Autowired
+    AdminWebsitService adminWebsitService;
+
+    @Autowired
+    NoticeWebsitRecordService noticeWebsitRecordService;
+
+
+    public IPage<NoticeWebsitVO> list(Page page, ZfireParamBean zfireParam) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        //1.组装查询条件
+        zfireParam = FieldUtils.supplyParam(zfireParam, NoticeWebsitVO.class,adminUser);
+
+        IPage<NoticeWebsitVO> websitDispatchVOIPage = noticeRecordMapper.listNoticeWebsit(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam, adminCompanyIds);
+
+        return websitDispatchVOIPage;
+    }
+
+    public NoticeWebsit detail(String id) {
+        NoticeWebsit noticeWebsit = noticeWebsitService.getById(id);
+        return noticeWebsit;
+    }
+
+    public void add(NoticeWebsitBean noticeBean) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        noticeBean.setCompanyWechatId(adminUser.getCompanyWechatId());
+        noticeBean.setIssueNickName(adminUser.getNickName());
+        noticeBean.setIssueTime(new Date());
+        noticeBean.setIssueUserId(adminUser.getAdminUserId());
+        noticeBean.setCompanyWechatName(adminUser.getCompanyName());
+        noticeBean.insert();
+
+        List<NoticeWebsitRecord> noticeWebsitRecords = new ArrayList<>();
+
+
+        for (String websitId : noticeBean.getWebsitIds()) {
+            AdminWebsit adminWebsit = adminWebsitService.getById(websitId);
+            NoticeWebsitRecord noticeWebsitRecord = new NoticeWebsitRecord();
+            noticeWebsitRecord.setNoticeWebsitId(noticeBean.getNoticeWebsitId());
+            noticeWebsitRecord.setAdminWebsitId(websitId);
+            noticeWebsitRecord.setAdminWebsitName(adminWebsit.getName());
+            noticeWebsitRecord.setCompanyWechatId(adminUser.getCompanyWechatId());
+            noticeWebsitRecord.setCompanyWechatName(adminUser.getCompanyName());
+
+
+            noticeWebsitRecords.add(noticeWebsitRecord);
+        }
+
+        noticeWebsitRecordService.saveBatch(noticeWebsitRecords);
+    }
+
+    public void update(NoticeWebsitBean noticeBean) {
+
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        noticeBean.setCompanyWechatId(adminUser.getCompanyWechatId());
+        noticeBean.setCompanyWechatName(adminUser.getCompanyName());
+        noticeBean.updateById();
+
+        List<NoticeWebsitRecord> noticeWebsitRecords = new ArrayList<>();
+
+        noticeWebsitRecordService.lambdaUpdate()
+                .eq(NoticeWebsitRecord::getNoticeWebsitId,noticeBean.getNoticeWebsitId())
+                .remove();
+
+        for (String websitId : noticeBean.getWebsitIds()) {
+            AdminWebsit adminWebsit = adminWebsitService.getById(websitId);
+            NoticeWebsitRecord noticeWebsitRecord = new NoticeWebsitRecord();
+            noticeWebsitRecord.setAdminWebsitId(websitId);
+            noticeWebsitRecord.setNoticeWebsitId(noticeBean.getNoticeWebsitId());
+            noticeWebsitRecord.setAdminWebsitName(adminWebsit.getName());
+            noticeWebsitRecord.setCompanyWechatId(adminUser.getCompanyWechatId());
+            noticeWebsitRecord.setCompanyWechatName(adminUser.getCompanyName());
+
+            noticeWebsitRecords.add(noticeWebsitRecord);
+        }
+
+        noticeWebsitRecordService.saveBatch(noticeWebsitRecords);
+    }
+
+    public void ofOrSend(String id, String status) {
+        NoticeWebsit noticeWebsit = noticeWebsitService.getById(id);
+        noticeWebsit.setStatus(status);
+        noticeWebsit.updateById();
+    }
+
+    public IPage<NoticeWebsitRecordVO> listWebsit(Page page, ZfireParamBean zfireParam) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        //1.组装查询条件
+        zfireParam = FieldUtils.supplyParam(zfireParam, NoticeWebsitRecordVO.class,adminUser);
+
+        IPage<NoticeWebsitRecordVO> noticeWebsitRecordVOIPage = noticeRecordMapper.listWebsit(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam, adminCompanyIds);
+
+        return noticeWebsitRecordVOIPage;
+    }
+
+    public Object unreadCount(HttpServletRequest request, String readFlag) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        Integer count = noticeWebsitRecordService.lambdaQuery()
+                .eq(NoticeWebsitRecord::getReadFlag, readFlag)
+                .in(!CollectionUtils.isEmpty(adminUser.getAdminWebsitIds()),NoticeWebsitRecord::getAdminWebsitId, adminUser.getAdminWebsitIds())
+                .count();
+
+        return count;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void markRead(List<String> noticeIds) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        noticeWebsitRecordService.lambdaUpdate()
+                .in(NoticeWebsitRecord::getNoticeWebsitId,noticeIds)
+                .in(!CollectionUtils.isEmpty(adminUser.getAdminWebsitIds()),NoticeWebsitRecord::getAdminWebsitId, adminUser.getAdminWebsitIds())
+                .set(NoticeWebsitRecord::getReadFlag, IsYesNoEnum.YES.getKey())
+                .set(NoticeWebsitRecord::getReadTime, new Date())
+                .update();
+
+        for (String id : noticeIds) {
+
+
+            NoticeWebsit one = noticeWebsitService.getById(id);
+            if (one != null){
+                one.setNum(one.getNum()+1);
+                one.updateById();
+            }
+        }
+
+
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void markReadAll(HttpServletRequest request) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        if (!CollectionUtils.isEmpty(adminUser.getAdminWebsitIds())) {
+
+            List<NoticeWebsitRecord> list = noticeWebsitRecordService.lambdaQuery()
+                    .in(!CollectionUtils.isEmpty(adminUser.getAdminWebsitIds()), NoticeWebsitRecord::getAdminWebsitId, adminUser.getAdminWebsitIds())
+                    .list();
+            for (NoticeWebsitRecord websitRecord : list) {
+
+
+                NoticeWebsit one = noticeWebsitService.getById(websitRecord.getNoticeWebsitId());
+                if (one != null){
+                    one.setNum(one.getNum()+1);
+                    one.updateById();
+                }
+            }
+
+            noticeWebsitRecordService.lambdaUpdate()
+                    .in(!CollectionUtils.isEmpty(adminUser.getAdminWebsitIds()), NoticeWebsitRecord::getAdminWebsitId, adminUser.getAdminWebsitIds())
+                    .set(NoticeWebsitRecord::getReadFlag, IsYesNoEnum.YES.getKey())
+                    .set(NoticeWebsitRecord::getReadTime, new Date())
+                    .update();
+        }
+    }
+}

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

@@ -22,6 +22,7 @@ import com.gree.mall.manager.utils.excel.ExcelUtils;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import lombok.SneakyThrows;
+import lombok.extern.log4j.Log4j;
 import org.apache.http.client.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -42,6 +43,7 @@ import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
+@Log4j
 public class AgreementLogic {
 
     @Autowired
@@ -250,7 +252,8 @@ public class AgreementLogic {
 
     public void sendEmail(String sendBatch) throws IOException {
         MailboxSendRecord mailboxSendRecord = mailboxSendRecordService.getById(sendBatch);
-        List<MailboxSendRecordPolicy> mailboxSendRecordPolicies = mailboxSendRecordPolicyService.lambdaQuery().eq(MailboxSendRecordPolicy::getSendBatch, sendBatch).list();
+        List<MailboxSendRecordPolicy> mailboxSendRecordPolicies = mailboxSendRecordPolicyService.lambdaQuery()
+                .eq(MailboxSendRecordPolicy::getSendBatch, sendBatch).list();
 
         Mailbox mailbox = mailboxService.getById("1");
 
@@ -267,9 +270,12 @@ public class AgreementLogic {
             try {
                 this.sendEmailFile(mailboxSendRecordPolicies, mailboxSendRecord, mailbox,emailUtilsNew);
                 mailboxSendRecord.setSendStatus("OK");
+                mailboxSendRecord.setSendTime(new Date());
                 mailboxSendRecord.updateById();
             } catch (Exception e) {
+                log.error("发送意外保险失败"+e.toString());
                 mailboxSendRecord.setSendStatus("NO");
+                mailboxSendRecord.setSendTime(new Date());
                 mailboxSendRecord.updateById();
             }
         }
@@ -280,9 +286,12 @@ public class AgreementLogic {
             try {
                 this.sendEmailFileEm(mailboxSendRecordPolicies, mailboxSendRecord, mailbox,emailUtilsNew);
                 mailboxSendRecord.setSendStatus("OK");
+                mailboxSendRecord.setSendTime(new Date());
                 mailboxSendRecord.updateById();
             } catch (Exception e) {
+                log.error("发送雇主保险失败"+e.toString());
                 mailboxSendRecord.setSendStatus("NO");
+                mailboxSendRecord.setSendTime(new Date());
                 mailboxSendRecord.updateById();
             }
         }
@@ -294,9 +303,12 @@ public class AgreementLogic {
             try {
                 this.sendEmailFileIn(mailboxSendRecordPolicies, mailboxSendRecord, mailbox,emailUtilsNew);
                 mailboxSendRecord.setSendStatus("OK");
+                mailboxSendRecord.setSendTime(new Date());
                 mailboxSendRecord.updateById();
             } catch (Exception e) {
+                log.error("发送工伤保险失败"+e.toString());
                 mailboxSendRecord.setSendStatus("NO");
+                mailboxSendRecord.setSendTime(new Date());
                 mailboxSendRecord.updateById();
             }
         }
@@ -554,15 +566,16 @@ public class AgreementLogic {
 
 
         Mailbox mailbox = mailboxService.getById("1");
+        Date date = new Date();
 
         //今天要发送的保单
-        Date endTime = DateUtil.parseDateTime(DateUtils.formatDate(new Date(),"yyyy-MM-dd") +" "+ mailbox.getSendTime()+":00");
-        if(new Date().getTime() < endTime.getTime()){
+        Date endTime = DateUtil.parseDateTime(DateUtils.formatDate(date,"yyyy-MM-dd") +" "+ mailbox.getSendTime()+":00");
+        if(date.getTime() < endTime.getTime()){
             //还没到可发邮件的时间
             return;
         }
 
-        if (mailboxSendRecordService.lambdaQuery().gt(MailboxSendRecord::getSendTime, DateUtil.beginOfDay(new Date())).count() > 0) {
+        if (mailboxSendRecordService.lambdaQuery().gt(MailboxSendRecord::getSendTime, DateUtil.beginOfDay(date)).count() > 0) {
             return;
         }
 
@@ -1087,16 +1100,16 @@ public class AgreementLogic {
 
 
         Mailbox mailbox = mailboxService.getById("1");
-
+        Date date = new Date();
         //今天要发送的保单
         //Date startTime = DateUtil.beginOfDay(new Date());
-        Date endTime = DateUtil.parseDateTime(DateUtils.formatDate(new Date(),"yyyy-MM-dd") +" "+ mailbox.getSendTime()+":00");
-        if(new Date().getTime() < endTime.getTime()){
+        Date endTime = DateUtil.parseDateTime(DateUtils.formatDate(date,"yyyy-MM-dd") +" "+ mailbox.getSendTime()+":00");
+        if(date.getTime() < endTime.getTime()){
             //还没到可发邮件的时间
             return;
         }
 
-        if (mailboxSendRecordService.lambdaQuery().gt(MailboxSendRecord::getSendTime, DateUtil.beginOfDay(new Date())).count() > 0) {
+        if (mailboxSendRecordService.lambdaQuery().gt(MailboxSendRecord::getSendTime, DateUtil.beginOfDay(date)).count() > 0) {
             return;
         }
 
@@ -1278,16 +1291,16 @@ public class AgreementLogic {
     public void sendEmailScheIN() {
 
         Mailbox mailbox = mailboxService.getById("1");
-
+        Date date = new Date();
         //今天要发送的保单
         //Date startTime = DateUtil.beginOfDay(new Date());
-        Date endTime = DateUtil.parseDateTime(DateUtils.formatDate(new Date(),"yyyy-MM-dd") +" "+ mailbox.getSendTime()+":00");
-        if(new Date().getTime() < endTime.getTime()){
+        Date endTime = DateUtil.parseDateTime(DateUtils.formatDate(date,"yyyy-MM-dd") +" "+ mailbox.getSendTime()+":00");
+        if(date.getTime() < endTime.getTime()){
             //还没到可发邮件的时间
             return;
         }
 
-        if (mailboxSendRecordService.lambdaQuery().gt(MailboxSendRecord::getSendTime, DateUtil.beginOfDay(new Date())).count() > 0) {
+        if (mailboxSendRecordService.lambdaQuery().gt(MailboxSendRecord::getSendTime, DateUtil.beginOfDay(date)).count() > 0) {
             return;
         }
 

+ 84 - 19
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/ChangeOrderLogic.java

@@ -18,6 +18,7 @@ import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.logic.common.SysDictCompanyLogic;
 import com.gree.mall.manager.plus.entity.*;
 import com.gree.mall.manager.plus.service.*;
+import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.utils.excel.ExcelUtils;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
@@ -176,9 +177,27 @@ public class ChangeOrderLogic {
 
         }
 
+        List<String> orderIds = new ArrayList<>();
+
+        for (String id : ids) {
+            PgOrderBase pgOrderBase = pgOrderBaseService.getById(id);
+
+            PgOrderProduct pgOrderProduct = pgOrderProductService.lambdaQuery().eq(PgOrderProduct::getOrderBaseId, id)
+                    .one();
+
+            if (websitDispatchService.lambdaQuery()
+                    .eq( WebsitDispatch::getStreetCode, pgOrderBase.getStreetId())
+                    .eq(WebsitDispatch::getSaleTypeId, pgOrderBase.getSaleType())
+                    .eq( WebsitDispatch::getCategoryId,pgOrderProduct.getMainId())
+                    .eq( WebsitDispatch::getOrderSmallId, pgOrderBase.getOrderSmallType())
+                    .eq(!StringUtil.isEmpty(websitId), WebsitDispatch::getWebsitId, websitId).count() > 0) {
+                orderIds.add(id);
+            }
+        }
+
 
         pgOrderBaseService.lambdaUpdate()
-                .in(PgOrderBase::getId, ids)
+                .in(PgOrderBase::getId, orderIds)
                 .set(PgOrderBase::getWorkerName, userOne.getNickName())
                 .set(PgOrderBase::getWebsitId, websitId)
                 .set(PgOrderBase::getWebsitName, adminWebsit.getName())
@@ -333,33 +352,33 @@ public class ChangeOrderLogic {
         return websitDispatchVOIPage;
     }
 
-    public List<DispatchCherVO> pList(String pId, String cityCode, String areaCode, String streetCode, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<String> orderSourceId) {
+    public List<DispatchCherVO> pList(String pId, String cityCode, String areaCode, String streetCode, List<String> sales, List<String> orderSmallId, List<String> categoryId) {
         //获取当前登录企业id
         AdminUserCom adminUser = commonLogic.getAdminUser();
 
         List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
-        return increMapper.pList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId, adminCompanyIds);
+        return increMapper.pList(pId, cityCode, areaCode, streetCode, sales, orderSmallId, categoryId, adminCompanyIds);
     }
 
-    public List<DispatchCherVO> cList(String pId, String cityCode, String areaCode, String streetCode, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<String> orderSourceId) {
+    public List<DispatchCherVO> cList(String pId, String cityCode, String areaCode, String streetCode, List<String> sales, List<String> orderSmallId, List<String> categoryId) {
         //获取当前登录企业id
         AdminUserCom adminUser = commonLogic.getAdminUser();
         List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
-        return increMapper.cList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId, adminCompanyIds);
+        return increMapper.cList(pId, cityCode, areaCode, streetCode, sales, orderSmallId, categoryId, adminCompanyIds);
     }
 
-    public List<DispatchCherVO> aList(String pId, String cityCode, String areaCode, String streetCode, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<String> orderSourceId) {
+    public List<DispatchCherVO> aList(String pId, String cityCode, String areaCode, String streetCode, List<String> sales, List<String> orderSmallId, List<String> categoryId) {
         //获取当前登录企业id
         AdminUserCom adminUser = commonLogic.getAdminUser();
         List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
-        return increMapper.aList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId, adminCompanyIds);
+        return increMapper.aList(pId, cityCode, areaCode, streetCode, sales, orderSmallId, categoryId, adminCompanyIds);
     }
 
-    public List<DispatchCherVO> sList(String pId, String cityCode, String areaCode, String streetCode, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<String> orderSourceId) {
+    public List<DispatchCherVO> sList(String pId, String cityCode, String areaCode, String streetCode, List<String> sales, List<String> orderSmallId, List<String> categoryId) {
         //获取当前登录企业id
         AdminUserCom adminUser = commonLogic.getAdminUser();
         List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
-        return increMapper.sList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId, adminCompanyIds);
+        return increMapper.sList(pId, cityCode, areaCode, streetCode, sales, orderSmallId, categoryId, adminCompanyIds);
     }
 
     public List<DispatchCherVO> channel(String pId, String cityCode, String areaCode, String streetCode, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<String> orderSourceId) {
@@ -369,25 +388,25 @@ public class ChangeOrderLogic {
         return increMapper.channel(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId, adminCompanyIds);
     }
 
-    public List<DispatchCherVO> smallList(String pId, String cityCode, String areaCode, String streetCode, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<String> orderSourceId) {
+    public List<DispatchCherVO> smallList(String pId, String cityCode, String areaCode, String streetCode, List<String> sales, List<String> orderSmallId, List<String> categoryId) {
         //获取当前登录企业id
         AdminUserCom adminUser = commonLogic.getAdminUser();
         List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
-        return increMapper.smallList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId, adminCompanyIds);
+        return increMapper.smallList(pId, cityCode, areaCode, streetCode, sales, orderSmallId, categoryId, adminCompanyIds);
     }
 
-    public List<DispatchCherVO> categoryList(String pId, String cityCode, String areaCode, String streetCode, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<String> orderSourceId) {
+    public List<DispatchCherVO> categoryList(String pId, String cityCode, String areaCode, String streetCode, List<String> sales, List<String> orderSmallId, List<String> categoryId) {
         //获取当前登录企业id
         AdminUserCom adminUser = commonLogic.getAdminUser();
         List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
-        return increMapper.categoryList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId, adminCompanyIds);
+        return increMapper.categoryList(pId, cityCode, areaCode, streetCode, sales, orderSmallId, categoryId, adminCompanyIds);
     }
 
-    public List<DispatchCherVO> sourceList(String pId, String cityCode, String areaCode, String streetCode, List<String> dictCode, List<String> orderSmallId, List<String> categoryId, List<String> orderSourceId) {
+    public List<DispatchCherVO> sourceList(String pId, String cityCode, String areaCode, String streetCode, List<String> sales, List<String> orderSmallId, List<String> categoryId) {
         //获取当前登录企业id
         AdminUserCom adminUser = commonLogic.getAdminUser();
         List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
-        return increMapper.sourceList(pId, cityCode, areaCode, streetCode, dictCode, orderSmallId, categoryId, orderSourceId, adminCompanyIds);
+        return increMapper.sourceList(pId, cityCode, areaCode, streetCode, sales, orderSmallId, categoryId, adminCompanyIds);
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -406,7 +425,7 @@ public class ChangeOrderLogic {
 
                 GoodsCategory goodsCategory = goodsCategoryService.getById(categoryId);
 
-                for (String salesId : websitDispatchAdd.getCategoryIds()) {
+                for (String salesId : websitDispatchAdd.getSaleIds()) {
 
                     SysDictCompany sales = sysDictCompanyService.lambdaQuery().eq(SysDictCompany::getDictCode, salesId).last("limit 1").one();
 
@@ -540,8 +559,8 @@ public class ChangeOrderLogic {
                             websitDispatch.setCategoryId(goodsCategory.getCategoryId());
                             websitDispatch.setCategoryName(goodsCategory.getName());
 
-                            websitDispatch.setSaleTypeName(saleOne.getDictCode());
-                            websitDispatch.setSaleTypeId(saleOne.getDictValue());
+                            websitDispatch.setSaleTypeName(saleOne.getDictValue());
+                            websitDispatch.setSaleTypeId(saleOne.getDictCode());
 
 
                             if (websitDispatchService.lambdaQuery().eq(WebsitDispatch::getStreetCode, region.getId())
@@ -550,7 +569,7 @@ public class ChangeOrderLogic {
                                     .eq(WebsitDispatch::getSaleTypeId, websitDispatch.getSaleTypeId())
                                     .count() > 0) {
                                 throw new RemoteServiceException("存在街道:" + websitDispatch.getStreetName() + ",产品大类:" + websitDispatch.getCategoryName() +
-                                        ",承接渠道:" + websitDispatch.getSaleTypeName() + ",工单类型:" + websitDispatch.getOrderSmallTypeText());
+                                        ",销量类型:" + websitDispatch.getSaleTypeName() + ",工单类型:" + websitDispatch.getOrderSmallTypeText());
                             }
 
                             websitDispatches.add(websitDispatch);
@@ -587,4 +606,50 @@ public class ChangeOrderLogic {
 
         return websitDispatchService.getById(id);
     }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void changWebsit(List<String> ids) {
+
+        List<String> orderIds = new ArrayList<>();
+
+        for (String id : ids) {
+            PgOrderBase pgOrderBase = pgOrderBaseService.getById(id);
+
+            PgOrderProduct pgOrderProduct = pgOrderProductService.lambdaQuery().eq(PgOrderProduct::getOrderBaseId, id)
+                    .one();
+
+            if (!StringUtils.equalsAny(pgOrderBase.getOrderStatus(),"DSHPG","CJ","YPD","DXSPD","DZBPG","DWDSPGP","DXSSPGP","DTJXSSPGP","DZBSPGP","DFZXPD","DFZXSPGP")){
+                continue;
+            }
+
+            if (websitDispatchService.lambdaQuery()
+                    .eq( WebsitDispatch::getStreetCode, pgOrderBase.getStreetId())
+                    .eq(WebsitDispatch::getSaleTypeId, pgOrderBase.getSaleType())
+                    .eq( WebsitDispatch::getCategoryId,pgOrderProduct.getMainId())
+                    .eq( WebsitDispatch::getOrderSmallId, pgOrderBase.getOrderSmallType())
+                    .count() > 0) {
+
+                WebsitDispatch websitDispatch = websitDispatchService.lambdaQuery()
+                        .eq(WebsitDispatch::getStreetCode, pgOrderBase.getStreetId())
+                        .eq(WebsitDispatch::getSaleTypeId, pgOrderBase.getSaleType())
+                        .eq(WebsitDispatch::getCategoryId, pgOrderProduct.getMainId())
+                        .eq(WebsitDispatch::getOrderSmallId, pgOrderBase.getOrderSmallType())
+                        .last("limit 1").one();
+
+
+
+                pgOrderBase.setWebsitId(websitDispatch.getWebsitId());
+                pgOrderBase.setOrderStatus(OrderBaseStatusEnum.DWDPG.getKey());
+                pgOrderBase.setOrderStatusText(OrderBaseStatusEnum.DWDPG.getRemark());
+                pgOrderBase.setWebsitName(websitDispatch.getWebsitName());
+                pgOrderBase.setDispatchWebsitTime(new Date());
+                pgOrderBase.updateById();
+
+                orderLogLogic.addLog(pgOrderBase.getId(), "指派网点", "自动派工给网点【" +(pgOrderBase.getWebsitId())+ pgOrderBase.getWebsitName() + "】", pgOrderBase.getWebsitName());
+
+
+
+            }
+        }
+    }
 }

+ 44 - 0
mall-server-api/src/main/resources/mapper/NoticeRecordBeanMapper.xml

@@ -81,5 +81,49 @@
         </if>
 
     </select>
+    <select id="listNoticeWebsit" resultType="com.gree.mall.manager.bean.notice.NoticeWebsitVO">
+        SELECT
+        a.*
+        FROM
+        notice_websit a
+        ${ex.query}
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            and a.company_wechat_id  in
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator=","
+                     close=")">
+                #{item}
+            </foreach>
+        </if>
+        ${ex.orderBy}
+        <if test="ex.orderBy == null or  ex.orderBy == ''">
+            order by a.create_time desc
+        </if>
+    </select>
+    <select id="listWebsit" resultType="com.gree.mall.manager.bean.notice.NoticeWebsitRecordVO">
+        SELECT
+        a.*,
+        b.*
+        FROM
+        notice_websit a
+        join notice_websit_record b on a.notice_websit_id = b.notice_websit_id
+        ${ex.query}
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            and a.company_wechat_id  in
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator=","
+                     close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
+            AND b.admin_websit_id IN
+            <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        ${ex.orderBy}
+        <if test="ex.orderBy == null or  ex.orderBy == ''">
+            order by a.create_time desc
+        </if>
+    </select>
 
 </mapper>

+ 36 - 124
mall-server-api/src/main/resources/mapper/workorder/IncreMapper.xml

@@ -92,7 +92,7 @@
         a.province_code as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
+        join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -113,14 +113,7 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
-        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
-            AND e.company_wechat_id IN
-            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND f.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -145,7 +138,7 @@
         <if test="streetCode != null and streetCode !=''">
             AND a.id =  #{streetCode}
         </if>
-        <if test="dictCode != null and dictCode.size > 0">
+        <if test="sales != null and sales.size > 0">
             AND b.dict_code IN
             <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
                 #{item}
@@ -163,12 +156,6 @@
                 #{item}
             </foreach>
         </if>
-        <if test="orderSourceId != null and orderSourceId.size > 0">
-            AND e.dict_code in
-            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
 
      group by a.province_code
     </select>
@@ -178,7 +165,7 @@
         a.city_code as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
+        join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -199,14 +186,8 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
-        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
-            AND e.company_wechat_id IN
-            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND f.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -231,7 +212,7 @@
         <if test="streetCode != null and streetCode !=''">
             AND a.id =  #{streetCode}
         </if>
-        <if test="dictCode != null and dictCode.size > 0">
+        <if test="sales != null and sales.size > 0">
             AND b.dict_code IN
             <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
                 #{item}
@@ -249,12 +230,7 @@
                 #{item}
             </foreach>
         </if>
-        <if test="orderSourceId != null and orderSourceId.size > 0">
-            AND e.dict_code in
-            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
+
 
         group by a.city_code
     </select>
@@ -264,7 +240,7 @@
         a.area_code as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
+        join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -285,14 +261,8 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
-        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
-            AND e.company_wechat_id IN
-            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND f.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -317,7 +287,7 @@
         <if test="streetCode != null and streetCode !=''">
             AND a.id =  #{streetCode}
         </if>
-        <if test="dictCode != null and dictCode.size > 0">
+        <if test="sales != null and sales.size > 0">
             AND b.dict_code IN
             <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
                 #{item}
@@ -335,13 +305,6 @@
                 #{item}
             </foreach>
         </if>
-        <if test="orderSourceId != null and orderSourceId.size > 0">
-            AND e.dict_code in
-            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-
         group by a.area_code
     </select>
     <select id="sList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
@@ -350,7 +313,7 @@
         a.id as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
+        join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -371,14 +334,8 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
-        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
-            AND e.company_wechat_id IN
-            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND f.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -403,7 +360,7 @@
         <if test="streetCode != null and streetCode !=''">
             AND a.id =  #{streetCode}
         </if>
-        <if test="dictCode != null and dictCode.size > 0">
+        <if test="sales != null and sales.size > 0">
             AND b.dict_code IN
             <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
                 #{item}
@@ -421,12 +378,6 @@
                 #{item}
             </foreach>
         </if>
-        <if test="orderSourceId != null and orderSourceId.size > 0">
-            AND e.dict_code in
-            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
 
         group by a.id
     </select>
@@ -457,14 +408,8 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
-        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
-            AND e.company_wechat_id IN
-            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND f.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -522,7 +467,7 @@
         c.id as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
+        join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -543,14 +488,8 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
-        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
-            AND e.company_wechat_id IN
-            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND f.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -575,7 +514,7 @@
         <if test="streetCode != null and streetCode !=''">
             AND a.id =  #{streetCode}
         </if>
-        <if test="dictCode != null and dictCode.size > 0">
+        <if test="sales != null and sales.size > 0">
             AND b.dict_code IN
             <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
                 #{item}
@@ -593,12 +532,7 @@
                 #{item}
             </foreach>
         </if>
-        <if test="orderSourceId != null and orderSourceId.size > 0">
-            AND e.dict_code in
-            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
+
 
         group by c.id
     </select>
@@ -608,7 +542,7 @@
         d.category_id as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
+        join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -629,14 +563,8 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
-        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
-            AND e.company_wechat_id IN
-            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND f.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -661,7 +589,7 @@
         <if test="streetCode != null and streetCode !=''">
             AND a.id =  #{streetCode}
         </if>
-        <if test="dictCode != null and dictCode.size > 0">
+        <if test="sales != null and sales.size > 0">
             AND b.dict_code IN
             <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
                 #{item}
@@ -679,22 +607,17 @@
                 #{item}
             </foreach>
         </if>
-        <if test="orderSourceId != null and orderSourceId.size > 0">
-            AND e.dict_code in
-            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
+
 
         group by d.category_id
     </select>
     <select id="sourceList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
         SELECT
-        e.dict_value as valueName,
-        e.dict_code as keyId
+        b.dict_value as valueName,
+        b.dict_code as keyId
         FROM
         region a
-        join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
+        join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND b.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -715,14 +638,8 @@
                 #{item}
             </foreach>
         </if>
-        join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
-        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
-            AND e.company_wechat_id IN
-            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
+
+        LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.sale_type_id and c.id = f.order_small_id and d.category_id = f.category_id
         <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
             AND f.company_wechat_id IN
             <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
@@ -747,7 +664,7 @@
         <if test="streetCode != null and streetCode !=''">
             AND a.id =  #{streetCode}
         </if>
-        <if test="dictCode != null and dictCode.size > 0">
+        <if test="sales != null and sales.size > 0">
             AND b.dict_code IN
             <foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
                 #{item}
@@ -765,14 +682,9 @@
                 #{item}
             </foreach>
         </if>
-        <if test="orderSourceId != null and orderSourceId.size > 0">
-            AND e.dict_code in
-            <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
 
-        group by  e.dict_code
+
+        group by  b.dict_code
     </select>
     <select id="listAbnormal" resultType="com.gree.mall.manager.bean.workorder.AbnormalVO">
         SELECT

BIN
mall-server-api/src/main/resources/template/自动派工配置.xlsx


BIN
mall-server-api/src/main/resources/template/质保金新增模板.xlsx


BIN
mall-server-api/src/main/resources/template/质保金缴费模板.xlsx