浏览代码

Merge remote-tracking branch 'origin/master' into ScrmStore

yjwang 16 小时之前
父节点
当前提交
bfd9fe10b8
共有 48 个文件被更改,包括 1215 次插入40 次删除
  1. 84 0
      fs-admin/src/main/java/com/fs/crm/controller/CrmCustomerLevelController.java
  2. 7 1
      fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java
  3. 23 0
      fs-company/src/main/java/com/fs/company/controller/crm/CrmCustomerController.java
  4. 40 0
      fs-company/src/main/java/com/fs/company/controller/crm/CrmCustomerLevelController.java
  5. 2 2
      fs-company/src/main/java/com/fs/company/controller/qw/QwExternalContactController.java
  6. 1 1
      fs-company/src/main/resources/application.yml
  7. 9 0
      fs-qw-task/src/main/java/com/fs/app/controller/CommonController.java
  8. 1 1
      fs-service/src/main/java/com/fs/course/mapper/FsCourseRedPacketLogMapper.java
  9. 11 4
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java
  10. 28 0
      fs-service/src/main/java/com/fs/crm/domain/CrmCustomerLevel.java
  11. 18 0
      fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerLevelMapper.java
  12. 3 0
      fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerMapper.java
  13. 26 0
      fs-service/src/main/java/com/fs/crm/param/CrmCustomerLevelParm.java
  14. 11 0
      fs-service/src/main/java/com/fs/crm/param/CrmCustomerLevelQueryParam.java
  15. 2 1
      fs-service/src/main/java/com/fs/crm/param/CrmMyCustomerListQueryParam.java
  16. 40 0
      fs-service/src/main/java/com/fs/crm/service/ICrmCustomerLevelService.java
  17. 2 0
      fs-service/src/main/java/com/fs/crm/service/ICrmCustomerService.java
  18. 102 0
      fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerLevelServiceImpl.java
  19. 28 0
      fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerServiceImpl.java
  20. 23 0
      fs-service/src/main/java/com/fs/crm/vo/CrmCustomerLevelVO.java
  21. 19 0
      fs-service/src/main/java/com/fs/crm/vo/CrmMyCustomerListQueryVO.java
  22. 4 1
      fs-service/src/main/java/com/fs/erp/service/impl/DfOrderServiceImpl.java
  23. 1 1
      fs-service/src/main/java/com/fs/his/mapper/FsCouponMapper.java
  24. 49 2
      fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java
  25. 2 0
      fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java
  26. 2 0
      fs-service/src/main/java/com/fs/his/param/FsStoreOrderParam.java
  27. 2 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java
  28. 5 0
      fs-service/src/main/java/com/fs/his/service/IFsUserService.java
  29. 47 6
      fs-service/src/main/java/com/fs/his/service/impl/FsExportTaskServiceImpl.java
  30. 5 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
  31. 6 0
      fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java
  32. 12 0
      fs-service/src/main/java/com/fs/his/vo/FsStoreOrderErpExportVO.java
  33. 1 1
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java
  34. 1 1
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStorePaymentScrmServiceImpl.java
  35. 17 8
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductCategoryScrmServiceImpl.java
  36. 1 0
      fs-service/src/main/java/com/fs/qw/param/ResignedTransferParam.java
  37. 1 0
      fs-service/src/main/java/com/fs/qw/param/TransferParam.java
  38. 1 1
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java
  39. 1 1
      fs-service/src/main/resources/application-config-druid-jnmy.yml
  40. 4 0
      fs-service/src/main/resources/application-config-myhk.yml
  41. 1 1
      fs-service/src/main/resources/application-dev.yml
  42. 3 3
      fs-service/src/main/resources/application-druid-jnmy-test.yml
  43. 4 2
      fs-service/src/main/resources/application-druid-zkzh.yml
  44. 17 0
      fs-service/src/main/resources/mapper/crm/CrmCustomerLevelMapper.xml
  45. 74 0
      fs-service/src/main/resources/mapper/crm/CrmCustomerMapper.xml
  46. 465 0
      fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml
  47. 7 0
      fs-user-app/src/main/java/com/fs/app/controller/UserController.java
  48. 2 2
      fs-user-app/src/main/java/com/fs/app/controller/WxH5MpController.java

+ 84 - 0
fs-admin/src/main/java/com/fs/crm/controller/CrmCustomerLevelController.java

