Browse Source

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

wjj 6 ngày trước cách đây
mục cha
commit
ba204a4460
16 tập tin đã thay đổi với 340 bổ sung38 xóa
  1. 96 0
      fs-admin/src/main/java/com/fs/crm/controller/HandwriteCollectionController.java
  2. 68 0
      fs-admin/src/main/java/com/fs/crm/controller/HandwritePatientFormController.java
  3. 13 1
      fs-company/src/main/java/com/fs/company/controller/handwrite/HandwriteCollectionController.java
  4. 7 0
      fs-company/src/main/java/com/fs/company/controller/handwrite/HandwritePatientFormController.java
  5. 54 9
      fs-company/src/main/java/com/fs/company/controller/qw/FsCompanyCustomerController.java
  6. 3 3
      fs-service/src/main/java/com/fs/company/service/impl/CompanyUserServiceImpl.java
  7. 15 0
      fs-service/src/main/java/com/fs/handwrite/domain/HandwriteCollection.java
  8. 14 0
      fs-service/src/main/java/com/fs/handwrite/domain/HandwritePatientForm.java
  9. 2 0
      fs-service/src/main/java/com/fs/handwrite/service/impl/HandwriteCollectionServiceImpl.java
  10. 2 0
      fs-service/src/main/java/com/fs/handwrite/service/impl/HandwritePatientFormServiceImpl.java
  11. 1 0
      fs-service/src/main/java/com/fs/his/param/CollectionPhoneParam.java
  12. 1 0
      fs-service/src/main/java/com/fs/his/param/PrescribePhoneParam.java
  13. 3 0
      fs-service/src/main/java/com/fs/qw/domain/FsCompanyCustomer.java
  14. 4 0
      fs-service/src/main/java/com/fs/qw/service/impl/FsCompanyCustomerServiceImpl.java
  15. 30 14
      fs-service/src/main/resources/mapper/handwrite/HandwriteCollectionMapper.xml
  16. 27 11
      fs-service/src/main/resources/mapper/handwrite/HandwritePatientFormMapper.xml

+ 96 - 0
fs-admin/src/main/java/com/fs/crm/controller/HandwriteCollectionController.java

@@ -0,0 +1,96 @@
+package com.fs.crm.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.handwrite.domain.HandwriteCollection;
+import com.fs.handwrite.service.IHandwriteCollectionService;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 手写信息采集表Controller
+ * 
+ * @author fs
+ * @date 2024-01-01
+ */
+@RestController
+@RequestMapping("/handwrite/collection")
+public class HandwriteCollectionController extends BaseController
+{
+    @Autowired
+    private IHandwriteCollectionService handwriteCollectionService;
+
+    /**
+     * 查询手写信息采集表列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(HandwriteCollection handwriteCollection)
+    {
+        startPage();
+        List<HandwriteCollection> list = handwriteCollectionService.selectHandwriteCollectionList(handwriteCollection);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出手写信息采集表列表
+     */
+    @PostMapping("/export")
+    public AjaxResult export(HttpServletResponse response, HandwriteCollection handwriteCollection)
+    {
+        List<HandwriteCollection> list = handwriteCollectionService.selectHandwriteCollectionList(handwriteCollection);
+        ExcelUtil<HandwriteCollection> util = new ExcelUtil<HandwriteCollection>(HandwriteCollection.class);
+        return util.exportExcel(list, "手写信息采集表数据");
+    }
+
+    /**
+     * 获取手写信息采集表详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Integer id)
+    {
+        return AjaxResult.success(handwriteCollectionService.selectHandwriteCollectionById(id));
+    }
+
+
+    /**
+     * 删除手写信息采集表
+     */
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Integer[] ids)
+    {
+        return toAjax(handwriteCollectionService.deleteHandwriteCollectionByIds(ids));
+    }
+
+    /**
+     * 根据商城订单号查询订单信息
+     * */
+    @GetMapping("/getOrderCodeInfo/{orderCode}")
+    public AjaxResult getOrderCodeInfo(@PathVariable String orderCode) {
+        if (StringUtils.isBlank(orderCode)){
+            return AjaxResult.error("订单号不能为空");
+        }
+        FsStoreOrderScrm orderCodeInfo = handwriteCollectionService.getOrderCodeInfo(orderCode);
+        if (orderCodeInfo == null){
+            return AjaxResult.error("商城订单不存在");
+        }
+        return AjaxResult.success(orderCodeInfo);
+    }
+
+    /**
+     * 检测上传的订单号
+     * */
+    @GetMapping("/checkOrderCode/{orderCode}")
+    public AjaxResult checkOrderCode(@PathVariable String orderCode) {
+        if (StringUtils.isBlank(orderCode)){
+            return AjaxResult.error("订单号不能为空");
+        }
+        return handwriteCollectionService.checkOrderCode(orderCode);
+    }
+}

