Bläddra i källkod

Merge remote-tracking branch 'origin/master'

yfh 1 vecka sedan
förälder
incheckning
4c18059ebe

+ 4 - 1
fs-admin/src/main/java/com/fs/course/controller/FsCoursePlaySourceConfigController.java

@@ -48,11 +48,14 @@ public class FsCoursePlaySourceConfigController extends BaseController {
                               @RequestParam(required = false) String appid,
                               @RequestParam(required = false) Integer isMall,
                               @RequestParam(required = false, defaultValue = "1") Integer pageNum,
-                              @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
+                              @RequestParam(required = false, defaultValue = "10") Integer pageSize,
+                              @RequestParam(required = false) Long companyId
+    ) {
         Map<String, Object> params = new HashMap<>();
         params.put("name", name);
         params.put("appid", appid);
         params.put("isMall", isMall);
+        params.put("companyId", companyId);
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         String json = configService.selectConfigByKey("course.config");
         CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);

+ 42 - 33
fs-admin/src/main/java/com/fs/his/controller/FsUserController.java

@@ -18,6 +18,7 @@ import com.fs.course.param.FsCourseLinkCreateParam;
 import com.fs.course.service.IFsUserCompanyUserService;
 import com.fs.course.service.IFsUserCourseService;
 import com.fs.his.domain.FsUserAddress;
+import com.fs.his.dto.FsUserDTO;
 import com.fs.his.enums.FsUserIntegralLogTypeEnum;
 import com.fs.his.mapper.FsUserMapper;
 import com.fs.his.param.FsUserAddIntegralTemplateParam;