@@ -0,0 +1,84 @@
+package com.fs.crm.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.crm.domain.CrmCustomerLevel;
+import com.fs.crm.param.CrmCustomerLevelParm;
+import com.fs.crm.param.CrmCustomerLevelQueryParam;
+import com.fs.crm.service.ICrmCustomerLevelService;
+import com.fs.crm.vo.CrmCustomerLevelVO;
+import com.fs.his.vo.OptionsVO;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/crm/customerLevel")
+@AllArgsConstructor
+public class CrmCustomerLevelController extends BaseController {
+
+    private final ICrmCustomerLevelService customerLevelService;
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CrmCustomerLevelQueryParam param) {
+        startPage();
+        List<CrmCustomerLevelVO> list = customerLevelService.selectCrmCustomerLevelVOList(param);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:add')")
+    @Log(title = "客户级别", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@Valid @RequestBody CrmCustomerLevelParm param) {
+        return toAjax(customerLevelService.saveCustomerLevel(param));
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:edit')")
+    @Log(title = "客户级别", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit(@Valid @RequestBody CrmCustomerLevelParm param) {
+        return toAjax(customerLevelService.editCustomerLevel(param));
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable Long id) {
+        return AjaxResult.success(customerLevelService.selectCrmCustomerLevelVOById(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:delete')")
+    @Log(title = "客户", businessType = BusinessType.DELETE)
+    @DeleteMapping("/delete/{ids}")
+    public AjaxResult delete(@PathVariable Long[] ids) {
+        customerLevelService.removeByIds(Arrays.asList(ids));
+        return AjaxResult.success();
+    }
+
+    @GetMapping("/getCustomerLevelOption")
+    public R getCustomerLevelOption(Integer status) {
+        LambdaQueryWrapper<CrmCustomerLevel> wrapper = Wrappers.lambdaQuery();
+        if (Objects.nonNull(status)) {
+            wrapper.eq(CrmCustomerLevel::getStatus, status);
+        }
+        List<OptionsVO> options = customerLevelService.list(wrapper).stream().map(l -> {
+            OptionsVO vo = new OptionsVO();
+            vo.setDictLabel(l.getName());
+            vo.setDictValue(l.getId());
+            return vo;
+        }).collect(Collectors.toList());
+        return R.ok().put("data", options);
+    }
+}

+ 7 - 1
fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java

@@ -201,7 +201,13 @@ public class FsStoreOrderController extends BaseController
             return AjaxResult.error("请筛选数据导出");
         }
         logger.info("tc>\n【咨询报告】:{}", SecurityUtils.getUserId());
-        Long count = fsStoreOrderService.selectFsStoreOrderListVOByExportCount(param);
+        Long count;
+        if (StringUtils.isNotBlank(param.getErpAccount())){
+            //金牛erp查询
+            count = fsStoreOrderService.selectFsStoreOrderListVOByErpAccountByExportCount(param);
+        } else {
+            count = fsStoreOrderService.selectFsStoreOrderListVOByExportCount(param);
+        }
         if (count>30000){
             return AjaxResult.error("导出数据不可超过3w条");
         }

+ 23 - 0
fs-company/src/main/java/com/fs/company/controller/crm/CrmCustomerController.java

@@ -112,6 +112,29 @@ public class CrmCustomerController extends BaseController
         }
         return R.ok().put("rows", list);
     }
+
+    @ApiOperation("获取我的协作客户列表")
+    @PreAuthorize("@ss.hasPermi('crm:customer:assistList')")
+    @GetMapping("/getMyAssistList")
+    public TableDataInfo getMyAssistList(CrmMyCustomerListQueryParam param){
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        param.setCompanyUserId(loginUser.getUser().getUserId());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCustomerCreateTime(param.getCreateTimeRange().split("--"));
+        }
+        List<CrmMyCustomerListQueryVO> list = crmCustomerService.selectCrmMyAssistListQuery(param);
+        if (list != null) {
+            for (CrmMyCustomerListQueryVO vo : list) {
+                if(vo.getMobile()!=null){
+                    vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+            }
+        }
+        return getDataTable(list);
+
+    }
     @ApiOperation("获取我的客户列表")
     @PreAuthorize("@ss.hasPermi('crm:customer:myList')")
     @GetMapping("/getMyCustomerList")

+ 40 - 0
fs-company/src/main/java/com/fs/company/controller/crm/CrmCustomerLevelController.java

@@ -0,0 +1,40 @@
+package com.fs.company.controller.crm;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.crm.domain.CrmCustomerLevel;
+import com.fs.crm.service.ICrmCustomerLevelService;
+import com.fs.his.vo.OptionsVO;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/crm/customerLevel")
+@AllArgsConstructor
+public class CrmCustomerLevelController extends BaseController {
+
+    private final ICrmCustomerLevelService customerLevelService;
+
+    @GetMapping("/getCustomerLevelOption")
+    public R getCustomerLevelOption(Integer status) {
+        LambdaQueryWrapper<CrmCustomerLevel> wrapper = Wrappers.lambdaQuery();
+        if (Objects.nonNull(status)) {
+            wrapper.eq(CrmCustomerLevel::getStatus, status);
+        }
+        List<OptionsVO> options = customerLevelService.list(wrapper).stream().map(l -> {
+            OptionsVO vo = new OptionsVO();
+            vo.setDictLabel(l.getName());
+            vo.setDictValue(l.getId());
+            return vo;
+        }).collect(Collectors.toList());
+        return R.ok().put("data", options);
+    }
+}

+ 2 - 2
fs-company/src/main/java/com/fs/company/controller/qw/QwExternalContactController.java

@@ -369,7 +369,7 @@ public class QwExternalContactController extends BaseController
     @PutMapping("/resignedTransfer")
     public R resignedTransfer(@RequestBody ResignedTransferParam param)
     {
-        if (ObjectUtil.isNotEmpty(param.getQwUserName())){
+        if (ObjectUtil.isNotEmpty(param.getQwUserName())&&ObjectUtil.isNotEmpty(param.getType())&&param.getType().equals("1")){
             QwExternalContactParam qwExternalContact =new QwExternalContactParam();
             qwExternalContact.setQwUserName(param.getQwUserName());
 
@@ -393,7 +393,7 @@ public class QwExternalContactController extends BaseController
     @PutMapping("/transfer")
     public R transfer(@RequestBody TransferParam param)
     {
-        if (ObjectUtil.isNotEmpty(param.getQwUserName())){
+        if (ObjectUtil.isNotEmpty(param.getQwUserName())&&ObjectUtil.isNotEmpty(param.getType())&&param.getType().equals("1")){
             QwExternalContactParam qwExternalContact =new QwExternalContactParam();
             qwExternalContact.setQwUserName(param.getQwUserName());
             LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());

+ 1 - 1
fs-company/src/main/resources/application.yml

@@ -11,4 +11,4 @@ spring:
 #    active: druid-yzt
 #    active: druid-myhk
 #    active: druid-sft
-    active: druid-hzyy
+    active: dev

+ 9 - 0
fs-qw-task/src/main/java/com/fs/app/controller/CommonController.java

@@ -143,6 +143,15 @@ public class CommonController {
         return R.ok();
     }
 
+    /**
+     * 查官方的执行结果
+     */
+    @GetMapping("/sopguanfantResult")
+    public R sopguanfantResult() throws Exception {
+        qwSopLogsService.qwSopLogsResultNew();
+        return R.ok();
+    }
+
 
     @GetMapping("/testMaterial")
     public void testMaterial() throws Exception {

+ 1 - 1
fs-service/src/main/java/com/fs/course/mapper/FsCourseRedPacketLogMapper.java

@@ -164,7 +164,7 @@ public interface FsCourseRedPacketLogMapper
             "WHERE create_time <= DATE_SUB(NOW(), INTERVAL 10 MINUTE)  -- 10 分钟前或更早\n" +
             "AND create_time >= DATE(NOW())  -- 但必须是今天\n" +
             "AND status = 0;")
-    List<FsCourseRedPacketLog> selectFail();
+    List<FsCourseRedPacketLog> selectFailAll();
 
     @Select("SELECT * FROM fs_course_red_packet_log WHERE status = 0 and create_time > DATE_SUB(NOW(), INTERVAL 2 day) and company_user_id =#{userId}")
     List<FsCourseRedPacketLog> selectFail(@Param("userId") Long userId);

+ 11 - 4
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -2181,10 +2181,17 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         List<FsUserCourseVideoPageListVO> vos = fsUserCourseVideoMapper.selectFsUserCourseVideoListByMap(params);
         // 项目
         List<SysDictData> courseProject = dictDataMapper.selectDictDataByType("sys_course_project");
-        vos.forEach(vo -> courseProject.stream()
-                .filter(c -> c.getDictValue().equals(vo.getProjectId().toString()))
-                .findFirst()
-                .ifPresent(c -> vo.setProjectName(c.getDictLabel())));
+        Map<String, String> projectMap = courseProject.stream()
+                .collect(Collectors.toMap(SysDictData::getDictValue, SysDictData::getDictLabel));
+        vos.forEach(vo -> {
+            if (vo.getProjectId() != null) {
+                String projectName = projectMap.get(vo.getProjectId().toString());
+                if (projectName != null) {
+                    vo.setProjectName(projectName);
+                }
+            }
+        });
+
         return vos;
     }
     /**

+ 28 - 0
fs-service/src/main/java/com/fs/crm/domain/CrmCustomerLevel.java

@@ -0,0 +1,28 @@
+package com.fs.crm.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@TableName("crm_customer_level")
+@Data
+public class CrmCustomerLevel {
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 级别名称
+     */
+    private String name;
+    /**
+     * 状态 0显示 1停用
+     */
+    private Integer status;
+    /**
+     * 序号
+     */
+    private Integer sort;
+}

+ 18 - 0
fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerLevelMapper.java

@@ -0,0 +1,18 @@
+package com.fs.crm.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.crm.domain.CrmCustomerLevel;
+import com.fs.crm.param.CrmCustomerLevelQueryParam;
+import com.fs.crm.vo.CrmCustomerLevelVO;
+
+import java.util.List;
+
+public interface CrmCustomerLevelMapper extends BaseMapper<CrmCustomerLevel> {
+
+    /**
+     * 查询客户级别列表
+     * @param param 参数
+     * @return  list
+     */
+    List<CrmCustomerLevelVO> selectCrmCustomerLevelVOList(CrmCustomerLevelQueryParam param);
+}

+ 3 - 0
fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerMapper.java

@@ -956,4 +956,7 @@ public interface CrmCustomerMapper extends BaseMapper<CrmCustomer> {
      */
     @Select("select user_id  from  fs_user where phone=#{remarkMobile} limit 1")
     Long selectFsUserByCrmMobile(String remarkMobile);
+
+    List<CrmMyCustomerListQueryVO> selectCrmMyAssistListQuery(@Param("maps") CrmMyCustomerListQueryParam param);
+
 }

+ 26 - 0
fs-service/src/main/java/com/fs/crm/param/CrmCustomerLevelParm.java

@@ -0,0 +1,26 @@
+package com.fs.crm.param;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+public class CrmCustomerLevelParm {
+    /**
+     * 主键ID
+     */
+    private Long id;
+    /**
+     * 级别名称
+     */
+    @NotBlank(message = "级别名称不能为空")
+    private String name;
+    /**
+     * 状态 0显示 1停用
+     */
+    private Integer status;
+    /**
+     * 序号
+     */
+    private Integer sort;
+}

+ 11 - 0
fs-service/src/main/java/com/fs/crm/param/CrmCustomerLevelQueryParam.java

@@ -0,0 +1,11 @@
+package com.fs.crm.param;
+
+import lombok.Data;
+
+@Data
+public class CrmCustomerLevelQueryParam {
+    /**
+     * 级别名称
+     */
+    private String name;
+}

+ 2 - 1
fs-service/src/main/java/com/fs/crm/param/CrmMyCustomerListQueryParam.java

@@ -93,5 +93,6 @@ public class CrmMyCustomerListQueryParam extends BaseQueryParam
     private Integer isHisOrder;
 
     private String corpId;
-
+    /** 客户级别 */
+    private Long customerLevel;
 }

+ 40 - 0
fs-service/src/main/java/com/fs/crm/service/ICrmCustomerLevelService.java

@@ -0,0 +1,40 @@
+package com.fs.crm.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.crm.domain.CrmCustomerLevel;
+import com.fs.crm.param.CrmCustomerLevelParm;
+import com.fs.crm.param.CrmCustomerLevelQueryParam;
+import com.fs.crm.vo.CrmCustomerLevelVO;
+
+import java.util.List;
+
+public interface ICrmCustomerLevelService extends IService<CrmCustomerLevel> {
+
+    /**
+     * 查询客户级别列表
+     * @param param 参数
+     * @return  list
+     */
+    List<CrmCustomerLevelVO> selectCrmCustomerLevelVOList(CrmCustomerLevelQueryParam param);
+
+    /**
+     * 新增客户级别
+     * @param param 参数
+     * @return 受影响行数
+     */
+    int saveCustomerLevel(CrmCustomerLevelParm param);
+
+    /**
+     * 修改客户级别
+     * @param param 参数
+     * @return 受影响行数
+     */
+    int editCustomerLevel(CrmCustomerLevelParm param);
+
+    /**
+     * 根据ID查询
+     * @param id id
+     * @return CrmCustomerLevelVO
+     */
+    CrmCustomerLevelVO selectCrmCustomerLevelVOById(Long id);
+}

+ 2 - 0
fs-service/src/main/java/com/fs/crm/service/ICrmCustomerService.java

@@ -163,4 +163,6 @@ public interface ICrmCustomerService
     List<JSONObject> selectCrmCustomerCycleCounts(Map<String, Object> map);
 
     void computePayMoney();
+
+    List<CrmMyCustomerListQueryVO> selectCrmMyAssistListQuery(CrmMyCustomerListQueryParam param);
 }

+ 102 - 0
fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerLevelServiceImpl.java

@@ -0,0 +1,102 @@
+package com.fs.crm.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.exception.CustomException;
+import com.fs.common.utils.bean.BeanUtils;
+import com.fs.crm.domain.CrmCustomerLevel;
+import com.fs.crm.mapper.CrmCustomerLevelMapper;
+import com.fs.crm.param.CrmCustomerLevelParm;
+import com.fs.crm.param.CrmCustomerLevelQueryParam;
+import com.fs.crm.service.ICrmCustomerLevelService;
+import com.fs.crm.vo.CrmCustomerLevelVO;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Objects;
+
+@Service
+public class CrmCustomerLevelServiceImpl extends ServiceImpl<CrmCustomerLevelMapper, CrmCustomerLevel> implements ICrmCustomerLevelService {
+
+    /**
+     * 查询客户级别列表
+     * @param param 参数
+     * @return  list
+     */
+    @Override
+    public List<CrmCustomerLevelVO> selectCrmCustomerLevelVOList(CrmCustomerLevelQueryParam param) {
+        return baseMapper.selectCrmCustomerLevelVOList(param);
+    }
+
+    /**
+     * 新增客户级别
+     * @param param 参数
+     * @return 受影响行数
+     */
+    @Override
+    public int saveCustomerLevel(CrmCustomerLevelParm param) {
+        CrmCustomerLevel crmCustomerLevel = getCustomerLevelByName(param.getName());
+        if (Objects.nonNull(crmCustomerLevel)) {
+            throw new CustomException("级别名称已存在");
+        }
+
+        crmCustomerLevel = new CrmCustomerLevel();
+        BeanUtils.copyProperties(param, crmCustomerLevel, "id");
+        return baseMapper.insert(crmCustomerLevel);
+    }
+
+    /**
+     * 根据名称查询客户级别
+     * @param name 名称
+     * @return CrmCustomerLevel
+     */
+    private CrmCustomerLevel getCustomerLevelByName(String name) {
+        Wrapper<CrmCustomerLevel> queryWrapper = Wrappers.<CrmCustomerLevel>lambdaQuery()
+                .eq(CrmCustomerLevel::getName, name)
+                .last("limit 1");
+        return getOne(queryWrapper);
+    }
+
+    /**
+     * 修改客户级别
+     * @param param 参数
+     * @return 受影响行数
+     */
+    @Override
+    public int editCustomerLevel(CrmCustomerLevelParm param) {
+        if (Objects.isNull(param.getId())) {
+            throw new CustomException("ID不能为空");
+        }
+
+        CrmCustomerLevel customerLevel = getById(param.getId());
+        if (Objects.isNull(customerLevel)) {
+            throw new CustomException("记录不存在");
+        }
+
+        CrmCustomerLevel levelByName = getCustomerLevelByName(param.getName());
+        if (Objects.nonNull(levelByName) && !levelByName.getId().equals(customerLevel.getId())) {
+            throw new CustomException("级别名称已存在");
+        }
+
+        BeanUtils.copyProperties(param, customerLevel, "id");
+        return baseMapper.updateById(customerLevel);
+    }
+
+    /**
+     * 根据ID查询
+     * @param id id
+     * @return CrmCustomerLevelVO
+     */
+    @Override
+    public CrmCustomerLevelVO selectCrmCustomerLevelVOById(Long id) {
+        CrmCustomerLevel customerLevel = getById(id);
+        if (Objects.isNull(customerLevel)) {
+            throw new CustomException("记录不存在");
+        }
+
+        CrmCustomerLevelVO crmCustomerLevelVO = new CrmCustomerLevelVO();
+        BeanUtils.copyProperties(customerLevel, crmCustomerLevelVO);
+        return crmCustomerLevelVO;
+    }
+}

+ 28 - 0
fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerServiceImpl.java

@@ -35,11 +35,13 @@ import com.fs.system.service.ISysDictTypeService;
 import lombok.Synchronized;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
 /**
@@ -57,6 +59,9 @@ public class CrmCustomerServiceImpl extends ServiceImpl<CrmCustomerMapper, CrmCu
     private CrmCustomerLogsMapper logsMapper;
     @Autowired
     private ISysDictDataService dictDataService;
+
+    @Autowired
+    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
     @Autowired
     private CompanyMapper companyMapper;
 
@@ -1003,4 +1008,27 @@ public class CrmCustomerServiceImpl extends ServiceImpl<CrmCustomerMapper, CrmCu
             }
         }
     }
+
+    @Override
+    public List<CrmMyCustomerListQueryVO> selectCrmMyAssistListQuery(CrmMyCustomerListQueryParam param) {
+        List<CrmMyCustomerListQueryVO> vos = crmCustomerMapper.selectCrmMyAssistListQuery(param);
+
+        if (vos != null && !vos.isEmpty()){
+            List<CompletableFuture<Void>> futures = new ArrayList<>();
+            vos.forEach(vo -> {
+                CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
+                    CompanyUser companyUser = companyUserMapper.selectCompanyUserById(vo.getCompanyUserId());
+                    ArrayList<String> list = new ArrayList<>();
+                    list.add(companyUser.getNickName()+"(" + companyUser.getUserId() + ")");
+                    vo.setAssistUser(list);
+                }, threadPoolTaskExecutor);
+                futures.add(future);
+            });
+            // 等待所有任务完成
+            CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
+        }
+
+        return vos;
+    }
+
 }

+ 23 - 0
fs-service/src/main/java/com/fs/crm/vo/CrmCustomerLevelVO.java

@@ -0,0 +1,23 @@
+package com.fs.crm.vo;
+
+import lombok.Data;
+
+@Data
+public class CrmCustomerLevelVO {
+    /**
+     * 主键ID
+     */
+    private Long id;
+    /**
+     * 级别名称
+     */
+    private String name;
+    /**
+     * 状态 0显示 1停用
+     */
+    private Integer status;
+    /**
+     * 序号
+     */
+    private Integer sort;
+}

+ 19 - 0
fs-service/src/main/java/com/fs/crm/vo/CrmMyCustomerListQueryVO.java

@@ -5,7 +5,9 @@ import com.fs.common.annotation.Excel;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 @Data
 public class CrmMyCustomerListQueryVO implements Serializable
@@ -118,5 +120,22 @@ public class CrmMyCustomerListQueryVO implements Serializable
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date receiveTime;
+    private List<String> assistUser;
+    private Long companyUserId;
 
+    /** 客户级别 */
+    private Long customerLevel;
+
+    private BigDecimal payMoney;
+
+    @Excel(name = "订单最新成交类型",dictType="store_order_type")
+    private String orderType;
+
+    @Excel(name = "订单最新成交时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date orderTime;
+
+
+    @Excel(name = "最新跟进内容")
+    private String visitContent;
 }

+ 4 - 1
fs-service/src/main/java/com/fs/erp/service/impl/DfOrderServiceImpl.java

@@ -106,6 +106,9 @@ public class DfOrderServiceImpl implements IErpOrderService
         String orderCode = order.getOrderCode();
         FsStoreOrder fsStoreOrder = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(orderCode);
         FsStoreOrderDf df = fsStoreOrderDfMapper.selectFsStoreOrderDfByOrderId(fsStoreOrder.getOrderId());
+        if (df == null){
+            return null;
+        }
         Integer sfAccountIndex = getSFAccountIndex(fsStoreOrder.getOrderId());
         HashMap<String, Object> map = new HashMap<>();
         map.put("loginAccount", df.getLoginAccount());
@@ -622,7 +625,7 @@ public class DfOrderServiceImpl implements IErpOrderService
                 }
 
             } else {
-                throw new RuntimeException(String.format("查询订单失败,原因: %s", dfApiResponse.getMsg()));
+                log.info(String.format("查询订单失败,原因: %s", dfApiResponse.getMsg()));
             }
         } catch (IOException e) {
             e.printStackTrace();

+ 1 - 1
fs-service/src/main/java/com/fs/his/mapper/FsCouponMapper.java

@@ -84,7 +84,7 @@ public interface FsCouponMapper
     @Select({"<script> " +
             "select c.*  from   fs_coupon c   " +
             "where c.status=1  " +
-            "<if test = 'maps.keyword != null     '> " +
+            "<if test = 'maps.keyword != null and  maps.keyword != \"\"   '> " +
             "and c.title like CONCAT('%',#{maps.keyword},'%')" +
             "</if>"+
             "<if test = 'maps.couponType != null     '> " +

+ 49 - 2
fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java

@@ -763,8 +763,27 @@ public interface FsStoreOrderMapper
             "<if test = 'maps.qwSubject == \"-1\"   '> " +
             "and so.qw_subject is null " +
             "</if>" +
-            " ${maps.params.dataScope} "+
-            " order by so.order_id desc" +
+            " ${maps.params.dataScope}\n" +
+            "        ORDER BY\n" +
+            "\n" +
+            "        <if test=\"maps.sortField == 'companyUserName'\">\n" +
+            "            cu.nick_name\n" +
+            "        </if>\n" +
+            "        <if test=\"maps.sortField == 'packageName'\">\n" +
+            "            so.package_name\n" +
+            "        </if>\n" +
+            "        <if test=\"maps.sortField == 'payPrice'\">\n" +
+            "            so.pay_price\n" +
+            "        </if>\n" +
+            "        <if test=\"maps.sortField == 'payMoney'\">\n" +
+            "            so.pay_money\n" +
+            "        </if>\n" +
+            "        <if test=\"maps.sortOrder != null and maps.sortOrder != ''\">\n" +
+            "            ${maps.sortOrder}\n" +
+            "        </if>\n" +
+            "        <if test=\"maps.sortField == null or maps.sortField == ''\">\n" +
+            "            so.order_id desc\n" +
+            "        </if>"+
             " limit 30000 "+
             "</script>"})
     List<FsStoreOrderExportVO> selectFsStoreOrderListVOByExport(@Param("maps") FsStoreOrderParam param);
@@ -877,6 +896,12 @@ public interface FsStoreOrderMapper
             "            <if test=\"maps.packageSecondName != null and maps.packageSecondName != '' \"> and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')</if>"+
             "            <if test=\"maps.storeId != null \"> and so.store_id = #{maps.storeId}</if>\n" +
             "            <if test=\"maps.orderCode != null  and maps.orderCode != ''\"> and so.order_code = #{maps.orderCode}</if>\n" +
+            " <if test=\"maps.orderCodes != null  and maps.orderCodes.size > 0\">\n" +
+            "            and so.order_code in\n" +
+            "            <foreach collection=\"maps.orderCodes\" item=\"orderCode\" open=\"(\" close=\")\" separator=\",\">\n" +
+            "                #{orderCode}\n" +
+            "            </foreach>\n" +
+            "        </if>" +
             "            <if test=\"maps.prescribeCode != null  and maps.prescribeCode != ''\"> and p.prescribe_code = #{maps.prescribeCode}</if>\n" +
             "            <if test=\"maps.userName != null  and maps.userName != ''\"> and so.user_name like concat('%', #{maps.userName}, '%')</if>\n" +
             "            <if test=\"maps.userPhone != null  and maps.userPhone != ''\"> and so.user_phone = #{maps.userPhone}</if>\n" +
@@ -908,6 +933,12 @@ public interface FsStoreOrderMapper
             "            <if test=\"maps.tuieTime != null \">  and DATE(so.tui_money_time) &lt;= DATE(#{maps.tuieTime})</if>\n" +
             "            <if test=\"maps.companyUserNickName != null and  maps.companyUserNickName !='' \"> and cu.nick_name like concat( #{maps.companyUserNickName}, '%')"+
             "</if>" +
+            "<if test=\"maps.companyIds != null and  maps.companyIds.size >0\">\n" +
+            "            and so.company_id in\n" +
+            "            <foreach collection=\"maps.companyIds\" item=\"companyId\" open=\"(\" close=\")\" separator=\",\">\n" +
+            "                #{companyId}\n" +
+            "            </foreach>\n" +
+            "        </if>" +
             "<if test = 'maps.companyId != null  and   maps.companyId != \"-1\" '> " +
             "and so.company_id =#{maps.companyId} " +
             "</if>" +
@@ -980,6 +1011,12 @@ public interface FsStoreOrderMapper
             "            <if test=\"maps.storeId != null \"> and so.store_id = #{maps.storeId}</if>\n" +
             "            <if test=\"maps.source != null \"> and so.source = #{maps.source}</if>\n" +
             "            <if test=\"maps.orderCode != null  and maps.orderCode != ''\"> and so.order_code = #{maps.orderCode}</if>\n" +
+            "            <if test=\"maps.orderCodes != null  and maps.orderCodes.size > 0\">\n" +
+            "               and so.order_code in\n" +
+            "               <foreach collection=\"maps.orderCodes\" item=\"orderCode\" open=\"(\" close=\")\" separator=\",\">\n" +
+            "                #{orderCode}\n" +
+            "               </foreach>\n" +
+            "            </if>" +
             "            <if test=\"maps.prescribeCode != null  and maps.prescribeCode != ''\"> and p.prescribe_code = #{maps.prescribeCode}</if>\n" +
             "            <if test=\"maps.userName != null  and maps.userName != ''\"> and so.user_name like concat('%', #{maps.userName}, '%')</if>\n" +
             "            <if test=\"maps.userPhone != null  and maps.userPhone != ''\"> and so.user_phone = #{maps.userPhone}</if>\n" +
@@ -1020,6 +1057,12 @@ public interface FsStoreOrderMapper
 
             " and cu.nick_name like concat( #{maps.companyUserNickName}, '%') " +
             "</if>" +
+            "<if test=\"maps.companyIds != null and  maps.companyIds.size >0\">\n" +
+            "and so.company_id in\n" +
+            "<foreach collection=\"maps.companyIds\" item=\"companyId\" open=\"(\" close=\")\" separator=\",\">\n" +
+            "#{companyId}\n" +
+            "</foreach>\n" +
+            "</if>" +
             "<if test = 'maps.companyId != null  and   maps.companyId != \"-1\" '> " +
             "and so.company_id =#{maps.companyId} " +
             "</if>" +
@@ -1116,4 +1159,8 @@ public interface FsStoreOrderMapper
     List<FsStoreOrderListVO> selectFsStoreOrderListVOByErpAccount(@Param("maps") FsStoreOrderParam fsStoreOrder);
 
     List<FsStoreOrder> selectFsStoreOrderByFsUserId(@Param("fsUserId") Long fsUserId);
+
+    Long selectFsStoreOrderListVOByErpAccountByExportCount(@Param("maps")FsStoreOrderParam param);
+
+    List<FsStoreOrderErpExportVO> selectFsStoreOrderListErpVOByExport(@Param("maps")FsStoreOrderParam fsStoreOrder);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java

@@ -372,4 +372,6 @@ public interface FsUserMapper
 
     List<FsUser> selectFsUserListByJointUserNameKey(String userNameKey);
 
+    @Update("update fs_user set status = 0 where user_id = #{userId}")
+    int updateUserStatus(@Param("userId")Long userId);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/param/FsStoreOrderParam.java

@@ -152,7 +152,9 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable {
     /** $column.columnComment */
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date finishTime;
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date sTime;
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date eTime;
     private Date paysTime;
     private Date payeTime;

+ 2 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java

@@ -258,4 +258,6 @@ public interface IFsStoreOrderService
     List<FsStoreOrder> selectFsStoreOrderByFsUserId(Long fsUserId);
 
     String importOrderStatusData(List<FsStoreOrderStatusExcelVO> list);
+
+    Long selectFsStoreOrderListVOByErpAccountByExportCount(FsStoreOrderParam param);
 }

+ 5 - 0
fs-service/src/main/java/com/fs/his/service/IFsUserService.java

@@ -196,4 +196,9 @@ public interface IFsUserService
     List<FsUser> selectFsUserListByJointUserNameKey(String userNameKey);
 
     void addMoney(FsStoreOrderScrm order);
+
+    /**
+     * 逻辑删除用户(修改状态为禁用)
+     */
+    R updateStatus(Long userId);
 }