+ 68 - 0
fs-admin/src/main/java/com/fs/crm/controller/HandwritePatientFormController.java

@@ -0,0 +1,68 @@
+package com.fs.crm.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.handwrite.domain.HandwritePatientForm;
+import com.fs.handwrite.service.IHandwritePatientFormService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 手写初诊单Controller
+ * 
+ * @author fs
+ * @date 2024-01-01
+ */
+@RestController
+@RequestMapping("/handwrite/patientForm")
+public class HandwritePatientFormController extends BaseController
+{
+    @Autowired
+    private IHandwritePatientFormService handwritePatientFormService;
+
+    /**
+     * 查询手写初诊单列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(HandwritePatientForm handwritePatientForm)
+    {
+        startPage();
+        List<HandwritePatientForm> list = handwritePatientFormService.selectHandwritePatientFormList(handwritePatientForm);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出手写初诊单列表
+     */
+    @PostMapping("/export")
+    public AjaxResult export(HttpServletResponse response, HandwritePatientForm handwritePatientForm)
+    {
+        List<HandwritePatientForm> list = handwritePatientFormService.selectHandwritePatientFormList(handwritePatientForm);
+        ExcelUtil<HandwritePatientForm> util = new ExcelUtil<HandwritePatientForm>(HandwritePatientForm.class);
+        return util.exportExcel(list, "手写信息初诊单数据");
+    }
+
+    /**
+     * 获取手写初诊单详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Integer id)
+    {
+        return AjaxResult.success(handwritePatientFormService.selectHandwritePatientFormById(id));
+    }
+
+
+    /**
+     * 删除手写初诊单
+     */
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Integer[] ids)
+    {
+        return toAjax(handwritePatientFormService.deleteHandwritePatientFormByIds(ids));
+    }
+}

+ 13 - 1
fs-company/src/main/java/com/fs/company/controller/handwrite/HandwriteCollectionController.java

@@ -6,9 +6,11 @@ import javax.servlet.http.HttpServletResponse;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.framework.security.LoginUser;
+import com.fs.framework.security.SecurityUtils;
 import com.fs.framework.service.TokenService;
 import com.fs.his.param.CollectionOrcParam;
 import com.fs.his.vo.CollectionOrcVO;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import com.fs.common.core.controller.BaseController;
@@ -71,6 +73,9 @@ public class HandwriteCollectionController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody HandwriteCollection handwriteCollection)
     {
+        //获取当前登录用户
+        Long currentUserId = SecurityUtils.getLoginUser().getUser().getUserId();
+        handwriteCollection.setCompanyUserId(currentUserId);
         return toAjax(handwriteCollectionService.insertHandwriteCollection(handwriteCollection));
     }
 
@@ -80,6 +85,9 @@ public class HandwriteCollectionController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody HandwriteCollection handwriteCollection)
     {
+        //获取当前登录用户
+        Long currentUserId = SecurityUtils.getLoginUser().getUser().getUserId();
+        handwriteCollection.setUpdateBy(currentUserId);
         return toAjax(handwriteCollectionService.updateHandwriteCollection(handwriteCollection));
     }
 