@@ -121,6 +122,47 @@ public class FsUserController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 导出用户列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:user:export')")
+    @Log(title = "用户", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsUserParam fsUser)
+    {
+        logger.info("导出用户列表:"+ SecurityUtils.getUserId());
+        if (fsUserService.isEntityNull(fsUser)){
+            return AjaxResult.error("请筛选数据导出");
+        }
+        Long count = fsUserService.selectFsUserExportListVOCount(fsUser);
+        if (count>10000){
+            return AjaxResult.error("导出数据不可超过1w条");
+        }
+        List<FsUserVO> list = fsUserService.selectFsUserListVO(fsUser);
+        SysRole sysRole = isCheckPermission();
+        List<FsUserDTO> listDTO = Lists.newArrayList();
+        for (FsUserVO fsUserVO : list) {
+            if(fsUserVO.getPhone() != null&&fsUserVO.getPhone()!=""){
+                if (!(sysRole.getIsCheckPhone()==1)){
+                    if (fsUserVO.getPhone().length()>11){
+                        fsUserVO.setPhone(decryptPhoneMk(fsUserVO.getPhone()));
+                    }else {
+                        fsUserVO.setPhone(fsUserVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    }
+                } else {
+                    if (fsUserVO.getPhone().length()>11) {
+                        fsUserVO.setPhone(decryptPhone(fsUserVO.getPhone()));
+                    }
+                }
+            }
+            FsUserDTO fsUserDTO = new FsUserDTO();
+            BeanUtils.copyProperties(fsUserVO,fsUserDTO);
+            listDTO.add(fsUserDTO);
+        }
+        ExcelUtil<FsUserDTO> util = new ExcelUtil<FsUserDTO>(FsUserDTO.class);
+        return util.exportExcel(listDTO, "用户数据");
+    }
+
     @Autowired
     private ISysRoleService sysRoleService;
     private SysRole isCheckPermission() {
@@ -196,37 +238,6 @@ public class FsUserController extends BaseController
         return util.exportExcel(list, "项目会员数据");
     }
 
-    /**
-     * 导出用户列表
-     */
-    @PreAuthorize("@ss.hasPermi('his:user:export')")
-    @Log(title = "用户", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(FsUserParam fsUser)
-    {
-        logger.info("导出用户列表:"+ SecurityUtils.getUserId());
-        if (fsUserService.isEntityNull(fsUser)){
-            return AjaxResult.error("请筛选数据导出");
-        }
-        Long count = fsUserService.selectFsUserExportListVOCount(fsUser);
-        if (count>10000){
-            return AjaxResult.error("导出数据不可超过1w条");
-        }
-        List<FsUserExportListVO> list = fsUserService.selectFsUserExportListVO(fsUser);
-        SysRole sysRole = isCheckPermission();
-        for (FsUserExportListVO vo : list) {
-            if (vo.getMobile()!=null && !(sysRole.getIsCheckPhone()==1)){
-                vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
-            } else {
-                if (vo.getMobile().length()>11){
-                    vo.setMobile(decryptPhone(vo.getMobile()));
-                }
-            }
-        }
-        ExcelUtil<FsUserExportListVO> util = new ExcelUtil<FsUserExportListVO>(FsUserExportListVO.class);
-        return util.exportExcel(list, "用户数据");
-    }
-
     /**
      * 获取用户详细信息
      */
@@ -238,8 +249,6 @@ public class FsUserController extends BaseController
         return AjaxResult.success(fsUser);
     }
 
-
-
     @GetMapping(value = "/getUserAddr/{userId}")
     public AjaxResult getUserAddr(@PathVariable("userId") Long userId)
     {

+ 6 - 4
fs-service/src/main/java/com/fs/company/mapper/CompanyRechargeMapper.java

@@ -84,11 +84,13 @@ public interface CompanyRechargeMapper
             "<if test = 'maps.payType != null  '> " +
             "and r.pay_type = #{maps.payType}" +
             "</if>" +
-            "<if test = 'maps.beginTime != null and maps.beginTime != \"\" '> " +
-            "and date_format(r.pay_time,'%y%m%d') &gt;= date_format(#{maps.beginTime},'%y%m%d') " +
+            "<if test= 'maps.params != null and maps.params !=\"\"'>"+
+            "<if test = 'maps.params.beginTime != null and maps.params.beginTime != \"\" '> " +
+            "and date_format(r.pay_time,'%y%m%d') &gt;= date_format(#{maps.params.beginTime},'%y%m%d') " +
             "</if>" +
-            "<if test = 'maps.endTime != null and maps.endTime != \"\" '> " +
-            "and date_format(r.pay_time,'%y%m%d') &lt;= date_format(#{maps.endTime},'%y%m%d') " +
+            "<if test = 'maps.params.endTime != null and maps.params.endTime != \"\" '> " +
+            "and date_format(r.pay_time,'%y%m%d') &lt;= date_format(#{maps.params.endTime},'%y%m%d') " +
+            "</if>"+
             "</if>" +
             "order by r.recharge_id desc " +
             "</script>"})

+ 58 - 0
fs-service/src/main/java/com/fs/his/dto/FsUserDTO.java

@@ -0,0 +1,58 @@
+package com.fs.his.dto;
+
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @description:
+ * @author: Guos
+ * @time: 2025/10/29 上午9:40
+ */
+@Data
+public class FsUserDTO {
+
+    @Excel(name = "用户ID")
+    private Long userId;
+
+    @Excel(name = "用户昵称")
+    private String nickName;
+
+    @Excel(name = "手机号码")
+    private String phone;
+
+    @Excel(name = "用户积分")
+    private Long integral;
+
+    @Excel(name = "用户状态:1为正常,0为禁止")
+    private Integer status;
+
+    @Excel(name = "用户备注")
+    private String remark;
+
+    @Excel(name = "上级昵称")
+    private String tuiName;
+
+    @Excel(name = "app来源")
+    private String source;
+
+    @Excel(name = "登陆设备")
+    private String loginDevice;
+
+    @Excel(name = "上级手机号码")
+    private String tuiPhone;
+
+    @Excel(name = "下级人数")
+    private Integer tuiUserCount;
+
+    @Excel(name = "最后一次登录ip")
+    private String lastIp;
+
+    @Excel(name = "余额")
+    private BigDecimal balance;
+
+    @Excel(name = "会员注册时间", dateFormat = "yyyy-MM-dd HH:mm:ss" , sort = 6)
+    private Date createTime;
+}