+ 47 - 6
fs-service/src/main/java/com/fs/his/service/impl/FsExportTaskServiceImpl.java

@@ -4,14 +4,18 @@ import java.util.Date;
 import java.util.List;
 
 import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.config.cloud.CloudHostProper;
+import com.fs.his.domain.FsStoreOrderDf;
 import com.fs.his.mapper.FsStoreOrderMapper;
 import com.fs.his.mapper.FsStorePaymentMapper;
 import com.fs.his.param.FsStoreOrderParam;
 import com.fs.his.param.FsStorePaymentParam;
 import com.fs.his.service.IFsStoreOrderService;
 import com.fs.his.utils.PhoneUtil;
+import com.fs.his.vo.FsStoreOrderErpExportVO;
 import com.fs.his.vo.FsStoreOrderExcelVO;
 import com.fs.his.vo.FsStoreOrderExportVO;
 import com.fs.his.vo.FsStorePaymentExcelVO;
@@ -36,8 +40,10 @@ public class FsExportTaskServiceImpl implements IFsExportTaskService
     @Autowired
     FsStoreOrderMapper fsStoreOrderMapper;
     @Autowired
-
     FsStorePaymentMapper fsStorePaymentMapper;
+
+    @Autowired
+    private CloudHostProper cloudHostProper;
     /**
      * 查询导出任务
      *
@@ -119,10 +125,44 @@ public class FsExportTaskServiceImpl implements IFsExportTaskService
     @Async
     @Override
     public void exportStore1Data(FsStoreOrderParam fsStoreOrder,boolean isAdmin) {
-        List<FsStoreOrderExportVO> list = fsStoreOrderMapper.selectFsStoreOrderListVOByExport(fsStoreOrder);
+        if ("金牛明医".equals(cloudHostProper.getCompanyName())){
+            exportErpData(fsStoreOrder, isAdmin);
+        } else {
+            List<FsStoreOrderExportVO> list = fsStoreOrderMapper.selectFsStoreOrderListVOByExport(fsStoreOrder);
+            //对手机号脱敏
+            if (list != null) {
+                for (FsStoreOrderExportVO vo : list) {
+                    vo.setFollowFrequency(6);
+                    if (vo.getCycle()!=null){
+                        vo.setFollowCount(vo.getCycle()/ vo.getFollowFrequency());
+                    }
+                    if (vo.getUserPhone() != null &&  !isAdmin) {
+                        vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    }
+                    if (vo.getUserPhone() != null && isAdmin && vo.getUserPhone().length()>11) {
+                        vo.setUserPhone(PhoneUtil.decryptPhone(vo.getUserPhone()));
+                    }
+                    if (vo.getUserAddress() != null) {
+                        vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
+                    }
+                }
+            }
+            ExcelUtil<FsStoreOrderExportVO> util = new ExcelUtil<FsStoreOrderExportVO>(FsStoreOrderExportVO.class);
+            AjaxResult result= util.exportExcel(list, "订单数据");
+            FsExportTask task=fsExportTaskMapper.selectFsExportTaskByTaskId(fsStoreOrder.getTaskId());
+            task.setFinishTime(new Date());
+            task.setStatus(1);
+            task.setFileUrl(result.get("msg").toString());
+            fsExportTaskMapper.updateFsExportTask(task);
+        }
+
+    }
+
+    private void exportErpData(FsStoreOrderParam fsStoreOrder, boolean isAdmin) {
+        List<FsStoreOrderErpExportVO> erpList = fsStoreOrderMapper.selectFsStoreOrderListErpVOByExport(fsStoreOrder);
         //对手机号脱敏
-        if (list != null) {
-            for (FsStoreOrderExportVO vo : list) {
+        if (erpList != null) {
+            for (FsStoreOrderErpExportVO vo : erpList) {
                 vo.setFollowFrequency(6);
                 if (vo.getCycle()!=null){
                     vo.setFollowCount(vo.getCycle()/ vo.getFollowFrequency());
@@ -138,14 +178,15 @@ public class FsExportTaskServiceImpl implements IFsExportTaskService
                 }
             }
         }
-        ExcelUtil<FsStoreOrderExportVO> util = new ExcelUtil<FsStoreOrderExportVO>(FsStoreOrderExportVO.class);
-        AjaxResult result= util.exportExcel(list, "订单数据");
+        ExcelUtil<FsStoreOrderErpExportVO> util = new ExcelUtil<FsStoreOrderErpExportVO>(FsStoreOrderErpExportVO.class);
+        AjaxResult result= util.exportExcel(erpList, "订单数据");
         FsExportTask task=fsExportTaskMapper.selectFsExportTaskByTaskId(fsStoreOrder.getTaskId());
         task.setFinishTime(new Date());
         task.setStatus(1);
         task.setFileUrl(result.get("msg").toString());
         fsExportTaskMapper.updateFsExportTask(task);
     }
+
     @Async
     @Override
     public void exportStoreData(FsStoreOrderParam fsStoreOrder) {

+ 5 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -3549,4 +3549,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         return successMsg.toString();
     }
 
+    @Override
+    public Long selectFsStoreOrderListVOByErpAccountByExportCount(FsStoreOrderParam param) {
+        return fsStoreOrderMapper.selectFsStoreOrderListVOByErpAccountByExportCount(param);
+    }
+
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java

@@ -1135,6 +1135,12 @@ public class FsUserServiceImpl implements IFsUserService
         storeOrderMapper.updateFsStoreOrder(orderMap);
     }
 
+    @Override
+    public R updateStatus(Long userId) {
+        fsUserMapper.updateUserStatus(userId);
+        return R.ok();
+    }
+
     @Override
     public List<FsUserVO> selectFsUserVOListByProject(FsUser fsUser) {
         return fsUserMapper.selectFsUserVOListByProject(fsUser);

+ 12 - 0
fs-service/src/main/java/com/fs/his/vo/FsStoreOrderErpExportVO.java

@@ -0,0 +1,12 @@
+package com.fs.his.vo;
+
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+@Data
+public class FsStoreOrderErpExportVO extends FsStoreOrderExportVO{
+    @Excel(name = "ERP电话",sort = 1)
+    private String erpPhone;
+    @Excel(name = "ERP账户",sort = 2)
+    private String erpAccount;
+}

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -526,7 +526,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService
             //绑定销售
             FsUserScrm fsuser= userService.selectFsUserById(userId);
             if(param.getCompanyUserId()!=null){
-                if (ObjectUtil.isNotEmpty(fsuser.getCompanyUserId())&&fsuser.getCompanyUserId()!=param.getCompanyUserId()){
+                if (ObjectUtil.isNotEmpty(fsuser.getCompanyUserId())&& !Objects.equals(fsuser.getCompanyUserId(), param.getCompanyUserId())){
                     CompanyUser companyUser=companyUserService.selectCompanyUserById(fsuser.getCompanyUserId());
                     return R.error(String.format("请联系%s销售进行购买商品!",companyUser.getNickName()));
                 }else {

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStorePaymentScrmServiceImpl.java

@@ -701,7 +701,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
     public void bufaRedPacket() {
 //        String json = configService.selectConfigByKey("redPacket.config");
 //        RedPacketConfig config = JSONUtil.toBean(json, RedPacketConfig.class);
-        List<FsCourseRedPacketLog> logs = redPacketLogMapper.selectFail();
+        List<FsCourseRedPacketLog> logs = redPacketLogMapper.selectFailAll();
         String appId = "wx414427b10866c04e";
         for (FsCourseRedPacketLog log : logs){
             FsUserScrm user = userService.selectFsUserById(log.getUserId());

+ 17 - 8
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductCategoryScrmServiceImpl.java

@@ -7,22 +7,23 @@ import org.springframework.stereotype.Service;
 import com.fs.hisStore.mapper.FsStoreProductCategoryScrmMapper;
 import com.fs.hisStore.domain.FsStoreProductCategoryScrm;
 import com.fs.hisStore.service.IFsStoreProductCategoryScrmService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 商品分类Service业务层处理
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
 @Service
-public class FsStoreProductCategoryScrmServiceImpl implements IFsStoreProductCategoryScrmService 
+public class FsStoreProductCategoryScrmServiceImpl implements IFsStoreProductCategoryScrmService
 {
     @Autowired
     private FsStoreProductCategoryScrmMapper fsStoreProductCategoryMapper;
 
     /**
      * 查询商品分类
-     * 
+     *
      * @param cateId 商品分类ID
      * @return 商品分类
      */