@@ -100,7 +108,11 @@ public class HandwriteCollectionController extends BaseController
         if (StringUtils.isBlank(orderCode)){
             return AjaxResult.error("订单号不能为空");
         }
-        return AjaxResult.success(handwriteCollectionService.getOrderCodeInfo(orderCode));
+        FsStoreOrderScrm orderCodeInfo = handwriteCollectionService.getOrderCodeInfo(orderCode);
+        if (orderCodeInfo == null){
+            return AjaxResult.error("商城订单不存在");
+        }
+        return AjaxResult.success(orderCodeInfo);
     }
 
     /**

+ 7 - 0
fs-company/src/main/java/com/fs/company/controller/handwrite/HandwritePatientFormController.java

@@ -3,6 +3,7 @@ package com.fs.company.controller.handwrite;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.fs.framework.security.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import com.fs.common.core.controller.BaseController;
@@ -62,6 +63,9 @@ public class HandwritePatientFormController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody HandwritePatientForm handwritePatientForm)
     {
+        //获取当前登录用户
+        Long currentUserId = SecurityUtils.getLoginUser().getUser().getUserId();
+        handwritePatientForm.setCompanyUserId(currentUserId);
         return toAjax(handwritePatientFormService.insertHandwritePatientForm(handwritePatientForm));
     }
 
@@ -71,6 +75,9 @@ public class HandwritePatientFormController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody HandwritePatientForm handwritePatientForm)
     {
+        //获取当前登录用户
+        Long currentUserId = SecurityUtils.getLoginUser().getUser().getUserId();
+        handwritePatientForm.setUpdateBy(currentUserId);
         return toAjax(handwritePatientFormService.updateHandwritePatientForm(handwritePatientForm));
     }
 

+ 54 - 9
fs-company/src/main/java/com/fs/company/controller/qw/FsCompanyCustomerController.java

@@ -25,9 +25,11 @@ import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.DuplicateKeyException;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -64,18 +66,22 @@ public class FsCompanyCustomerController extends BaseController {
      */
     @GetMapping("/list")
     public TableDataInfo list(FsCompanyCustomer fsCompanyCustomer) {
-//        LoginUser loginUser = SecurityUtils.getLoginUser();
-//        fsCompanyCustomer.setCompanyUserId(loginUser.getUser().getUserId());
-//        //管理员查看所有数据
-//        Long isAdmin = roleMapper.companyUserIsAdmin(fsCompanyCustomer.getCompanyUserId());
-//        if (isAdmin != null) {
-//            fsCompanyCustomer.setCompanyUserId(null);
-//        }
+        // 获取当前登录用户id
+        Long currentUserId = SecurityUtils.getLoginUser().getUser().getUserId();
+        //管理员
+        Long isAdmin = roleMapper.companyUserIsAdmin(fsCompanyCustomer.getCompanyUserId());
         PageHelper.startPage(fsCompanyCustomer.getPageNum(), fsCompanyCustomer.getPageSize());
         List<FsCompanyCustomer> list = fsCompanyCustomerService.selectFsCompanyCustomerList(fsCompanyCustomer);
         // 遍历集合,对每个对象的 phone 属性进行脱敏赋值
         list.forEach(customer -> {
+            // 如果销售 ID 等于当前用户 ID,就是自己的客户
+            customer.setMyCustomerFlag(
+                    customer.getCompanyUserId() != null && customer.getCompanyUserId().equals(currentUserId)
+            );
             customer.setPhone(maskPhoneMiddleFive(customer.getPhone()));
+            if (isAdmin != null) {
+            customer.setMyCustomerFlag(true);  // 如果是管理员全部为自己的客户
+            }
         });
         return getDataTable(list);
     }