+ 6 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java

@@ -219,6 +219,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" +

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

@@ -181,7 +181,18 @@ public interface FsStorePaymentMapper
     @Select("select * from fs_store_payment where business_type=#{type} and  business_id=#{businessId} and (status=1 or starus=-1)")
     List<FsStorePayment> selectFsStorePaymentByPayOrRefund(int i, Long orderId);
     @Select({"<script> " +
-            " SELECT CONCAT('package-', sp.pay_code) AS pay_code,sp.*,u.nick_name,u.phone,s.store_name,c.company_name,cu.nick_name as companyUserName,fso.delivery_name,fso.package_name,fso.package_second_name ,csc.name miniProgramName " +
+            " SELECT " +
+            " CASE " +
+            "   WHEN sp.business_type = 1 THEN CONCAT('inquiry-', sp.pay_code) " +
+            "   WHEN sp.business_type = 2 THEN CONCAT('store-', sp.pay_code) " +
+            "   WHEN sp.business_type = 3 THEN CONCAT('package-', sp.pay_code) " +
+            "   WHEN sp.business_type = 4 THEN CONCAT('course-', sp.pay_code) " +
+            "   WHEN sp.business_type = 5 THEN CONCAT('appvip-', sp.pay_code) " +
+            "   WHEN sp.business_type = 6 THEN CONCAT('integral-', sp.pay_code) " +
+            "   WHEN sp.business_type = 7 THEN CONCAT('payment-', sp.pay_code) " +
+            "   ELSE sp.pay_code " +
+            " END AS pay_code, " +
+            "sp.*,u.nick_name,u.phone,s.store_name,c.company_name,cu.nick_name as companyUserName,fso.delivery_name,fso.package_name,fso.package_second_name ,csc.name miniProgramName " +
             " FROM fs_store_payment sp " +
             " LEFT JOIN  fs_user u ON u.user_id=sp.user_id " +
             " LEFT JOIN fs_store s ON s.store_id=sp.store_id " +

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

@@ -105,6 +105,32 @@ public interface FsUserMapper
     })
     List<FsUserVO> selectFsUserListVO(FsUserParam fsUser);
 
+    @Select({"<script> " +
+            "SELECT  \n" +
+            "    fp.create_time ,\n" +
+            "    cu.nick_name ,\n" +
+            "    fu.user_id ,\n" +
+            "    fp.patient_name ,\n" +
+            "    fp.mobile ,\n" +
+            "    fu.is_buy \n" +
+            "FROM fs_user fu\n" +
+            "LEFT JOIN company_user_user cuu ON fu.user_id = cuu.user_id\n" +
+            "LEFT JOIN company_user cu ON cuu.company_user_id = cu.user_id\n" +
+            "LEFT JOIN fs_patient fp ON fu.user_id = fp.user_id\n" +
+            "WHERE fp.create_time IS NOT NULL and fu.is_del = 0 \n" +
+            "  <if test=\"companyUserId != null \"> and cuu.company_user_id=#{companyUserId} </if>\n" +
+            "  <if test=\"companyId != null \"> and cuu.company_id=#{companyId} </if>\n" +
+            "  <if test=\"nickName != null  and nickName != ''\"> and fu.nick_name like concat( #{nickName}, '%')</if>\n" +
+            "   <if test=\"phone != null  and phone != ''\"> and fu.phone like concat( #{phone}, '%')</if>\n" +
+            "   <if test=\"status != null \"> and fu.status = #{status}</if>\n" +
+            "            <if test=\"isBuy != null \"> and fu.is_buy = #{isBuy}</if>\n" +
+            "            <if test=\"userId != null \"> and fu.user_id = #{userId}</if>\n" +
+            "            <if test=\"sTime != null \">  and DATE(fu.create_time) &gt;= DATE(#{sTime})</if>\n" +
+            "            <if test=\"eTime != null \">  and DATE(fu.create_time) &lt;= DATE(#{eTime})</if>\n" +
+            "ORDER BY fu.user_id DESC "+
+            "</script>"})
+    List<FsUserExportListVO> selectFsUserExportListVO(FsUserParam fsUser);
+
     @Update("update fs_user set is_del=1 where user_id=#{userId}")
     int updateFsUserByUserId(Long userId);
 