@@ -34,7 +35,7 @@ public class FsStoreProductCategoryScrmServiceImpl implements IFsStoreProductCat
 
     /**
      * 查询商品分类列表
-     * 
+     *
      * @param fsStoreProductCategory 商品分类
      * @return 商品分类
      */
@@ -46,7 +47,7 @@ public class FsStoreProductCategoryScrmServiceImpl implements IFsStoreProductCat
 
     /**
      * 新增商品分类
-     * 
+     *
      * @param fsStoreProductCategory 商品分类
      * @return 结果
      */
@@ -59,20 +60,28 @@ public class FsStoreProductCategoryScrmServiceImpl implements IFsStoreProductCat
 
     /**
      * 修改商品分类
-     * 
+     *
      * @param fsStoreProductCategory 商品分类
      * @return 结果
      */
     @Override
+    @Transactional
     public int updateFsStoreProductCategory(FsStoreProductCategoryScrm fsStoreProductCategory)
     {
         fsStoreProductCategory.setUpdateTime(DateUtils.getNowDate());
+        if(fsStoreProductCategory.getPid() == 0){
+            FsStoreProductCategoryScrm child = new FsStoreProductCategoryScrm();
+            child.setPid(fsStoreProductCategory.getCateId());
+            child.setIsShow(fsStoreProductCategory.getIsShow());
+            fsStoreProductCategoryMapper.updateFsStoreProductCategory(child);
+        }
         return fsStoreProductCategoryMapper.updateFsStoreProductCategory(fsStoreProductCategory);
+
     }
 
     /**
      * 批量删除商品分类
-     * 
+     *
      * @param cateIds 需要删除的商品分类ID
      * @return 结果
      */