@@ -116,7 +122,11 @@ public class FsCompanyCustomerController extends BaseController {
      */
     @GetMapping("/{id}")
     public AjaxResult getInfo(@PathVariable Long id) {
-        return AjaxResult.success(fsCompanyCustomerService.selectFsCompanyCustomerById(id));
+        FsCompanyCustomer fsCompanyCustomer = fsCompanyCustomerService.selectFsCompanyCustomerById(id);
+        if (fsCompanyCustomer!=null){
+            fsCompanyCustomer.setPhone(maskPhoneMiddleFive(fsCompanyCustomer.getPhone()));
+        }
+        return AjaxResult.success(fsCompanyCustomer);
     }
 
     /**
@@ -132,7 +142,14 @@ public class FsCompanyCustomerController extends BaseController {
      */
     @PutMapping
     public AjaxResult edit(@RequestBody FsCompanyCustomer fsCompanyCustomer) {
-        return AjaxResult.success(fsCompanyCustomerService.updateFsCompanyCustomer(fsCompanyCustomer));
+        try {
+            return toAjax(fsCompanyCustomerService.updateFsCompanyCustomer(fsCompanyCustomer));
+        } catch (DuplicateKeyException e) {
+            if (e.getMessage().contains("uk_phone")) {
+                return AjaxResult.error("电话号码已存在,请更换后再试");
+            }
+            return AjaxResult.error("数据冲突,请稍后重试");
+        }
     }
 
     /**
@@ -164,6 +181,20 @@ public class FsCompanyCustomerController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 根据传入客户信息id查询手机号然后获取处方列表信息
+     * */
+    @PostMapping("/getPrescribeListByIdAndPhone")
+    public TableDataInfo getPrescribeListByIdAndPhone(@RequestBody PrescribePhoneParam param){
+        FsCompanyCustomer companyCustomer = fsCompanyCustomerService.selectFsCompanyCustomerById(param.getId());
+        if (companyCustomer == null){
+            return getDataTable(Collections.emptyList());
+        }
+        PageHelper.startPage(param.getPageNum(),param.getPageSize());
+        List<FsPrescribe> list = fsPrescribeService.selectPrescribeListByEncryptPhone(companyCustomer.getPhone());
+        return getDataTable(list);
+    }
+
     /**
      * 根据传入手机号获取信息采集列表数据
      * */
@@ -173,6 +204,20 @@ public class FsCompanyCustomerController extends BaseController {
         List<FsUserInformationCollectionOverviewVo> list = fsUserInformationCollectionService.selectUserInformationCollectionByPhone(param.getPhone());
         return getDataTable(list);
     }
+
+    /**
+     * 根据传入手机号获取信息采集列表数据
+     * */
+    @PostMapping("/getCollectionInfoListByIdAndPhone")
+    public TableDataInfo getCollectionInfoListByIdAndPhone(@RequestBody CollectionPhoneParam param){
+        FsCompanyCustomer companyCustomer = fsCompanyCustomerService.selectFsCompanyCustomerById(param.getId());
+        if (companyCustomer == null){
+            return getDataTable(Collections.emptyList());
+        }
+        PageHelper.startPage(param.getPageNum(),param.getPageSize());
+        List<FsUserInformationCollectionOverviewVo> list = fsUserInformationCollectionService.selectUserInformationCollectionByPhone(companyCustomer.getPhone());
+        return getDataTable(list);
+    }
     /**
      * 销售端-查询医生设置指定可见的患者信息列表
      */

+ 3 - 3
fs-service/src/main/java/com/fs/company/service/impl/CompanyUserServiceImpl.java

@@ -1083,12 +1083,12 @@ public class CompanyUserServiceImpl implements ICompanyUserService
     @Override
     public CompanyUserAndDoctorVO getCompanyUserAndDoctor(Long companyUserId) {
         if (companyUserId==null){
-            throw new ServiceException("销售人员不存在");
+            throw new CustomException("销售人员不存在");
         }
 
         CompanyUser companyUser = companyUserService.selectCompanyUserById(companyUserId);
         if (companyUser==null){
-            throw new ServiceException("销售人员不存在");
+            throw new CustomException("销售人员不存在");
         }
         CompanyUserAndDoctorVO companyUserAndDoctorVO=new CompanyUserAndDoctorVO();
         companyUserAndDoctorVO.setCompanyUserId(companyUser.getUserId());
@@ -1096,7 +1096,7 @@ public class CompanyUserServiceImpl implements ICompanyUserService
         FsDoctor fsDoctor = doctorMapper.selectFsDoctorByDoctorId(companyUser.getDoctorId());
         if (fsDoctor==null){
             log.error("销售人员所绑定的医生不存在,销售companyUserId:{}",companyUserId);
-            return companyUserAndDoctorVO;
+            throw new CustomException("未找到销售人员绑定的医生信息");
         }
         companyUserAndDoctorVO.setDoctorId(fsDoctor.getDoctorId());
         companyUserAndDoctorVO.setDoctorName(fsDoctor.getDoctorName());

+ 15 - 0
fs-service/src/main/java/com/fs/handwrite/domain/HandwriteCollection.java

@@ -46,4 +46,19 @@ public class HandwriteCollection implements Serializable
     /** 订单号 */
     @Excel(name = "订单号")
     private String orderCode;
+
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private Long createBy;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private Long updateBy;
+
+    /** 销售id*/
+    private Long companyUserId;
+
+    /** 销售名称*/
+    private String companyUserName;
 }

+ 14 - 0
fs-service/src/main/java/com/fs/handwrite/domain/HandwritePatientForm.java

@@ -42,4 +42,18 @@ public class HandwritePatientForm implements Serializable
     /** 初诊单url */
     @Excel(name = "初诊单url")
     private String billImgUrl;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private Long createBy;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private Long updateBy;
+
+    /** 销售id*/
+    private Long companyUserId;
+
+    /** 销售名称*/
+    private String companyUserName;
 }