@@ -144,32 +170,6 @@ public interface FsUserMapper
             "</script>"})
     List<FsUserVO> selectFsUserListVOByComponentsUser(FsUserParam fsUser);
 
-    @Select({"<script> " +
-            "SELECT  \n" +
-            "    fp.create_time ,\n" +
-            "    cu.nick_name ,\n" +
-            "    fu.user_id ,\n" +
-            "    fp.patient_name ,\n" +
-            "    fp.mobile ,\n" +
-            "    fu.is_buy \n" +
-            "FROM fs_user fu\n" +
-            "LEFT JOIN company_user_user cuu ON fu.user_id = cuu.user_id\n" +
-            "LEFT JOIN company_user cu ON cuu.company_user_id = cu.user_id\n" +
-            "LEFT JOIN fs_patient fp ON fu.user_id = fp.user_id\n" +
-            "WHERE fp.create_time IS NOT NULL and fu.is_del = 0 \n" +
-            "  <if test=\"companyUserId != null \"> and cuu.company_user_id=#{companyUserId} </if>\n" +
-            "  <if test=\"companyId != null \"> and cuu.company_id=#{companyId} </if>\n" +
-            "  <if test=\"nickName != null  and nickName != ''\"> and fu.nick_name like concat( #{nickName}, '%')</if>\n" +
-            "   <if test=\"phone != null  and phone != ''\"> and fu.phone like concat( #{phone}, '%')</if>\n" +
-            "   <if test=\"status != null \"> and fu.status = #{status}</if>\n" +
-            "            <if test=\"isBuy != null \"> and fu.is_buy = #{isBuy}</if>\n" +
-            "            <if test=\"userId != null \"> and fu.user_id = #{userId}</if>\n" +
-            "            <if test=\"sTime != null \">  and DATE(fu.create_time) &gt;= DATE(#{sTime})</if>\n" +
-            "            <if test=\"eTime != null \">  and DATE(fu.create_time) &lt;= DATE(#{eTime})</if>\n" +
-            "ORDER BY fu.user_id DESC "+
-            "</script>"})
-    List<FsUserExportListVO> selectFsUserExportListVO(FsUserParam fsUser);
-
     @Select("SELECT user_id\n" +
             "FROM fs_user_integral_logs\n" +
             "WHERE business_type = 2\n" +

+ 15 - 4
fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java

@@ -271,11 +271,26 @@ public class FsUserServiceImpl implements IFsUserService {
         return fsUserMapper.updateFsUserByUserId(userId);
     }
 
+    /**
+     * 列表查询
+     * @param fsUser
+     * @return
+     */
     @Override
     public List<FsUserVO> selectFsUserListVO(FsUserParam fsUser) {
         return fsUserMapper.selectFsUserListVO(fsUser);
     }
 
+    /**
+     * 导出用户列表
+     * @param fsUser
+     * @return
+     */
+    @Override
+    public List<FsUserExportListVO> selectFsUserExportListVO(FsUserParam fsUser) {
+        return fsUserMapper.selectFsUserExportListVO(fsUser);
+    }
+
     @Override
     public FsUser selectFsUserByOpenId(String openId) {
         return fsUserMapper.selectFsUserByOpenId(openId);
@@ -313,10 +328,6 @@ public class FsUserServiceImpl implements IFsUserService {
         return fsUserMapper.selectFsUserListVOByComponentsUser(fsUser);
     }
 
-    @Override
-    public List<FsUserExportListVO> selectFsUserExportListVO(FsUserParam fsUser) {
-        return fsUserMapper.selectFsUserExportListVO(fsUser);
-    }
     @Autowired
     private FsUserIntegralLogsMapper integralLogsMapper;
 

+ 7 - 5
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreAfterSalesScrmMapper.java

@@ -119,15 +119,17 @@ public interface FsStoreAfterSalesScrmMapper
             "<if test = 'maps.companyUserNickName != null and  maps.companyUserNickName !=  \"\" '> " +
             "and cu.nick_name like concat('%', #{maps.companyUserNickName}, '%') " +
             "</if>" +
-            "<if test = 'maps.beginTime != null and maps.beginTime != \"\"   '> " +
-            " AND date_format(s.create_time,'%y%m%d') &gt;= date_format(#{maps.beginTime},'%y%m%d') " +
+            "<if test = 'maps.params != null and maps.params != \"\"   '> " +
+            "<if test = 'maps.params.beginTime != null and maps.params.beginTime != \"\"   '> " +
+            " AND date_format(s.create_time,'%y%m%d') &gt;= date_format(#{maps.params.beginTime},'%y%m%d') " +
+            "</if>" +
+            "<if test = 'maps.params.endTime != null and maps.params.endTime != \"\"   '> " +
+            " AND date_format(s.create_time,'%y%m%d') &lt;= date_format(#{maps.params.endTime},'%y%m%d') " +
+            "</if>" +
             "</if>" +
             "<if test = 'maps.consigneePhone != null and  maps.consigneePhone !=\"\"     '> " +
             "and o.user_phone like CONCAT('%',#{maps.consigneePhone},'%') " +
             "</if>" +
-            "<if test = 'maps.endTime != null and maps.endTime != \"\"   '> " +
-            " AND date_format(s.create_time,'%y%m%d') &lt;= date_format(#{maps.endTime},'%y%m%d') " +
-            "</if>" +
             "<if test = 'maps.deptId != null    '> " +
             "  AND (o.dept_id = #{maps.deptId} OR o.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) )) " +
             "</if>" +

+ 6 - 4
fs-service/src/main/java/com/fs/hisStore/mapper/FsStorePaymentScrmMapper.java

@@ -103,11 +103,13 @@ public interface FsStorePaymentScrmMapper
 //            "<if test = 'maps.createTime != null    '> " +
 //            "and DATE_FORMAT(p.create_time,'%Y-%m-%d') = DATE_FORMAT(#{maps.createTime},'%Y-%m-%d')  " +
 //            "</if>" +
-            "<if test = 'maps.beginTime != null and maps.beginTime != \"\"   '> " +
-            " AND date_format(p.pay_time,'%y%m%d') &gt;= date_format(#{maps.beginTime},'%y%m%d') " +
+            "<if test = 'maps.params != null and maps.params != \"\"   '> " +
+            "<if test = 'maps.params.beginTime != null and maps.params.beginTime != \"\"   '> " +
+            " AND date_format(p.pay_time,'%y%m%d') &gt;= date_format(#{maps.params.beginTime},'%y%m%d') " +
+            "</if>" +
+            "<if test = 'maps.params.endTime != null and maps.params.endTime != \"\"   '> " +
+            " AND date_format(p.pay_time,'%y%m%d') &lt;= date_format(#{maps.params.endTime},'%y%m%d') " +
             "</if>" +
-            "<if test = 'maps.endTime != null and maps.endTime != \"\"   '> " +
-            " AND date_format(p.pay_time,'%y%m%d') &lt;= date_format(#{maps.endTime},'%y%m%d') " +
             "</if>" +
 
             "<if test = 'maps.refundBeginTime != null  and maps.refundBeginTime != \"\"    '> " +