@@ -84,7 +93,7 @@ public class FsStoreProductCategoryScrmServiceImpl implements IFsStoreProductCat
 
     /**
      * 删除商品分类信息
-     * 
+     *
      * @param cateId 商品分类ID
      * @return 结果
      */

+ 1 - 0
fs-service/src/main/java/com/fs/qw/param/ResignedTransferParam.java

@@ -10,4 +10,5 @@ public class ResignedTransferParam {
     Long  userId;
     String corpId;
     String  qwUserName;
+    String type;
 }

+ 1 - 0
fs-service/src/main/java/com/fs/qw/param/TransferParam.java

@@ -11,4 +11,5 @@ public class TransferParam {
     String  qwUserName;
     String corpId;
     String content;
+    String type;
 }

+ 1 - 1
fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java

@@ -1972,7 +1972,7 @@ public class QwSopLogsServiceImpl extends ServiceImpl<QwSopLogsMapper, QwSopLogs
             if (qwUser == null || qwUser.getIsDel() != 0) {
                 logger.error("员工信息无效-不存在或被删除,corpId:{},userId:{}", corpId, qwUserid);
                 logsGroup.forEach(log -> {
-                    log.setSendStatus(3L);
+                    log.setSendStatus(5L);
                     log.setRemark("员工信息无效");
                     updateQueue.add(log);
                 });

+ 1 - 1
fs-service/src/main/resources/application-config-druid-jnmy.yml

@@ -81,7 +81,7 @@ cloud_host:
 headerImg:
   imgUrl: https
 ipad:
-  ipadUrl: http://ipad.cdwjyyh.com
+  ipadUrl: http://qwipad.jnmyunl.com
   aiApi: http://127.0.0.1:3000/api
 wx_miniapp_temp:
   pay_order_temp_id: -SjnK9K6cNKASa6AD9Q_c0YT7J1lPTEpPIpqbMJF8F0

+ 4 - 0
fs-service/src/main/resources/application-config-myhk.yml

@@ -46,6 +46,10 @@ wx:
         secret: 47b6d65c45719e3e40392e19996587b3 # 公众号的appsecret
         token: PPKOdAlCoMO # 接口配置里的Token值
         aesKey: Eswa6VjwtVMCcw03qZy6fWllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
+  # 开放平台app微信授权配置
+  open:
+    app-id: wxcb1e78baf03c0662
+    secret: d041d3e2392a68a3e86dc22d976ed4a0
 aifabu:  #爱链接
   appKey: 7b471be905ab17e00f3b858c6710dd117601d008
 watch:

+ 1 - 1
fs-service/src/main/resources/application-dev.yml

@@ -43,7 +43,7 @@ spring:
             druid:
                 # 主库数据源
                 master:
-                    url: jdbc:mysql://139.186.77.83:3306/ylrz_his_scrm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    url: jdbc:mysql://139.186.77.83:3306/zk_target_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: Rtroot
                     password: Rtroot
                 # 初始连接数

+ 3 - 3
fs-service/src/main/resources/application-druid-jnmy-test.yml

@@ -148,6 +148,6 @@ rocketmq:
         group: test-group
         access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
         secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
-ipad:
-    ipadUrl:
-    aiApi:
+openIM:
+    secret: openIM123
+    userID: imAdmin

+ 4 - 2
fs-service/src/main/resources/application-druid-zkzh.yml

@@ -30,7 +30,7 @@ spring:
             druid:
                 # 主库数据源
                 master:
-                    url: jdbc:mysql://rm-bp1l45210q9m4m83u.mysql.rds.aliyuncs.com:3306/jz_store?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    url: jdbc:mysql://rm-bp1l45210q9m4m83u.mysql.rds.aliyuncs.com:3306/jz_store_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
                     password: Zkhj951753@#
                 # 从库数据源
@@ -139,4 +139,6 @@ rocketmq:
         secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
 cloud_host:
     company_name: 中康智慧
-
+openIM:
+    secret: openIM123
+    userID: imAdmin

+ 17 - 0
fs-service/src/main/resources/mapper/crm/CrmCustomerLevelMapper.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.crm.mapper.CrmCustomerLevelMapper">
+
+    <select id="selectCrmCustomerLevelVOList" resultType="com.fs.crm.vo.CrmCustomerLevelVO">
+        select
+            ccl.*
+        from crm_customer_level ccl
+        <where>
+            <if test="name != null and name != ''">
+                and ccl.name like concat('%', #{name}, '%')
+            </if>
+        </where>
+    </select>
+</mapper>

+ 74 - 0
fs-service/src/main/resources/mapper/crm/CrmCustomerMapper.xml

@@ -361,4 +361,78 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ) t
         GROUP BY t.type
     </select>
+
+
+
+    <select id="selectCrmMyAssistListQuery" resultType="com.fs.crm.vo.CrmMyCustomerListQueryVO">
+        select cu.*,c.create_time as customer_create_time,c.visit_status,c.remark,c.register_desc,c.register_submit_time,
+        c.customer_code,c.customer_name,c.mobile,c.sex,c.weixin,c.address,c.is_receive,c.customer_type,c.source,
+        c.tags,c.receive_time, c.customer_level
+        from crm_customer_assist ca
+        LEFT JOIN  crm_customer c on c.customer_id=ca.customer_id
+        LEFT JOIN crm_customer_user cu on c.customer_user_id=cu.customer_user_id
+        where c.is_pool=0  and c.is_del = 0
+        <if test="maps.companyId != null">
+            and ca.company_id =#{maps.companyId}
+        </if>
+        <if test="maps.companyUserId != null">
+            and ca.company_user_id =#{maps.companyUserId}
+        </if>
+        <if test="maps.customerLevel != null">
+            and c.customer_level =#{maps.customerLevel}
+        </if>
+        <if test="maps.address != null and  maps.address != ''">
+            and c.address like CONCAT('%',#{maps.address},'%')
+        </if>
+        <if test="maps.customerCode != null and  maps.customerCode != ''">
+            and c.customer_code like CONCAT('%',#{maps.customerCode},'%')
+        </if>
+        <if test="maps.customerName != null and  maps.customerName != ''">
+            and c.customer_name like CONCAT('%',#{maps.customerName},'%')
+        </if>
+        <if test="maps.mobile != null and  maps.mobile != ''">
+            and c.mobile like CONCAT('%',#{maps.mobile},'%')
+        </if>
+        <if test="maps.status != null and  maps.status != ''">
+            and c.visit_status IN
+            <foreach collection="maps.status.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="maps.isHisOrder != null and  maps.isHisOrder == 1">
+            and (select ifnull(count(1),0) from crm_customer_his_order h where h.customer_id=c.customer_id )  &gt; 0
+        </if>
+        <if test="maps.isHisOrder != null and  maps.isHisOrder == 0">
+            and (select ifnull(count(1),0) from crm_customer_his_order h where h.customer_id=c.customer_id )  = 0
+        </if>
+        <if test="maps.customerType != null">
+            and c.customer_type IN
+            <foreach collection="maps.customerType.split(',')" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="maps.source != null and  maps.source != ''">
+            and c.source IN
+            <foreach collection="maps.source.split(',')" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="maps.tags != null and  maps.tags != ''">
+            and
+            <foreach collection="maps.tags.split(',')" item="tag" open="(" separator="OR" close=")">
+                find_in_set(#{tag},c.tags)
+            </foreach>
+        </if>
+        <if test="maps.customerCreateTime != null">
+            AND date_format(c.create_time,'%y%m%d') &gt;= date_format(#{maps.customerCreateTime[0]},'%y%m%d')
+            AND date_format(c.create_time,'%y%m%d') &lt;= date_format(#{maps.customerCreateTime[1]},'%y%m%d')
+        </if>
+        <if test="maps.beginTime != null and maps.beginTime != ''">
+            and date_format(c.receive_time,'%y%m%d') &gt;= date_format(#{maps.beginTime},'%y%m%d')
+        </if>
+        <if test="maps.endTime != null and maps.endTime != ''">
+            and date_format(c.receive_time,'%y%m%d') &lt;= date_format(#{maps.endTime},'%y%m%d')
+        </if>
+        order by cu.customer_user_id desc
+    </select>
 </mapper>

+ 465 - 0
fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml

@@ -1134,4 +1134,469 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where user_id = #{fsUserId} and create_time >= DATE_SUB(NOW(), INTERVAL 30 DAY)
         order by create_time desc limit 3
     </select>
+    <select id="selectFsStoreOrderListVOByErpAccountByExportCount" resultType="java.lang.Long">
+        select count(1)
+        from fs_store_order so
+        LEFT JOIN fs_store st ON so.store_id =st.store_id
+        left join fs_user u on so.user_id=u.user_id
+        LEFT JOIN fs_prescribe p ON p.prescribe_id =so.prescribe_id
+        LEFT JOIN fs_doctor d ON p.doctor_id= d.doctor_id
+        left join company c on c.company_id=so.company_id
+        left join company_user cu on cu.user_id=so.company_user_id
+        left join company_tcm_schedule cts on cts.id = so.schedule_id
+        left join fs_patient pat on pat.patient_id = p.patient_id
+        LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
+        WHERE so.is_del=0
+        <if test="maps.packageSecondName != null and maps.packageSecondName != '' ">
+            and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')
+        </if>
+        <if test="maps.storeId != null ">
+            and so.store_id = #{maps.storeId}
+        </if>
+        <if test="maps.source != null ">
+            and so.source = #{maps.source}
+        </if>
+        <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
+            and so.order_code in
+            <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
+                #{orderCode}
+            </foreach>
+        </if>
+        <if test="maps.orderCode != null  and maps.orderCode != ''">
+            and so.order_code = #{maps.orderCode}
+        </if>
+        <if test="maps.prescribeCode != null  and maps.prescribeCode != ''">
+            and p.prescribe_code = #{maps.prescribeCode}
+        </if>
+        <if test="maps.userName != null  and maps.userName != ''">
+            and so.user_name like concat('%', #{maps.userName}, '%')
+        </if>
+        <if test="maps.userPhone != null  and maps.userPhone != ''">
+            and so.user_phone = #{maps.userPhone}
+        </if>
+        <if test="maps.totalNum != null  and maps.totalNum != ''">
+            and so.total_num = #{maps.totalNum}
+        </if>
+        <if test="maps.totalPrice != null">
+            and so.total_price = #{maps.totalPrice}
+        </if>
+        <if test="maps.status != null and maps.status != 6">
+            and so.status = #{maps.status}
+        </if>
+        <if test="maps.status == 6">
+            and so.`status`= 2
+            and ( so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1))
+            and  (so.extend_order_id is null or  so.extend_order_id like '')
+        </if>
+        <if test="maps.refundStatus != null  and maps.refundStatus != ''">
+            and so.refund_status = #{maps.refundStatus}
+        </if>
+        <if test="maps.refundExplain != null  and maps.refundExplain != ''">
+            and so.refund_explain = #{maps.refundExplain}
+        </if>
+        <if test="maps.deliverySn != null  and maps.deliverySn != ''">
+            and so.delivery_sn = #{maps.deliverySn}
+        </if>
+        <if test="maps.shippingType != null">
+            and so.shipping_type = #{maps.shippingType}
+        </if>
+        <if test="maps.isChannel != null and maps.isChannel != ''">
+            and so.is_channel = #{maps.isChannel}
+        </if>
+        <if test="maps.isPrescribe != null">
+            and so.is_prescribe = #{maps.isPrescribe}
+        </if>
+        <if test="maps.prescribeId != null">
+            and so.prescribe_id = #{maps.prescribeId}
+        </if>
+        <if test="maps.companyUserId != null">
+            and so.company_user_id = #{maps.companyUserId}
+        </if>
+        <if test="maps.sTime != null">
+            and DATE(so.create_time) &gt;= DATE(#{maps.sTime})
+        </if>
+        <if test="maps.eTime != null">
+            and DATE(so.create_time) &lt;= DATE(#{maps.eTime})
+        </if>
+        <if test="maps.paysTime != null">
+            and DATE(so.pay_time) &gt;= DATE(#{maps.paysTime})
+        </if>
+        <if test="maps.payeTime != null">
+            and DATE(so.pay_time) &lt;= DATE(#{maps.payeTime})
+        </if>
+        <if test="maps.orderCreateType != null">
+            and so.order_create_type = #{maps.orderCreateType}
+        </if>
+        <if test="maps.patientName != null">
+            and p.patient_name like concat('%', #{maps.patientName}, '%')
+        </if>
+        <if test="maps.doctorName != null">
+            and d.doctor_name like concat('%', #{maps.doctorName}, '%')
+        </if>
+        <if test="maps.orderType != null">
+            and so.order_type = #{maps.orderType}
+        </if>
+        <if test="maps.deliverySendsTime != null ">
+            and DATE(so.delivery_send_time) &gt;= DATE(#{maps.deliverySendsTime})
+        </if>
+        <if test="maps.deliverySendeTime != null">
+            and DATE(so.delivery_send_time) &lt;= DATE(#{maps.deliverySendeTime})
+        </if>
+        <if test="maps.deliveryImportsTime != null">
+            and DATE(so.delivery_import_time) &gt;= DATE(#{maps.deliveryImportsTime})
+        </if>
+        <if test="maps.deliveryImporteTime != null">
+            and DATE(so.delivery_import_time) &lt;= DATE(#{maps.deliveryImporteTime})
+        </if>
+        <if test="maps.tuisTime != null ">
+            and DATE(so.tui_money_time) &gt;= DATE(#{maps.tuisTime})
+        </if>
+        <if test="maps.tuieTime != null">
+            and DATE(so.tui_money_time) &lt;= DATE(#{maps.tuieTime})
+        </if>
+        <if test = "maps.companyUserNickName != null and  maps.companyUserNickName !=  '' ">
+            and cu.nick_name like concat( #{maps.companyUserNickName}, '%')
+        </if>
+        <if test="maps.companyIds != null and  maps.companyIds.size >0">
+            and so.company_id in
+            <foreach collection="maps.companyIds" item="companyId" open="(" close=")" separator=",">
+                #{companyId}
+            </foreach>
+        </if>
+        <if test = "maps.companyId != null  and   maps.companyId != '-1' ">
+            and so.company_id =#{maps.companyId}
+        </if>
+        <if test="maps.userId != null ">
+            and so.user_id = #{maps.userId}</if>
+        <if test = "maps.companyId == '-1' ">
+            and so.company_id is null
+        </if>
+        <if test = "maps.deliveryStatus != null">
+            and so.delivery_status =#{maps.deliveryStatus}
+        </if>
+        <if test = "maps.deliveryPayStatus != null">
+            and so.delivery_pay_status =#{maps.deliveryPayStatus}
+        </if>
+        <if test = "maps.tuiMoneyStatus != null">
+            and so.tui_money_status =#{maps.tuiMoneyStatus}
+        </if>
+        <if test = "maps.deptId != null">
+            AND (so.dept_id = #{maps.deptId} OR so.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
+        </if>
+        <if test="maps.packageName != null and maps.packageName != '' ">
+         and so.package_name like concat('%', #{maps.packageName}, '%')
+        </if>
+        <if test = "maps.payType != null">
+            and so.pay_type IN
+            <foreach collection="maps.payType.split(',')"  item='item' index='index'  open='(' separator=',' close=')'>
+                #{item}
+            </foreach>
+        </if>
+        <if test = "maps.scheduleId != null  and  maps.scheduleId != '-1' " >
+            and so.schedule_id IN
+            <foreach collection="maps.scheduleId.split(',')"  item='item' index='index'  open='(' separator=',' close=')'>
+             #{item}
+            </foreach>
+        </if>
+        <if test = "maps.scheduleId == '-1' "  >
+            and so.schedule_id is null
+        </if>
+        <if test = "maps.orderBuyType != null  and  maps.orderBuyType != '-1'">
+            and so.order_buy_type IN
+            <foreach collection="maps.orderBuyType.split(',')"  item='item' index='index'  open='(' separator=',' close=')'>
+                #{item}
+            </foreach>
+        </if>
+        <if test = "maps.orderBuyType == '-1' " >
+            and so.order_buy_type is null
+        </if>
+        <if test = "maps.orderChannel != null  and  maps.orderChannel != '-1' " >
+            and so.order_channel IN
+            <foreach collection="maps.orderChannel.split(',')"  item='item' index='index'  open='(' separator=',' close=')'>
+                #{item}
+            </foreach>
+        </if>
+        <if test = "maps.orderChannel == '-1'">
+            and so.order_channel is null
+        </if>
+        <if test = "maps.qwSubject != null  and  maps.qwSubject != '-1'">
+            and so.qw_subject IN
+            <foreach collection="maps.qwSubject.split(',')"  item='item' index='index'  open='(' separator=',' close=')'>
+                #{item}
+        </foreach>
+        </if>
+        <if test ="maps.qwSubject == '-1' ">
+            and so.qw_subject is null
+        </if>
+        <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
+            and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')
+        </if>
+        <if test="maps.erpAccount != null and maps.erpAccount != '未分拣' and maps.erpAccount != ''">
+            and df.login_account like #{maps.erpAccount}
+        </if>
+        <if test="maps.erpAccount == '未分拣'">
+            and ( df.login_account is null or df.login_account like '')
+        </if>
+        ${maps.params.dataScope}
+    </select>
+    <select id="selectFsStoreOrderListErpVOByExport" resultType="com.fs.his.vo.FsStoreOrderErpExportVO">
+        SELECT
+        so.*,
+        u.nick_name,
+        u.phone,
+        p.patient_name,
+        TIMESTAMPDIFF(YEAR, pat.birthday, CURDATE()) AS age,
+        pat.sex,
+        p.prescribe_code,
+        d.doctor_name,
+        pat.relation,
+        CONCAT(u.nick_name, '(', LEFT(u.phone, 3), '****', RIGHT(u.phone, 4), ')') AS `user`,
+        c.company_name,
+        cu.nick_name AS company_user_nick_name,
+        cts.name AS schedule_name,
+        st.store_name,df.login_account as erp_account
+        FROM fs_store_order so
+        LEFT JOIN fs_store st ON so.store_id = st.store_id
+        LEFT JOIN fs_user u ON so.user_id = u.user_id
+        LEFT JOIN fs_prescribe p ON p.prescribe_id = so.prescribe_id
+        LEFT JOIN fs_doctor d ON p.doctor_id = d.doctor_id
+        LEFT JOIN company c ON c.company_id = so.company_id
+        LEFT JOIN company_user cu ON cu.user_id = so.company_user_id
+        LEFT JOIN company_tcm_schedule cts ON cts.id = so.schedule_id
+        LEFT JOIN fs_patient pat ON pat.patient_id = p.patient_id
+        LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
+        WHERE so.is_del = 0
+
+        <!-- 动态条件 -->
+        <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
+            AND so.package_second_name LIKE CONCAT('%', #{maps.packageSecondName}, '%')
+        </if>
+        <if test="maps.storeId != null">
+            AND so.store_id = #{maps.storeId}
+        </if>
+        <if test="maps.source != null">
+            AND so.source = #{maps.source}
+        </if>
+        <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
+            and so.order_code in
+            <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
+                #{orderCode}
+            </foreach>
+        </if>
+        <if test="maps.orderCode != null and maps.orderCode != ''">
+            AND so.order_code = #{maps.orderCode}
+        </if>
+        <if test="maps.prescribeCode != null and maps.prescribeCode != ''">
+            AND p.prescribe_code = #{maps.prescribeCode}
+        </if>
+        <if test="maps.userName != null and maps.userName != ''">
+            AND so.user_name LIKE CONCAT('%', #{maps.userName}, '%')
+        </if>
+        <if test="maps.userPhone != null and maps.userPhone != ''">
+            AND so.user_phone = #{maps.userPhone}
+        </if>
+        <if test="maps.totalNum != null and maps.totalNum != ''">
+            AND so.total_num = #{maps.totalNum}
+        </if>
+        <if test="maps.totalPrice != null">
+            AND so.total_price = #{maps.totalPrice}
+        </if>
+        <if test="maps.status != null and maps.status != 6">
+            AND so.status = #{maps.status}
+        </if>
+        <if test="maps.status == 6">
+            AND so.`status` = 2
+            AND (
+            so.store_id IN (SELECT store_id FROM fs_store WHERE delivery_type=2 OR delivery_type=1)
+            )
+            AND (so.extend_order_id IS NULL OR so.extend_order_id = '')
+        </if>
+        <if test="maps.refundStatus != null and maps.refundStatus != ''">
+            AND so.refund_status = #{maps.refundStatus}
+        </if>
+        <if test="maps.refundExplain != null and maps.refundExplain != ''">
+            AND so.refund_explain = #{maps.refundExplain}
+        </if>
+        <if test="maps.deliverySn != null and maps.deliverySn != ''">
+            AND so.delivery_sn = #{maps.deliverySn}
+        </if>
+        <if test="maps.shippingType != null">
+            AND so.shipping_type = #{maps.shippingType}
+        </if>
+        <if test="maps.isChannel != null and maps.isChannel != ''">
+            AND so.is_channel = #{maps.isChannel}
+        </if>
+        <if test="maps.isPrescribe != null">
+            AND so.is_prescribe = #{maps.isPrescribe}
+        </if>
+        <if test="maps.prescribeId != null">
+            AND so.prescribe_id = #{maps.prescribeId}
+        </if>
+        <if test="maps.companyUserId != null">
+            AND so.company_user_id = #{maps.companyUserId}
+        </if>
+        <if test="maps.sTime != null">
+            AND DATE(so.create_time) &gt;= DATE(#{maps.sTime})
+        </if>
+        <if test="maps.eTime != null">
+            AND DATE(so.create_time) &lt;= DATE(#{maps.eTime})
+        </if>
+        <if test="maps.paysTime != null">
+            AND DATE(so.pay_time) &gt;= DATE(#{maps.paysTime})
+        </if>
+        <if test="maps.payeTime != null">
+            AND DATE(so.pay_time) &lt;= DATE(#{maps.payeTime})
+        </if>
+        <if test="maps.orderCreateType != null">
+            AND so.order_create_type = #{maps.orderCreateType}
+        </if>
+        <if test="maps.patientName != null">
+            AND p.patient_name LIKE CONCAT('%', #{maps.patientName}, '%')
+        </if>
+        <if test="maps.doctorName != null">
+            AND d.doctor_name LIKE CONCAT('%', #{maps.doctorName}, '%')
+        </if>
+        <if test="maps.orderType != null">
+            AND so.order_type = #{maps.orderType}
+        </if>
+        <if test="maps.deliverySendsTime != null">
+            AND DATE(so.delivery_send_time) &gt;= DATE(#{maps.deliverySendsTime})
+        </if>
+        <if test="maps.deliverySendeTime != null">
+            AND DATE(so.delivery_send_time) &lt;= DATE(#{maps.deliverySendeTime})
+        </if>
+        <if test="maps.deliveryImportsTime != null">
+            AND DATE(so.delivery_import_time) &gt;= DATE(#{maps.deliveryImportsTime})
+        </if>
+        <if test="maps.deliveryImporteTime != null">
+            AND DATE(so.delivery_import_time) &lt;= DATE(#{maps.deliveryImporteTime})
+        </if>
+        <if test="maps.tuisTime != null">
+            AND DATE(so.tui_money_time) &gt;= DATE(#{maps.tuisTime})
+        </if>
+        <if test="maps.tuieTime != null">
+            AND DATE(so.tui_money_time) &lt;= DATE(#{maps.tuieTime})
+        </if>
+        <if test="maps.companyUserNickName != null and maps.companyUserNickName != ''">
+            AND cu.nick_name LIKE CONCAT(#{maps.companyUserNickName}, '%')
+        </if>
+        <if test="maps.userId != null">
+            AND so.user_id = #{maps.userId}
+        </if>
+        <if test="maps.companyIds != null and  maps.companyIds.size >0">
+            and so.company_id in
+            <foreach collection="maps.companyIds" item="companyId" open="(" close=")" separator=",">
+                #{companyId}
+            </foreach>
+        </if>
+        <choose>
+            <when test="maps.companyId != null and maps.companyId == '-1'">
+                AND so.company_id IS NULL
+            </when>
+            <when test="maps.companyId != null">
+                AND so.company_id = #{maps.companyId}
+            </when>
+        </choose>
+        <if test="maps.deliveryStatus != null">
+            AND so.delivery_status = #{maps.deliveryStatus}
+        </if>
+        <if test="maps.deliveryPayStatus != null">
+            AND so.delivery_pay_status = #{maps.deliveryPayStatus}
+        </if>
+        <if test="maps.tuiMoneyStatus != null">
+            AND so.tui_money_status = #{maps.tuiMoneyStatus}
+        </if>
+        <if test="maps.deptId != null">
+            AND (so.dept_id = #{maps.deptId} OR so.dept_id IN (
+            SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors)
+            )
+        </if>
+        <if test="maps.packageName != null and maps.packageName != ''">
+            AND so.package_name LIKE CONCAT('%', #{maps.packageName}, '%')
+        </if>
+        <if test="maps.payType != null">
+            AND so.pay_type IN
+            <foreach collection="maps.payType.split(',')" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <choose>
+            <when test="maps.scheduleId != null and maps.scheduleId == '-1'">
+                AND so.schedule_id IS NULL
+            </when>
+            <when test="maps.scheduleId != null">
+                AND so.schedule_id IN
+                <foreach collection="maps.scheduleId.split(',')" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </when>
+        </choose>
+        <choose>
+            <when test="maps.orderBuyType != null and maps.orderBuyType == '-1'">
+                AND so.order_buy_type IS NULL
+            </when>
+            <when test="maps.orderBuyType != null">
+                AND so.order_buy_type IN
+                <foreach collection="maps.orderBuyType.split(',')" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </when>
+        </choose>
+        <choose>
+            <when test="maps.orderChannel != null and maps.orderChannel == '-1'">
+                AND so.order_channel IS NULL
+            </when>
+            <when test="maps.orderChannel != null">
+                AND so.order_channel IN
+                <foreach collection="maps.orderChannel.split(',')" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </when>
+        </choose>
+        <choose>
+            <when test="maps.qwSubject != null and maps.qwSubject == '-1'">
+                AND so.qw_subject IS NULL
+            </when>
+            <when test="maps.qwSubject != null">
+                AND so.qw_subject IN
+                <foreach collection="maps.qwSubject.split(',')" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </when>
+        </choose>
+        <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
+            and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')
+        </if>
+        <if test="maps.erpAccount != null and maps.erpAccount != '未分拣' and maps.erpAccount != ''">
+            and df.login_account like #{maps.erpAccount}
+        </if>
+        <if test="maps.erpAccount == '未分拣'">
+            and ( df.login_account is null or df.login_account like '')
+        </if>
+
+        ${maps.params.dataScope}
+        ORDER BY
+
+        <if test="maps.sortField == 'companyUserName'">
+            cu.nick_name
+        </if>
+        <if test="maps.sortField == 'packageName'">
+            so.package_name
+        </if>
+        <if test="maps.sortField == 'payPrice'">
+            so.pay_price
+        </if>
+        <if test="maps.sortField == 'payMoney'">
+            so.pay_money
+        </if>
+        <if test="maps.sortOrder != null and maps.sortOrder != ''">
+            ${maps.sortOrder}
+        </if>
+        <if test="maps.sortField == null or maps.sortField == ''">
+            so.order_id desc
+        </if>
+        LIMIT 30000
+
+
+    </select>
 </mapper>

+ 7 - 0
fs-user-app/src/main/java/com/fs/app/controller/UserController.java

@@ -270,4 +270,11 @@ public class UserController extends  AppBaseController {
         return R.ok().put("data",url);
     }
 
+    @Login
+    @ApiOperation("删除用户(逻辑删除)")
+    @PostMapping("/deleteUser/{id}")
+    public R deleteUser(@PathVariable("id") Long id ){
+        return userService.updateStatus(id);
+    }
+
 }

+ 2 - 2
fs-user-app/src/main/java/com/fs/app/controller/WxH5MpController.java

@@ -132,14 +132,14 @@ public class WxH5MpController {
             userUpdate.setMpOpenId(wxMpUser.getOpenid());
             userUpdate.setUnionId(wxMpUser.getUnionId());
             userUpdate.setUpdateTime(new DateTime());
-            userUpdate.setNickname(wxMpUser.getNickname());
+            userUpdate.setNickName(wxMpUser.getNickname());
             userUpdate.setAvatar(wxMpUser.getHeadImgUrl());
             userService.updateFsUser(userUpdate);
             return userUpdate;
         } else {
             // 创建新用户
             FsUser newUser = new FsUser();
-            newUser.setNickname(wxMpUser.getNickname());
+            newUser.setNickName(wxMpUser.getNickname());
             newUser.setAvatar(wxMpUser.getHeadImgUrl());
             newUser.setStatus(1);
             newUser.setMpOpenId(wxMpUser.getOpenid());