+ 2 - 0
fs-service/src/main/java/com/fs/handwrite/service/impl/HandwriteCollectionServiceImpl.java

@@ -68,6 +68,8 @@ public class HandwriteCollectionServiceImpl implements IHandwriteCollectionServi
     {
         handwriteCollection.setCreateTime(new Date());
         handwriteCollection.setUpdateTime(new Date());
+        handwriteCollection.setCreateBy(handwriteCollection.getCompanyUserId());
+        handwriteCollection.setUpdateBy(handwriteCollection.getCompanyUserId());
         try {
             return handwriteCollectionMapper.insertHandwriteCollection(handwriteCollection);
         } catch (DuplicateKeyException e) {

+ 2 - 0
fs-service/src/main/java/com/fs/handwrite/service/impl/HandwritePatientFormServiceImpl.java

@@ -37,6 +37,8 @@ public class HandwritePatientFormServiceImpl implements IHandwritePatientFormSer
     {
         handwritePatientForm.setCreateTime(new Date());
         handwritePatientForm.setUpdateTime(new Date());
+        handwritePatientForm.setCreateBy(handwritePatientForm.getCompanyUserId());
+        handwritePatientForm.setUpdateBy(handwritePatientForm.getCompanyUserId());
         return handwritePatientFormMapper.insertHandwritePatientForm(handwritePatientForm);
     }
 

+ 1 - 0
fs-service/src/main/java/com/fs/his/param/CollectionPhoneParam.java

@@ -4,6 +4,7 @@ import lombok.Data;
 
 @Data
 public class CollectionPhoneParam {
+    private Long id;//客户信息表主键id
     private String phone;
     //分页相关
     private Integer pageNum;

+ 1 - 0
fs-service/src/main/java/com/fs/his/param/PrescribePhoneParam.java

@@ -4,6 +4,7 @@ import lombok.Data;
 
 @Data
 public class PrescribePhoneParam {
+    private Long id;//客户信息表主键id
     private String phone;
     //分页相关
     private Integer pageNum;

+ 3 - 0
fs-service/src/main/java/com/fs/qw/domain/FsCompanyCustomer.java

@@ -83,4 +83,7 @@ public class FsCompanyCustomer extends BaseEntity {
     // 分页相关
     private Integer pageNum;
     private Integer pageSize;
+
+    /** 是否为自己客户(非数据库字段)true:自己的客户,false:其他人的客户 */
+    private Boolean myCustomerFlag;
 }

+ 4 - 0
fs-service/src/main/java/com/fs/qw/service/impl/FsCompanyCustomerServiceImpl.java

@@ -67,6 +67,10 @@ public class FsCompanyCustomerServiceImpl implements IFsCompanyCustomerService {
 
     @Override
     public int updateFsCompanyCustomer(FsCompanyCustomer fsCompanyCustomer) {
+        if (fsCompanyCustomer.getPhone()!=null&&fsCompanyCustomer.getPhone().contains("*")){
+            //若提交的号码是脱敏的号码,则不需要更新号码
+            fsCompanyCustomer.setPhone(null);
+        }
         return fsCompanyCustomerMapper.updateFsCompanyCustomer(fsCompanyCustomer);
     }
 

+ 30 - 14
fs-service/src/main/resources/mapper/handwrite/HandwriteCollectionMapper.xml

@@ -5,29 +5,36 @@
 <mapper namespace="com.fs.handwrite.mapper.HandwriteCollectionMapper">
 
     <resultMap type="HandwriteCollection" id="HandwriteCollectionResult">
-        <result property="id"           column="id"            />
-        <result property="patientName"  column="patient_name"  />
-        <result property="patientPhone" column="patient_phone" />
-        <result property="createTime"   column="create_time"   />
-        <result property="updateTime"   column="update_time"   />
-        <result property="billImgUrl"   column="bill_img_url"  />
-        <result property="orderCode"    column="order_code"    />
+        <result property="id"            column="id"            />
+        <result property="patientName"   column="patient_name"  />
+        <result property="patientPhone"  column="patient_phone" />
+        <result property="createTime"    column="create_time"   />
+        <result property="updateTime"    column="update_time"   />
+        <result property="billImgUrl"    column="bill_img_url"  />
+        <result property="orderCode"     column="order_code"    />
+        <result property="createBy"      column="create_by"     />
+        <result property="updateBy"      column="update_by"     />
+        <result property="companyUserId" column="company_user_id"/>
     </resultMap>
 
     <sql id="selectHandwriteCollectionVo">
-        select id, patient_name, patient_phone, create_time, update_time, bill_img_url, order_code
+        select id, patient_name, patient_phone, create_time, update_time, bill_img_url, order_code, create_by, update_by, company_user_id
         from fs_handwrite_collection
     </sql>
 
     <select id="selectHandwriteCollectionList" parameterType="HandwriteCollection" resultMap="HandwriteCollectionResult">
-        <include refid="selectHandwriteCollectionVo"/>
+        select hc.id, hc.patient_name, hc.patient_phone, hc.create_time, hc.update_time,
+               hc.bill_img_url, hc.order_code, hc.create_by, hc.update_by, hc.company_user_id,
+               cu.nick_name as companyUserName
+        from fs_handwrite_collection hc left join company_user cu on cu.user_id = hc.company_user_id
         <where>
-            <if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
-            <if test="patientPhone != null and patientPhone != ''"> and patient_phone like concat('%', #{patientPhone}, '%')</if>
-            <if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
-            <if test="billImgUrl != null and billImgUrl != ''"> and bill_img_url = #{billImgUrl}</if>
+            <if test="patientName != null and patientName != ''"> and hc.patient_name like concat('%', #{patientName}, '%')</if>
+            <if test="patientPhone != null and patientPhone != ''"> and hc.patient_phone like concat('%', #{patientPhone}, '%')</if>
+            <if test="companyUserName != null and companyUserName != ''"> and cu.nick_name like concat('%', #{companyUserName}, '%')</if>
+            <if test="orderCode != null and orderCode != ''"> and hc.order_code = #{orderCode}</if>
+            <if test="billImgUrl != null and billImgUrl != ''"> and hc.bill_img_url = #{billImgUrl}</if>
         </where>
-        order by create_time desc
+        order by hc.create_time desc
     </select>
 
     <select id="selectHandwriteCollectionById" parameterType="Integer" resultMap="HandwriteCollectionResult">
@@ -44,6 +51,9 @@
             <if test="updateTime != null">update_time,</if>
             <if test="billImgUrl != null">bill_img_url,</if>
             <if test="orderCode != null">order_code,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="companyUserId != null">company_user_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="patientName != null">#{patientName},</if>
@@ -52,6 +62,9 @@
             <if test="updateTime != null">#{updateTime},</if>
             <if test="billImgUrl != null">#{billImgUrl},</if>
             <if test="orderCode != null">#{orderCode},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
         </trim>
     </insert>
 
@@ -64,6 +77,9 @@
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="billImgUrl != null">bill_img_url = #{billImgUrl},</if>
             <if test="orderCode != null">order_code = #{orderCode},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
         </trim>
         where id = #{id}
     </update>

+ 27 - 11
fs-service/src/main/resources/mapper/handwrite/HandwritePatientFormMapper.xml

@@ -5,25 +5,32 @@
 <mapper namespace="com.fs.handwrite.mapper.HandwritePatientFormMapper">
 
     <resultMap type="HandwritePatientForm" id="HandwritePatientFormResult">
-        <result property="id"           column="id"            />
-        <result property="patientName"  column="patient_name"  />
-        <result property="patientPhone" column="patient_phone" />
-        <result property="createTime"   column="create_time"   />
-        <result property="updateTime"   column="update_time"   />
-        <result property="billImgUrl"   column="bill_img_url"  />
+        <result property="id"            column="id"            />
+        <result property="patientName"   column="patient_name"  />
+        <result property="patientPhone"  column="patient_phone" />
+        <result property="createTime"    column="create_time"   />
+        <result property="updateTime"    column="update_time"   />
+        <result property="billImgUrl"    column="bill_img_url"  />
+        <result property="createBy"      column="create_by"     />
+        <result property="updateBy"      column="update_by"     />
+        <result property="companyUserId" column="company_user_id"/>
     </resultMap>
 
     <sql id="selectHandwritePatientFormVo">
-        select id, patient_name, patient_phone, create_time, update_time, bill_img_url
+        select id, patient_name, patient_phone, create_time, update_time, bill_img_url, create_by, update_by, company_user_id
         from fs_handwrite_patient_form
     </sql>
 
     <select id="selectHandwritePatientFormList" parameterType="HandwritePatientForm" resultMap="HandwritePatientFormResult">
-        <include refid="selectHandwritePatientFormVo"/>
+        select hpf.id, hpf.patient_name, hpf.patient_phone, hpf.create_time,hpf.update_time,
+               hpf.bill_img_url, hpf.create_by, hpf.update_by, hpf.company_user_id,cu.user_name as companyUserName
+        from fs_handwrite_patient_form hpf
+        left join company_user cu on cu.user_id = hpf.company_user_id
         <where>
-            <if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
-            <if test="patientPhone != null and patientPhone != ''"> and patient_phone like concat('%', #{patientPhone}, '%')</if>
-            <if test="billImgUrl != null and billImgUrl != ''"> and bill_img_url = #{billImgUrl}</if>
+            <if test="patientName != null and patientName != ''"> and hpf.patient_name like concat('%', #{patientName}, '%')</if>
+            <if test="patientPhone != null and patientPhone != ''"> and hpf.patient_phone like concat('%', #{patientPhone}, '%')</if>
+            <if test="companyUserName != null and companyUserName != ''"> and cu.nick_name like concat('%', #{companyUserName}, '%')</if>
+            <if test="billImgUrl != null and billImgUrl != ''"> and hpf.bill_img_url = #{billImgUrl}</if>
         </where>
         order by create_time desc
     </select>
@@ -41,6 +48,9 @@
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="billImgUrl != null">bill_img_url,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="companyUserId != null">company_user_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="patientName != null">#{patientName},</if>
@@ -48,6 +58,9 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="billImgUrl != null">#{billImgUrl},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
         </trim>
     </insert>
 
@@ -59,6 +72,9 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="billImgUrl != null">bill_img_url = #{billImgUrl},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
         </trim>
         where id = #{id}
     </update>