Quellcode durchsuchen

多店铺代码店铺、商品日志、店铺商品审核及日志

chenguo vor 1 Woche
Ursprung
Commit
c8ae0a5cb0
37 geänderte Dateien mit 1046 neuen und 71 gelöschten Zeilen
  1. 24 0
      fs-admin/src/main/java/com/fs/hisStore/FsHisStoreLogController.java
  2. 12 0
      fs-admin/src/main/java/com/fs/hisStore/FsStoreProductScrmController.java
  3. 19 2
      fs-admin/src/main/java/com/fs/hisStore/FsStoreScrmController.java
  4. 11 1
      fs-admin/src/main/java/com/fs/hisStore/SysOperlogScrmController.java
  5. 7 2
      fs-common/src/main/java/com/fs/common/enums/BusinessType.java
  6. 25 2
      fs-framework/src/main/java/com/fs/framework/aspectj/LogAspect.java
  7. 7 1
      fs-framework/src/main/java/com/fs/framework/manager/factory/AsyncFactory.java
  8. 4 0
      fs-service/src/main/java/com/fs/his/param/FsStoreAuditParam.java
  9. 38 1
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java
  10. 27 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreScrm.java
  11. 23 0
      fs-service/src/main/java/com/fs/hisStore/domain/SysOperLogScrm.java
  12. 10 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java
  13. 10 1
      fs-service/src/main/java/com/fs/hisStore/mapper/SysOperLogScrmMapper.java
  14. 10 0
      fs-service/src/main/java/com/fs/hisStore/param/FsHisStoreAuditParam.java
  15. 33 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductAddEditParam.java
  16. 9 0
      fs-service/src/main/java/com/fs/hisStore/param/StoreOperMainQueryParam.java
  17. 31 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsHisStoreAuditLogScrmService.java
  18. 2 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreProductScrmService.java
  19. 1 1
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreScrmService.java
  20. 9 0
      fs-service/src/main/java/com/fs/hisStore/service/ISysOperLogScrmService.java
  21. 56 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsHisStoreAuditLogScrmServiceImpl.java
  22. 39 45
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java
  23. 17 7
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java
  24. 50 2
      fs-service/src/main/java/com/fs/hisStore/service/impl/SysOperLogScrmServiceImpl.java
  25. 43 0
      fs-service/src/main/java/com/fs/hisStore/utils/StoreAuditLogUtil.java
  26. 19 1
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductActivityListVO.java
  27. 37 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductExportVO.java
  28. 18 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductListQueryVO.java
  29. 37 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductListVO.java
  30. 19 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductQueryVO.java
  31. 11 0
      fs-service/src/main/java/com/fs/hisStore/vo/StoreOperMainVO.java
  32. 30 0
      fs-service/src/main/java/com/fs/statis/dto/ProductAuditDTO.java
  33. 30 0
      fs-service/src/main/java/com/fs/statis/dto/StoreAuditDTO.java
  34. 1 0
      fs-service/src/main/resources/application-config-dev.yml
  35. 107 1
      fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml
  36. 110 1
      fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml
  37. 110 3
      fs-service/src/main/resources/mapper/hisStore/SysOperLogScrmMapper.xml

+ 24 - 0
fs-admin/src/main/java/com/fs/hisStore/FsHisStoreLogController.java

@@ -0,0 +1,24 @@
+package com.fs.hisStore;
+
+import com.fs.common.core.domain.R;
+import com.fs.hisStore.domain.SysOperLogScrm;
+import com.fs.hisStore.service.IFsHisStoreAuditLogScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/store/hisStoreLog")
+public class FsHisStoreLogController {
+
+    @Autowired
+    private IFsHisStoreAuditLogScrmService fsHisStoreLogScrmService;
+    @RequestMapping("/{mainId}")
+    public R getInfo(@PathVariable("mainId") Long mainId) {
+        List<SysOperLogScrm> sysOperLogScrms = fsHisStoreLogScrmService.selectOperLogByMainId(mainId);
+        return R.ok().put("data",sysOperLogScrms);
+    }
+}

+ 12 - 0
fs-admin/src/main/java/com/fs/hisStore/FsStoreProductScrmController.java

@@ -20,6 +20,7 @@ import com.fs.hisStore.param.FsStoreTuiProductAttrValueParam;
 import com.fs.hisStore.service.IFsStoreProductAttrScrmService;
 import com.fs.hisStore.service.IFsStoreProductAttrValueScrmService;
 import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.statis.dto.ProductAuditDTO;
 import com.mysql.cj.util.StringUtils;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -66,6 +67,17 @@ public class FsStoreProductScrmController extends BaseController
         return R.ok();
     }
 
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:list')")
+    @PostMapping("/batchAudit")
+    @Log(title = "商品审核", businessType = BusinessType.AUDIT,isStoreLog = true,logParam = {"商品","批量审核商品信息"},
+    logParamExpression = "#p0.getProductIds().size()>1?"
+            +"(#p0.isAudit==1?new String[]{'商品','商品批量审核通过'}: new String[]{'商品','商品批量审核退回'}):" +
+            "(#p0.isAudit==1?new String[]{'商品','商品审核通过'}: new String[]{'商品','商品审核退回'})")
+    public R batchAudit(@RequestBody ProductAuditDTO auditDTO){
+        fsStoreProductService.batchAudit(auditDTO);
+        return R.ok();
+    }
+
     /**
      * 查询商品列表
      */

+ 19 - 2
fs-admin/src/main/java/com/fs/hisStore/FsStoreScrmController.java

@@ -3,6 +3,7 @@ package com.fs.hisStore;
 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.common.utils.ParseUtils;
@@ -10,6 +11,7 @@ import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.hisStore.domain.FsStoreScrm;
 import com.fs.his.param.FsStoreAuditParam;
 import com.fs.hisStore.service.IFsStoreScrmService;
+import com.fs.hisStore.utils.StoreAuditLogUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -29,6 +31,9 @@ public class FsStoreScrmController extends BaseController
     @Autowired
     private IFsStoreScrmService fsStoreService;
 
+    @Autowired
+    private StoreAuditLogUtil storeAuditLogUtil;
+
     /**
      * 查询店铺管理列表
      */
@@ -52,6 +57,7 @@ public class FsStoreScrmController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(FsStoreScrm fsStore)
     {
+        storeAuditLogUtil.generateOperId();
         List<FsStoreScrm> list = fsStoreService.selectFsStoreList(fsStore);
         for (FsStoreScrm store : list) {
             store.setPhone(ParseUtils.parsePhone(store.getPhone()));
@@ -80,7 +86,8 @@ public class FsStoreScrmController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody FsStoreScrm fsStore)
     {
-        return toAjax(fsStoreService.insertFsStore(fsStore));
+        storeAuditLogUtil.addOperLog(fsStoreService.insertFsStore(fsStore));
+        return AjaxResult.success();
     }
 
     /**
@@ -113,7 +120,8 @@ public class FsStoreScrmController extends BaseController
      * 店铺审核
      */
     @PreAuthorize("@ss.hasPermi('his:store:audit')")
-    @Log(title = "店铺审核", businessType = BusinessType.UPDATE,logParam = {"店铺","店铺审核"},isStoreLog = true)
+    @Log(title = "店铺审核", businessType = BusinessType.AUDIT,logParam = {"店铺","店铺审核"},isStoreLog = true
+    ,logParamExpression = "#p0.getIsAudit()==1?new String[]{'店铺','店铺审核通过'}: new String[]{'店铺','店铺审核退回'}")
     @PutMapping("/audit")
     public AjaxResult audit(@RequestBody FsStoreAuditParam fsStore)
     {
@@ -131,4 +139,13 @@ public class FsStoreScrmController extends BaseController
         return toAjax(fsStoreService.refreshFsStore(storeId));
     }
 
+
+    /**
+     * 店铺审核日志
+     * */
+    @PreAuthorize("@ss.hasPermi('his:store:auditLog')")
+    @GetMapping("/auditLog/{storeId}")
+    public R auditLog(@PathVariable Long storeId){
+        return R.ok().put("auditLog",storeAuditLogUtil.selectOperLogByMainId(storeId));
+    }
 }

+ 11 - 1
fs-admin/src/main/java/com/fs/hisStore/SysOperlogScrmController.java

@@ -3,11 +3,14 @@ package com.fs.hisStore;
 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.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.param.StoreOperMainQueryParam;
 import com.fs.hisStore.service.ISysOperLogScrmService;
 import com.fs.hisStore.domain.SysOperLogScrm;
+import com.fs.hisStore.vo.StoreOperMainVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
@@ -28,7 +31,7 @@ public class SysOperlogScrmController extends BaseController
         this.operLogService = operLogService;
     }
 
-    @PreAuthorize("@ss.hasPermi('his:storeLog:export')")
+    @PreAuthorize("@ss.hasPermi('his:storeLog:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysOperLogScrm operLog)
     {
@@ -36,6 +39,13 @@ public class SysOperlogScrmController extends BaseController
         List<SysOperLogScrm> list = operLogService.selectOperLogList(operLog);
         return getDataTable(list);
     }
+    @PreAuthorize("@ss.hasPermi('his:storeLog:list')")
+    @GetMapping("/getMains")
+    public R getMains(StoreOperMainQueryParam operLog)
+    {
+        List<StoreOperMainVO> list = operLogService.getMains(operLog);
+        return R.ok().put("data", list);
+    }
 
     @Log(title = "操作日志", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('his:storeLog:export')")

+ 7 - 2
fs-common/src/main/java/com/fs/common/enums/BusinessType.java

@@ -2,7 +2,7 @@ package com.fs.common.enums;
 
 /**
  * 业务操作类型
- * 
+ *
 
  */
 public enum BusinessType
@@ -51,9 +51,14 @@ public enum BusinessType
      * 生成代码
      */
     GENCODE,
-    
+
     /**
      * 清空数据
      */
     CLEAN,
+
+    /**
+     * 审核
+     * */
+    AUDIT,
 }

+ 25 - 2
fs-framework/src/main/java/com/fs/framework/aspectj/LogAspect.java

@@ -1,6 +1,8 @@
 package com.fs.framework.aspectj;
 
 import java.lang.reflect.Method;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
@@ -11,6 +13,8 @@ import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.bean.BeanUtils;
 import com.fs.framework.web.domain.server.Sys;
 import com.fs.hisStore.domain.SysOperLogScrm;
+import com.fs.statis.dto.ProductAuditDTO;
+import com.fs.statis.dto.StoreAuditDTO;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.Signature;
@@ -18,6 +22,7 @@ import org.aspectj.lang.annotation.*;
 import org.aspectj.lang.reflect.MethodSignature;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
 import org.springframework.expression.EvaluationContext;
 import org.springframework.expression.ExpressionParser;
 import org.springframework.expression.spel.standard.SpelExpressionParser;
@@ -39,6 +44,8 @@ import com.fs.framework.manager.AsyncManager;
 import com.fs.framework.manager.factory.AsyncFactory;
 import com.fs.system.domain.SysOperLog;
 
+import static com.fs.common.utils.SecurityUtils.getUserId;
+
 /**
  * 操作日志记录处理
  *
@@ -123,9 +130,17 @@ public class LogAspect
             getControllerMethodDescription(joinPoint, controllerLog, operLog);
             // 保存数据库
             AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
-            if(controllerLog.isStoreLog()){
+            if(controllerLog.isStoreLog() ){
                 SysOperLogScrm operLogScrm = new SysOperLogScrm();
+                //插入operId
+                String operId = MDC.get("operIds");
                 BeanUtils.copyProperties(operLog, operLogScrm);
+                Long[] operIds = new Long[operId.split(",").length];
+                String[] operIdStrs = operId.split(",");
+                for (int i = 0; i < operIdStrs.length; i++) {
+                    operIds[i] = Long.parseLong(operIdStrs[i]);
+                }
+                operLogScrm.setOperIds(operIds);
                 resolveParam((ProceedingJoinPoint)joinPoint,operLogScrm);
                 AsyncManager.me().execute(AsyncFactory.recordOperScrm(operLogScrm));
             }
@@ -258,7 +273,7 @@ public class LogAspect
 
     private final ExpressionParser parser = new SpelExpressionParser();
 
-    public void resolveParam(ProceedingJoinPoint joinPoint, SysOperLogScrm operLog) throws Throwable {
+    public void resolveParam(ProceedingJoinPoint joinPoint, SysOperLogScrm operLog) {
         // 1. 获取注解实例
         Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
         Log annotation = method.getAnnotation(Log.class);
@@ -300,4 +315,12 @@ public class LogAspect
         operLog.setMainType(logParam[0]);
         operLog.setDes(logParam[1]);
     }
+
+
+    @After("logPointCut()")
+    public void after(JoinPoint joinPoint) throws Throwable {
+        // 移除 MDC 中的 logId
+        MDC.remove("operIds");
+    }
+
 }

+ 7 - 1
fs-framework/src/main/java/com/fs/framework/manager/factory/AsyncFactory.java

@@ -118,8 +118,14 @@ public class AsyncFactory
             {
                 // 远程查询操作地点
                 operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
-                SpringUtils.getBean(ISysOperLogScrmService.class).insertOperlog(operLog);
+                SpringUtils.getBean(ISysOperLogScrmService.class).updateOperLog(operLog);
             }
         };
     }
+
+    /**
+     * 生成日志记录
+     * */
+
+
 }

+ 4 - 0
fs-service/src/main/java/com/fs/his/param/FsStoreAuditParam.java

@@ -9,4 +9,8 @@ public class FsStoreAuditParam {
     private Long storeId;
 
     private Integer isAudit;
+
+    private String reason;
+
+    private String attachImage;
 }

+ 38 - 1
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java

@@ -185,6 +185,9 @@ public class FsStoreProductScrm extends BaseEntity
 
     private Long storeId;
 
+    @TableField(exist = false)
+    private Long[] storeIds;
+
     /**
      * 商品图片
      */
@@ -236,6 +239,40 @@ public class FsStoreProductScrm extends BaseEntity
     @Excel(name = "品牌")
     private String brand;
 
-    private Integer isDrug;
+
+    @Excel(name = "是否药品")
+    private String isDrug;
+    @Excel(name = "药品展示图")
+    private String drugImage;
+    @Excel(name = "药品注册证书编号")
+    private String drugRegCertNo;
+    @Excel(name = "通用名称")
+    private String commonName;
+    @Excel(name = "剂型")
+    private String dosageForm;
+    @Excel(name = "单价")
+    private String unitPrice;
+    @Excel(name = "批号")
+    private String batchNumber;
+    @Excel(name = "上市许可持有人")
+    private String mah;
+    @Excel(name = "上市许可持有人地址")
+    private String mahAddress;
+    @Excel(name = "生产企业")
+    private String manufacturer;
+    @Excel(name = "生产企业地址")
+    private String manufacturerAddress;
+    @Excel(name = "功能主治")
+    private String indications;
+    @Excel(name = "用法用量")
+    private String dosage;
+    @Excel(name = "不良反应")
+    private String adverseReactions;
+    @Excel(name = "禁忌")
+    private String contraindications;
+    @Excel(name = "注意事项")
+    private String precautions;
+    @Excel(name = "审核状态")
+    private String isAudit;
 
 }

+ 27 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreScrm.java

@@ -1,5 +1,6 @@
 package com.fs.hisStore.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
@@ -107,4 +108,30 @@ public class FsStoreScrm extends BaseEntity
 
     private String sendPhone;
 
+    private String enterpriseAddress;
+    private String legalPersonName;
+    private String unifiedSocialCreditCode;
+    private String businessScope;
+    private String businessLicense;
+    private String businessLicenseExpireStart;
+    private String businessLicenseExpireEnd;
+    private String drugLicense;
+    private String drugLicenseExpiryStart;
+    private String drugLicenseExpiryEnd;
+    private String medicalDevice1;
+    private String medicalDevice1ExpiryStart;
+    private String medicalDevice1ExpiryEnd;
+    private String medicalDevice2;
+    private String medicalDevice2ExpiryStart;
+    private String medicalDevice2ExpiryEnd;
+    private String medicalDevice3;
+    private String medicalDevice3ExpiryStart;
+    private String medicalDevice3ExpiryEnd;
+    private String foodLicense;
+    private String foodLicenseExpiryStart;
+    private String foodLicenseExpiryEnd;
+    private String medicalLicense;
+    private String medicalLicenseExpiryStart;
+    private String medicalLicenseExpiryEnd;
+
 }

+ 23 - 0
fs-service/src/main/java/com/fs/hisStore/domain/SysOperLogScrm.java

@@ -1,5 +1,6 @@
 package com.fs.hisStore.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
 import com.fs.common.annotation.Excel.ColumnType;
@@ -8,6 +9,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 操作日志记录表 oper_log
@@ -93,4 +95,25 @@ public class SysOperLogScrm extends BaseEntity
 
     @Excel(name = "描述")
     private String des;
+
+    @Excel(name = "审核原因")
+    private String reason;
+
+    /**
+     *attachImage
+     */
+    @Excel(name = "附件图片")
+    private String attachImage;
+
+    /**
+     * 日志主体Id
+     * */
+    @Excel(name = "日志主体Id")
+    private Long mainId;
+
+    @TableField(exist = false)
+    private String mainName;
+
+    @TableField(exist = false)
+    private Long[] operIds;
 }

+ 10 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -12,6 +12,7 @@ import com.fs.statis.dto.ModifyMoreDTO;
 import com.fs.hisStore.domain.FsStoreProductScrm;
 import com.fs.hisStore.param.FsStoreProductQueryParam;
 import com.fs.hisStore.vo.*;
+import com.fs.statis.dto.ProductAuditDTO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -88,6 +89,13 @@ public interface FsStoreProductScrmMapper
             "</if>" +
             "<if test = 'maps.companyIds != null and maps.companyIds != \"\" '> " +
             "and find_in_set(#{maps.companyIds}, p.company_ids) " +
+            "</if>"+
+            "<if test = 'maps.storeIds != null '>" +
+            "and store_id in " +
+            "<foreach collection='maps.storeIds'  item='item' index='index'  open='(' separator=',' close=')'> #{item} </foreach>" +
+            "</if>" +
+            "<if test = 'maps.isAudit != null '> " +
+            "and p.is_audit = #{maps.isAudit} " +
             "</if>" +
             " order by p.product_id desc "+
             "</script>"})
@@ -277,4 +285,6 @@ public interface FsStoreProductScrmMapper
 
     @Select("select * FROM fs_store_product_rule_scrm WHERE is_del=0")
     List<FsStoreProductRuleScrm> selectFsStoreProductRuleList();
+
+    void batchAudit(ProductAuditDTO auditDTO);
 }

+ 10 - 1
fs-service/src/main/java/com/fs/hisStore/mapper/SysOperLogScrmMapper.java

@@ -1,6 +1,9 @@
 package com.fs.hisStore.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.hisStore.domain.FsUserProjectTagScrm;
 import com.fs.hisStore.domain.SysOperLogScrm;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -9,7 +12,7 @@ import java.util.List;
  *
 
  */
-public interface SysOperLogScrmMapper
+public interface SysOperLogScrmMapper  extends BaseMapper<SysOperLogScrm>
 {
     /**
      * 新增操作日志
@@ -46,4 +49,10 @@ public interface SysOperLogScrmMapper
      * 清空操作日志
      */
     public void cleanOperLog();
+
+    void insertBatchByIds(@Param("entity") List<SysOperLogScrm> sysOperLogScrm);
+    //selectOperLogByMainId
+    List<SysOperLogScrm> selectOperLogByMainId(Long mainId);
+
+    int updateByIncloudIdStr(SysOperLogScrm operLog);
 }

+ 10 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsHisStoreAuditParam.java

@@ -0,0 +1,10 @@
+package com.fs.hisStore.param;
+
+import lombok.Data;
+
+@Data
+public class FsHisStoreAuditParam {
+    private Long operId;
+    private String reason;
+    private String attachImage;
+}

+ 33 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductAddEditParam.java

@@ -147,4 +147,37 @@ public class FsStoreProductAddEditParam implements Serializable
 
     private Long storeId;
 
+    /*isDrug: "0", // 是否药品
+        drugImage: null, // 药品展示图
+        drugRegCertNo: null, // 药品注册证书编号
+        commonName: null, // 通用名称
+        dosageForm: null, // 剂型
+        unitPrice: null, // 单价
+        batchNumber: null, // 批号
+        mah: null, // 上市许可持有人
+        mahAddress: null, // 上市许可持有人地址
+        manufacturer: null, // 生产企业
+        manufacturerAddress: null, // 生产企业地址
+        indications: null, // 功能主治
+        dosage: null, // 用法用量
+        adverseReactions: null, // 不良反应
+        contraindications: null, // 禁忌
+        precautions: null // 注意事项*/
+    private String isDrug;
+    private String drugImage;
+    private String drugRegCertNo;
+    private String commonName;
+    private String dosageForm;
+    private String unitPrice;
+    private String batchNumber;
+    private String mah;
+    private String mahAddress;
+    private String manufacturer;
+    private String manufacturerAddress;
+    private String indications;
+    private String dosage;
+    private String adverseReactions;
+    private String contraindications;
+    private String precautions;
+
 }

+ 9 - 0
fs-service/src/main/java/com/fs/hisStore/param/StoreOperMainQueryParam.java

@@ -0,0 +1,9 @@
+package com.fs.hisStore.param;
+
+import lombok.Data;
+
+@Data
+public class StoreOperMainQueryParam {
+    private String mainType;
+    private String mainKeyword;
+}

+ 31 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsHisStoreAuditLogScrmService.java

@@ -0,0 +1,31 @@
+package com.fs.hisStore.service;
+
+
+import com.fs.hisStore.domain.SysOperLogScrm;
+
+import java.util.List;
+
+/**
+ * 店铺管理Service接口
+ *
+ * @author fs
+ * @date 2023-06-15
+ */
+public interface IFsHisStoreAuditLogScrmService
+{
+    /**
+     * 需要配个Log注解使用,编码目的为扩充日志内容,当前适用于店铺和商品审核
+     * */
+    void addBatchAudit(List<Long> ids, String reason, String attachImage);
+
+
+    void addAudit(Long id, String reason, String attachImage);
+
+    void generateOperId();
+
+    /**
+     * 根据商品id获取商品审核信息
+     * */
+    List<SysOperLogScrm> selectOperLogByMainId(Long productId);
+
+}

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreProductScrmService.java

@@ -15,6 +15,7 @@ import com.fs.statis.dto.ModifyMoreDTO;
 import com.fs.hisStore.domain.FsStoreProductScrm;
 import com.fs.hisStore.param.FsStoreProductAddEditParam;
 import com.fs.hisStore.param.FsStoreProductQueryParam;
+import com.fs.statis.dto.ProductAuditDTO;
 
 /**
  * 商品Service接口
@@ -129,4 +130,5 @@ public interface IFsStoreProductScrmService
     List<FsStoreProductRuleScrm> selectFsStoreProductRuleList();
 
 
+    void batchAudit(ProductAuditDTO auditDTO);
 }

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

@@ -36,7 +36,7 @@ public interface IFsStoreScrmService
      * @param fsStore 店铺管理
      * @return 结果
      */
-    public int insertFsStore(FsStoreScrm fsStore);
+    public Long insertFsStore(FsStoreScrm fsStore);
 
     /**
      * 修改店铺管理

+ 9 - 0
fs-service/src/main/java/com/fs/hisStore/service/ISysOperLogScrmService.java

@@ -1,6 +1,8 @@
 package com.fs.hisStore.service;
 
 import com.fs.hisStore.domain.SysOperLogScrm;
+import com.fs.hisStore.param.StoreOperMainQueryParam;
+import com.fs.hisStore.vo.StoreOperMainVO;
 
 import java.util.List;
 
@@ -46,4 +48,11 @@ public interface ISysOperLogScrmService
      * 清空操作日志
      */
     public void cleanOperLog();
+
+    /**
+     * 修改操作日志
+     * */
+    public int updateOperLog(SysOperLogScrm operLog);
+
+    List<StoreOperMainVO> getMains(StoreOperMainQueryParam operLog);
 }

+ 56 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsHisStoreAuditLogScrmServiceImpl.java

@@ -0,0 +1,56 @@
+package com.fs.hisStore.service.impl;
+
+import com.fs.hisStore.domain.SysOperLogScrm;
+import com.fs.hisStore.mapper.SysOperLogScrmMapper;
+import com.fs.hisStore.service.IFsHisStoreAuditLogScrmService;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class FsHisStoreAuditLogScrmServiceImpl implements IFsHisStoreAuditLogScrmService {
+
+    @Autowired
+    private SysOperLogScrmMapper sysOperLogScrmMapper;
+    @Override
+    public void addBatchAudit(List<Long> ids, String reason, String attachImage) {
+        List<SysOperLogScrm> sysOperLogScrm = ids.stream().map(id -> {
+            SysOperLogScrm LogScrm = new SysOperLogScrm();
+            LogScrm.setMainId(id);
+            LogScrm.setReason(reason);
+            LogScrm.setAttachImage(attachImage);
+            return LogScrm;
+        }).collect(Collectors.toList());
+        sysOperLogScrmMapper.insertBatchByIds(sysOperLogScrm);
+        //将返回的operId拼接成sql的in字句放入MDC中,方便后续查询
+        MDC.put("operIds",
+                sysOperLogScrm.stream()
+                        .map(SysOperLogScrm::getOperId)
+                        .map(String::valueOf)
+                        .collect(Collectors.joining(",")));
+    }
+
+    @Override
+    public void addAudit(Long id, String reason, String attachImage) {
+        List<Long> ids = new ArrayList<>();
+        ids.add(id);
+        addBatchAudit(ids, null, null);
+    }
+
+    @Override
+    public void generateOperId() {
+        addAudit(null, null, null);
+    }
+
+    //selectOperLogByMainId
+    @Override
+    public List<SysOperLogScrm> selectOperLogByMainId(Long id) {
+        return sysOperLogScrmMapper.selectOperLogByMainId(id);
+    }
+
+
+}

+ 39 - 45
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -11,9 +11,7 @@ import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.fs.common.BeanCopyUtils;
-import com.fs.common.annotation.Log;
 import com.fs.common.core.domain.R;
-import com.fs.common.enums.BusinessType;
 import com.fs.common.exception.CustomException;
 import com.fs.common.exception.ServiceException;
 import com.fs.common.utils.DateUtils;
@@ -28,6 +26,7 @@ import com.fs.his.vo.FsStoreProductListSVO;
 import com.fs.his.vo.OptionsVO;
 import com.fs.hisStore.domain.*;
 import com.fs.hisStore.mapper.*;
+import com.fs.hisStore.utils.StoreAuditLogUtil;
 import com.fs.statis.dto.ModifyMoreDTO;
 import com.fs.hisStore.dto.ProductArrtDTO;
 import com.fs.hisStore.dto.ProductAttrCountDto;
@@ -35,6 +34,7 @@ import com.fs.hisStore.param.FsStoreProductAddEditParam;
 import com.fs.hisStore.param.FsStoreProductQueryParam;
 import com.fs.hisStore.service.IFsStoreProductAttrValueScrmService;
 import com.fs.hisStore.vo.*;
+import com.fs.statis.dto.ProductAuditDTO;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -83,6 +83,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Autowired
     @Qualifier("JSTErpGoodsServiceImpl")
     private IErpGoodsService jSTErpGoodsService;
+
+    @Autowired
+    private StoreAuditLogUtil storeAuditLogUtil;
+
     /**
      * 查询商品
      *
@@ -142,6 +146,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Override
     public int deleteFsStoreProductByIds(Long[] productIds)
     {
+        storeAuditLogUtil.addBatchAuditArray(productIds, "", "");
         return fsStoreProductMapper.deleteFsStoreProductByIds(productIds);
     }
 
@@ -298,54 +303,33 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Transactional
     public R addOrEdit(FsStoreProductAddEditParam param) {
         ProductAttrCountDto countDto=computedProductCount(param.getValues());
-
+        FsStoreProductScrm product=new FsStoreProductScrm();
+        BeanUtils.copyProperties(param,product);
+        product.setPrice(countDto.getMinPrice());
+        product.setOtPrice(countDto.getMinOtPrice());
+        product.setCost(countDto.getMinCost());
+        product.setIntegral(Long.parseLong(countDto.getMinIntegral().toString()));
+        product.setStock(Long.parseLong(countDto.getStock().toString()));
+        product.setCompanyIds(param.getCompanyIds());
+        product.setVideo(param.getVideo());
         if(param.getProductId() != null){
-            FsStoreProductScrm product=new FsStoreProductScrm();
-            BeanUtils.copyProperties(param,product);
-            product.setPrice(countDto.getMinPrice());
-            product.setOtPrice(countDto.getMinOtPrice());
-            product.setCost(countDto.getMinCost());
-            product.setIntegral(Long.parseLong(countDto.getMinIntegral().toString()));
-            product.setStock(Long.parseLong(countDto.getStock().toString()));
-            product.setCompanyIds(param.getCompanyIds());
-            product.setVideo(param.getVideo());
             fsStoreProductMapper.updateFsStoreProduct(product);
-            if (param.getSpecType().equals(0)) {
-                ProductArrtDTO fromatDetailDto = ProductArrtDTO.builder()
-                        .value("规格")
-                        .detail(ListUtil.toList("默认"))
-                        .build();
-                List<ProductArrtDTO> items=new ArrayList<>();
-                items.add(fromatDetailDto);
-                param.getValues().get(0).setSku("默认");
-                addProductAttr(product.getProductId(),items,param.getValues());
-            } else {
-                addProductAttr(product.getProductId(),param.getItems(),param.getValues());
-            }
         }
         else{
-            FsStoreProductScrm product=new FsStoreProductScrm();
-            BeanUtils.copyProperties(param,product);
-            product.setPrice(countDto.getMinPrice());
-            product.setOtPrice(countDto.getMinOtPrice());
-            product.setCost(countDto.getMinCost());
-            product.setIntegral(Long.parseLong(countDto.getMinIntegral().toString()));
-            product.setStock(Long.parseLong(countDto.getStock().toString()));
-            product.setCompanyIds(param.getCompanyIds());
-            product.setVideo(param.getVideo());
             fsStoreProductMapper.insertFsStoreProduct(product);
-            if (param.getSpecType().equals(0)) {
-                ProductArrtDTO fromatDetailDto = ProductArrtDTO.builder()
-                        .value("规格")
-                        .detail(ListUtil.toList("默认"))
-                        .build();
-                List<ProductArrtDTO> items=new ArrayList<>();
-                items.add(fromatDetailDto);
-                param.getValues().get(0).setSku("默认");
-                addProductAttr(product.getProductId(),items,param.getValues());
-            } else {
-                addProductAttr(product.getProductId(),param.getItems(),param.getValues());
-            }
+        }
+        storeAuditLogUtil.addOperLog(product.getProductId());
+        if (param.getSpecType().equals(0)) {
+            ProductArrtDTO fromatDetailDto = ProductArrtDTO.builder()
+                    .value("规格")
+                    .detail(ListUtil.toList("默认"))
+                    .build();
+            List<ProductArrtDTO> items=new ArrayList<>();
+            items.add(fromatDetailDto);
+            param.getValues().get(0).setSku("默认");
+            addProductAttr(product.getProductId(),items,param.getValues());
+        } else {
+            addProductAttr(product.getProductId(),param.getItems(),param.getValues());
         }
         return R.ok();
     }
@@ -696,11 +680,13 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
 
     @Override
     public List<FsStoreProductExportVO> selectFsStoreProductExportList(FsStoreProductScrm fsStoreProduct) {
+        storeAuditLogUtil.generateOperId();
         return fsStoreProductMapper.selectFsStoreProductExportList(fsStoreProduct);
     }
 
     @Override
     public String importStoreProduct(List<FsStoreProductExportVO> list, boolean updateSupport) {
+        storeAuditLogUtil.generateOperId();
         if (com.fs.common.utils.StringUtils.isNull(list) || list.size() == 0)
         {
             throw new CustomException("导入商品数据不能为空!");
@@ -793,6 +779,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
 
     @Override
     public void batchModify(ModifyMoreDTO modifyMoreDTO) {
+        storeAuditLogUtil.addBatchAuditList(modifyMoreDTO.getProductId(),"",null);
         fsStoreProductMapper.batchModify(modifyMoreDTO);
     }
 
@@ -967,4 +954,11 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     public List<FsStoreProductRuleScrm> selectFsStoreProductRuleList() {
         return fsStoreProductMapper.selectFsStoreProductRuleList();
     }
+
+    @Override
+    @Transactional
+    public void batchAudit(ProductAuditDTO auditDTO) {
+        fsStoreProductMapper.batchAudit(auditDTO);
+        storeAuditLogUtil.addBatchAuditList(auditDTO.getProductIds(),auditDTO.getReason(),auditDTO.getAttachImage());
+    }
 }

+ 17 - 7
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java

@@ -1,18 +1,18 @@
 package com.fs.hisStore.service.impl;
 
-import com.fs.common.annotation.Log;
-import com.fs.common.enums.BusinessType;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
 import com.fs.his.param.FsStoreAuditParam;
 import com.fs.his.utils.StoreMD5PasswordEncoder;
 import com.fs.hisStore.domain.FsStoreScrm;
 import com.fs.hisStore.mapper.FsStoreScrmMapper;
+import com.fs.hisStore.service.IFsHisStoreAuditLogScrmService;
 import com.fs.hisStore.service.IFsStoreScrmService;
+import com.fs.hisStore.utils.StoreAuditLogUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Collections;
 import java.util.List;
 
 
@@ -28,6 +28,9 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService
     @Autowired
     private FsStoreScrmMapper fsStoreMapper;
 
+    @Autowired
+    private StoreAuditLogUtil storeAuditLogUtil;
+
 
     /**
      * 查询店铺管理
@@ -60,7 +63,7 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService
      * @return 结果
      */
     @Override
-    public int insertFsStore(FsStoreScrm fsStore)
+    public Long insertFsStore(FsStoreScrm fsStore)
     {
         if (fsStore.getAccount()!=null){
             FsStoreScrm fs = fsStoreMapper.selectFsStoreByAccount(fsStore.getAccount());
@@ -71,7 +74,8 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService
         StoreMD5PasswordEncoder storeMD5PasswordEncoder = new StoreMD5PasswordEncoder();
         fsStore.setPassword(storeMD5PasswordEncoder.encode("123456"));
         fsStore.setCreateTime(DateUtils.getNowDate());
-        return fsStoreMapper.insertFsStore(fsStore);
+        fsStoreMapper.insertFsStore(fsStore);
+        return fsStore.getStoreId();
     }
 
     /**
@@ -84,6 +88,7 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService
     public int updateFsStore(FsStoreScrm fsStore)
     {
         fsStore.setUpdateTime(DateUtils.getNowDate());
+        storeAuditLogUtil.addOperLog(fsStore.getStoreId());
         return fsStoreMapper.updateFsStore(fsStore);
     }
 
@@ -96,6 +101,7 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService
     @Override
     public int deleteFsStoreByStoreIds(Long[] storeIds)
     {
+        storeAuditLogUtil.addBatchAuditArray(storeIds,null,null);
         return fsStoreMapper.deleteFsStoreByStoreIds(storeIds);
     }
 
@@ -112,10 +118,13 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService
     }
 
     @Override
+    @Transactional
     public int updateFsStoreAudit(FsStoreAuditParam fsStore) {
 
-
-        return fsStoreMapper.updateFsStoreAudit(fsStore.getStoreId(),fsStore.getIsAudit());
+        fsStoreMapper.updateFsStoreAudit(fsStore.getStoreId(),fsStore.getIsAudit());
+        //更新日志
+        storeAuditLogUtil.addAudit(fsStore.getStoreId(),fsStore.getReason(),fsStore.getAttachImage());
+        return 1;
     }
 
     @Override
@@ -142,6 +151,7 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService
         StoreMD5PasswordEncoder storeMD5PasswordEncoder = new StoreMD5PasswordEncoder();
         fsStoreScrm.setPassword(storeMD5PasswordEncoder.encode("123456"));
         fsStoreScrm.setUpdateTime(DateUtils.getNowDate());
+        storeAuditLogUtil.addOperLog(storeId);
         return fsStoreMapper.updateFsStore(fsStoreScrm);
     }
 

+ 50 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/SysOperLogScrmServiceImpl.java

@@ -1,12 +1,23 @@
 package com.fs.hisStore.service.impl;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.his.domain.FsStoreProduct;
+import com.fs.his.service.IFsStoreProductService;
+import com.fs.hisStore.domain.FsStoreProductScrm;
+import com.fs.hisStore.domain.FsStoreScrm;
 import com.fs.hisStore.mapper.SysOperLogScrmMapper;
+import com.fs.hisStore.param.StoreOperMainQueryParam;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.hisStore.service.IFsStoreScrmService;
 import com.fs.hisStore.service.ISysOperLogScrmService;
 import com.fs.hisStore.domain.SysOperLogScrm;
+import com.fs.hisStore.vo.StoreOperMainVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Collections;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 操作日志 服务层处理
@@ -14,11 +25,16 @@ import java.util.List;
 
  */
 @Service
-public class SysOperLogScrmServiceImpl implements ISysOperLogScrmService
-{
+public class SysOperLogScrmServiceImpl implements ISysOperLogScrmService {
     @Autowired
     private SysOperLogScrmMapper operLogMapper;
 
+    @Autowired
+    private IFsStoreScrmService fsStoreService;
+
+    @Autowired
+    private IFsStoreProductScrmService fsStoreProductService;
+
     /**
      * 新增操作日志
      *
@@ -74,4 +90,36 @@ public class SysOperLogScrmServiceImpl implements ISysOperLogScrmService
     {
         operLogMapper.cleanOperLog();
     }
+
+    @Override
+    public int updateOperLog(SysOperLogScrm operLog) {
+        try {
+            int i =   operLogMapper.updateByIncloudIdStr(operLog);
+        }catch (Exception e){
+            e.printStackTrace();
+            operLogMapper.deleteOperLogByIds(operLog.getOperIds());
+        }
+
+       return 1;
+    }
+
+    @Override
+    public List<StoreOperMainVO> getMains(StoreOperMainQueryParam operLog) {
+        if("店铺".equals(operLog.getMainType())){
+            FsStoreScrm fsStore = new FsStoreScrm();
+            fsStore.setStoreName(operLog.getMainKeyword());
+            //返回店铺id和店铺名称
+          return fsStoreService.selectFsStoreList(fsStore).stream()
+                    .map(fsStore1 -> new StoreOperMainVO(fsStore1.getStoreId().toString(),fsStore1.getStoreName()))
+                    .collect(Collectors.toList());
+        }else if("商品".equals(operLog.getMainType())){
+            FsStoreProductScrm fsStoreProduct = new FsStoreProductScrm();
+            fsStoreProduct.setProductName(operLog.getMainKeyword());
+            return fsStoreProductService.selectFsStoreProductList(fsStoreProduct).stream()
+                    .map(product ->  new StoreOperMainVO(product.getProductId().toString(),product.getProductName()))
+                    .collect(Collectors.toList());
+        }else{
+            return Collections.emptyList();
+        }
+    }
 }

+ 43 - 0
fs-service/src/main/java/com/fs/hisStore/utils/StoreAuditLogUtil.java

@@ -0,0 +1,43 @@
+package com.fs.hisStore.utils;
+
+import com.fs.hisStore.domain.SysOperLogScrm;
+import com.fs.hisStore.service.IFsHisStoreAuditLogScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+
+@Component
+public class StoreAuditLogUtil {
+
+    @Autowired
+    private IFsHisStoreAuditLogScrmService hisStoreAuditLogService;
+
+    public void addBatchAuditList(List<Long> mainIds, String reason, String attachImage) {
+        hisStoreAuditLogService.addBatchAudit(mainIds, reason, attachImage);
+    }
+    public void addBatchAuditArray(Long[] mainIds, String reason, String attachImage) {
+        //将数组转为List
+        List<Long> mainIdList = Arrays.asList(mainIds);
+        hisStoreAuditLogService.addBatchAudit(mainIdList, reason, attachImage);
+    }
+
+    public void addAudit(Long mainId, String reason, String attachImage) {
+        hisStoreAuditLogService.addAudit(mainId, reason, attachImage);
+    }
+
+    public void addOperLog(Long mainId) {
+        hisStoreAuditLogService.addAudit(mainId, null, null);
+    }
+
+    public void generateOperId() {
+        hisStoreAuditLogService.generateOperId();
+    }
+
+    public List<SysOperLogScrm> selectOperLogByMainId(Long mainId) {
+        return hisStoreAuditLogService.selectOperLogByMainId(mainId);
+    }
+
+
+}

+ 19 - 1
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductActivityListVO.java

@@ -8,7 +8,7 @@ import java.math.BigDecimal;
 @Data
 /**
  * 商品对象 fs_store_product
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
@@ -47,6 +47,24 @@ public class FsStoreProductActivityListVO implements Serializable
     /** 库存 */
     private Long stock;
 
+    private String isDrug;
+    private String drugImage;
+    private String drugRegCertNo;
+    private String commonName;
+    private String dosageForm;
+    private String unitPrice;
+    private String batchNumber;
+    private String mah;
+    private String mahAddress;
+    private String manufacturer;
+    private String manufacturerAddress;
+    private String indications;
+    private String dosage;
+    private String adverseReactions;
+    private String contraindications;
+    private String precautions;
+    private String isAudit;
+
 
 
 }

+ 37 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductExportVO.java

@@ -177,4 +177,41 @@ public class FsStoreProductExportVO implements Serializable {
     @Excel(name = "体积")
     private BigDecimal volume;
 
+    @Excel(name = "是否药品")
+    private String isDrug;
+    @Excel(name = "药品展示图")
+    private String drugImage;
+    @Excel(name = "药品注册证书编号")
+    private String drugRegCertNo;
+    @Excel(name = "通用名称")
+    private String commonName;
+    @Excel(name = "剂型")
+    private String dosageForm;
+    @Excel(name = "单价")
+    private String unitPrice;
+    @Excel(name = "批号")
+    private String batchNumber;
+    @Excel(name = "上市许可持有人")
+    private String mah;
+    @Excel(name = "上市许可持有人地址")
+    private String mahAddress;
+    @Excel(name = "生产企业")
+    private String manufacturer;
+    @Excel(name = "生产企业地址")
+    private String manufacturerAddress;
+    @Excel(name = "功能主治")
+    private String indications;
+    @Excel(name = "用法用量")
+    private String dosage;
+    @Excel(name = "不良反应")
+    private String adverseReactions;
+    @Excel(name = "禁忌")
+    private String contraindications;
+    @Excel(name = "注意事项")
+    private String precautions;
+    @Excel(name = "审核状态")
+    private String isAudit;
+    @Excel(name = "归属店铺")
+    private String storeId;
+
 }

+ 18 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductListQueryVO.java

@@ -1,5 +1,6 @@
 package com.fs.hisStore.vo;
 
+import com.fs.common.annotation.Excel;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -34,6 +35,23 @@ public class FsStoreProductListQueryVO implements Serializable
 
     private String unitName;
 
+    private String isDrug;
+    private String drugImage;
+    private String drugRegCertNo;
+    private String commonName;
+    private String dosageForm;
+    private String unitPrice;
+    private String batchNumber;
+    private String mah;
+    private String mahAddress;
+    private String manufacturer;
+    private String manufacturerAddress;
+    private String indications;
+    private String dosage;
+    private String adverseReactions;
+    private String contraindications;
+    private String precautions;
+    private String isAudit;
 
 
 

+ 37 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductListVO.java

@@ -1,5 +1,6 @@
 package com.fs.hisStore.vo;
 
+import com.fs.common.annotation.Excel;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -78,4 +79,40 @@ public class FsStoreProductListVO  implements Serializable
      * 所属公司
      */
     private String companyName;
+
+    private String isDrug;
+
+    private String drugImage;
+
+    private String drugRegCertNo;
+
+    private String commonName;
+
+    private String dosageForm;
+
+    private String unitPrice;
+
+    private String batchNumber;
+
+    private String mah;
+
+    private String mahAddress;
+
+    private String manufacturer;
+
+    private String manufacturerAddress;
+
+    private String indications;
+
+    private String dosage;
+
+    private String adverseReactions;
+
+    private String contraindications;
+
+    private String precautions;
+
+    private String isAudit;
+
+    private String storeId;
 }

+ 19 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductQueryVO.java

@@ -1,5 +1,6 @@
 package com.fs.hisStore.vo;
 
+import com.fs.common.annotation.Excel;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -119,4 +120,22 @@ public class FsStoreProductQueryVO implements Serializable
     /** 所属企业 */
     private String companyIds;
 
+    private String isDrug;
+    private String drugImage;
+    private String drugRegCertNo;
+    private String commonName;
+    private String dosageForm;
+    private String unitPrice;
+    private String batchNumber;
+    private String mah;
+    private String mahAddress;
+    private String manufacturer;
+    private String manufacturerAddress;
+    private String indications;
+    private String dosage;
+    private String adverseReactions;
+    private String contraindications;
+    private String precautions;
+    private String isAudit;
+
 }

+ 11 - 0
fs-service/src/main/java/com/fs/hisStore/vo/StoreOperMainVO.java

@@ -0,0 +1,11 @@
+package com.fs.hisStore.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+@Data
+@AllArgsConstructor
+public class StoreOperMainVO {
+    private String id;
+    private String name;
+}

+ 30 - 0
fs-service/src/main/java/com/fs/statis/dto/ProductAuditDTO.java

@@ -0,0 +1,30 @@
+package com.fs.statis.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 批量修改商品
+ */
+@Data
+public class ProductAuditDTO implements Serializable {
+
+    /**
+     * 产品id
+     */
+    private List<Long> productIds;
+    /**
+     * 审核状态
+     * */
+    private Integer isAudit;
+    /**
+     * 审核理由
+     * */
+    private String reason;
+    /**
+     * 附件图片
+     * */
+    private String attachImage;
+}

+ 30 - 0
fs-service/src/main/java/com/fs/statis/dto/StoreAuditDTO.java

@@ -0,0 +1,30 @@
+package com.fs.statis.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 批量修改商品
+ */
+@Data
+public class StoreAuditDTO implements Serializable {
+
+    /**
+     * 产品id
+     */
+    private List<Long> storeIds;
+    /**
+     * 审核状态
+     * */
+    private Integer isAudit;
+    /**
+     * 审核理由
+     * */
+    private String reason;
+    /**
+     * 附件图片
+     * */
+    private String attachImage;
+}

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

@@ -7,6 +7,7 @@ logging:
     org.springframework.web: debug
     com.github.binarywang.demo.wx.cp: DEBUG
     me.chanjar.weixin: DEBUG
+    com.fs: debug
 wx:
   miniapp:
     configs:

+ 107 - 1
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -49,10 +49,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isDisplay"    column="is_display"    />
         <result property="tuiCateId"    column="tui_cate_id"    />
         <result property="companyIds"    column="company_ids"    />
+        <result property="isDrug" column="is_drug"/>
+        <result property="drugImage" column="drug_image"/>
+        <result property="drugRegCertNo" column="drug_reg_certNo"/>
+        <result property="commonName" column="common_name"/>
+        <result property="dosageForm" column="dosage_form"/>
+        <result property="unitPrice" column="unit_price"/>
+        <result property="batchNumber" column="batch_number"/>
+        <result property="mah" column="mah"/>
+        <result property="mahAddress" column="mah_address"/>
+        <result property="manufacturer" column="manufacturer"/>
+        <result property="manufacturerAddress" column="manufacturer_address"/>
+        <result property="indications" column="indications"/>
+        <result property="dosage" column="dosage"/>
+        <result property="adverseReactions" column="adverse_reactions"/>
+        <result property="contraindications" column="contraindications"/>
+        <result property="precautions" column="precautions"/>
+        <result property="isAudit" column="is_audit"/>
     </resultMap>
 
     <sql id="selectFsStoreProductVo">
-        select product_id, image,video, slider_image, product_name, product_info, keyword, bar_code, cate_id, price, vip_price, ot_price, postage, unit_name, sort, sales, stock, is_show, is_hot, is_benefit, is_best, is_new, description, create_time, update_time, is_postage, is_del, give_integral, cost, is_good, browse, code_path, temp_id, spec_type, is_integral, integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name,is_display,tui_cate_id,company_ids from fs_store_product_scrm
+        select product_id, image,video, slider_image, product_name, product_info, keyword, bar_code,
+               cate_id, price, vip_price, ot_price, postage, unit_name, sort, sales, stock, is_show,
+               is_hot, is_benefit, is_best, is_new, description, create_time, update_time, is_postage,
+               is_del, give_integral, cost, is_good, browse, code_path, temp_id, spec_type, is_integral,
+               integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name,
+               is_display,tui_cate_id,company_ids,is_drug,drug_image,drug_reg_certNo,common_name,dosage_form,
+               unit_price,batch_number,mah,mah_address,manufacturer,manufacturer_address,indications,dosage,
+               adverse_reactions,contraindications,precautions,is_audit
+               from fs_store_product_scrm
     </sql>
 
     <select id="selectFsStoreProductByProductId" parameterType="Long" resultMap="FsStoreProductResult">
@@ -102,6 +127,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="prescribeFactory != null  and prescribeFactory != ''"> and prescribe_factory = #{prescribeFactory}</if>
             <if test="prescribeName != null  and prescribeName != ''"> and prescribe_name like concat('%', #{prescribeName}, '%')</if>
             <if test="isDisplay != null "> and is_display = #{isDisplay}</if>
+            <if test="isDrug != null and isDrug != ''">and is_drug = #{isDrug} ,</if>
+            <if test="drugImage != null and drugImage != ''">and drug_image = #{drugImage} ,</if>
+            <if test="drugRegCertNo != null and drugRegCertNo != ''">and drug_reg_certNo = #{drugRegCertNo} ,</if>
+            <if test="commonName != null and commonName != ''">and common_name = #{commonName} ,</if>
+            <if test="dosageForm != null and dosageForm != ''">and dosage_form = #{dosageForm} ,</if>
+            <if test="unitPrice != null and unitPrice != ''">and unit_price = #{unitPrice} ,</if>
+            <if test="batchNumber != null and batchNumber != ''">and batch_number = #{batchNumber} ,</if>
+            <if test="mah != null and mah != ''">and mah = #{mah} ,</if>
+            <if test="mahAddress != null and mahAddress != ''">and mah_address = #{mahAddress} ,</if>
+            <if test="manufacturer != null and manufacturer != ''">and manufacturer = #{manufacturer} ,</if>
+            <if test="manufacturerAddress != null and manufacturerAddress != ''">and manufacturer_address= #{manufacturerAddress} ,</if>
+            <if test="indications != null and indications != ''">and indications = #{indications} ,</if>
+            <if test="dosage != null and dosage != ''">and dosage = #{dosage} ,</if>
+            <if test="adverseReactions != null and adverseReactions != ''">and adverse_reactions = #{adverseReactions} ,</if>
+            <if test="contraindications != null and contraindications != ''">and contraindications = #{contraindications} ,</if>
+            <if test="precautions != null and precautions != ''">and precautions = #{precautions} ,</if>
+            <if test="isAudit != null and isAudit != ''">and is_audit = #{isAudit} ,</if>
 
         </where>
     </select>
@@ -168,6 +210,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDisplay != null">is_display,</if>
             <if test="tuiCateId != null">tui_cate_id,</if>
             <if test="companyIds != null and companyIds != ''">company_ids,</if>
+            <if test="isDrug!= null and isDrug != ''">is_drug,</if>
+            <if test="drugImage != null and drugImage != ''">drug_image ,</if>
+            <if test="drugRegCertNo != null and drugRegCertNo != ''">drug_reg_certNo ,</if>
+            <if test="commonName != null and commonName != ''">common_name ,</if>
+            <if test="dosageForm != null and dosageForm != ''">dosage_form ,</if>
+            <if test="unitPrice != null and unitPrice != ''">unit_price ,</if>
+            <if test="batchNumber != null and batchNumber != ''">batch_number ,</if>
+            <if test="mah != null and mah != ''">mah ,</if>
+            <if test="mahAddress != null and mahAddress != ''">mah_address ,</if>
+            <if test="manufacturer != null and manufacturer != ''">manufacturer ,</if>
+            <if test="manufacturerAddress != null and manufacturerAddress != ''">manufacturer_address,</if>
+            <if test="indications != null and indications != ''">indications ,</if>
+            <if test="dosage != null and dosage != ''">dosage ,</if>
+            <if test="adverseReactions != null and adverseReactions != ''">adverse_reactions ,</if>
+            <if test="contraindications != null and contraindications != ''">contraindications ,</if>
+            <if test="precautions != null and precautions != ''">precautions ,</if>
+            <if test="isAudit != null and isAudit != ''">is_audit ,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="image != null and image != ''">#{image},</if>
@@ -213,6 +272,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDisplay != null">#{isDisplay},</if>
             <if test="tuiCateId != null">#{tuiCateId},</if>
             <if test="companyIds != null and companyIds != ''">#{companyIds},</if>
+            <if test="isDrug!= null and isDrug!= ''">#{isDrug} ,</if>
+            <if test="drugImage != null and drugImage != ''">#{drugImage} ,</if>
+            <if test="drugRegCertNo != null and drugRegCertNo != ''">#{drugRegCertNo} ,</if>
+            <if test="commonName != null and commonName != ''">#{commonName} ,</if>
+            <if test="dosageForm != null and dosageForm != ''">#{dosageForm} ,</if>
+            <if test="unitPrice != null and unitPrice != ''">#{unitPrice} ,</if>
+            <if test="batchNumber != null and batchNumber != ''">#{batchNumber} ,</if>
+            <if test="mah != null and mah != ''">#{mah} ,</if>
+            <if test="mahAddress != null and mahAddress != ''">#{mahAddress} ,</if>
+            <if test="manufacturer != null and manufacturer != ''">#{manufacturer} ,</if>
+            <if test="manufacturerAddress != null and manufacturerAddress != ''">#{manufacturerAddress} ,</if>
+            <if test="indications != null and indications != ''">#{indications} ,</if>
+            <if test="dosage != null and dosage != ''">#{dosage} ,</if>
+            <if test="adverseReactions != null and adverseReactions != ''">#{adverseReactions} ,</if>
+            <if test="contraindications != null and contraindications != ''">#{contraindications} ,</if>
+            <if test="precautions != null and precautions != ''">#{precautions} ,</if>
+            <if test="isAudit != null and isAudit != ''">#{isAudit} ,</if>
          </trim>
     </insert>
 
@@ -262,6 +338,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDisplay != null">is_display = #{isDisplay},</if>
             <if test="tuiCateId != null">tui_cate_id = #{tuiCateId},</if>
             <if test="companyIds != null and companyIds != ''">company_ids = #{companyIds},</if>
+            <if test="isDrug != null and isDrug != ''">is_drug = #{isDrug} ,</if>
+            <if test="drugImage != null and drugImage != ''">drug_image = #{drugImage} ,</if>
+            <if test="drugRegCertNo != null and drugRegCertNo != ''">drug_reg_certNo = #{drugRegCertNo} ,</if>
+            <if test="commonName != null and commonName != ''">common_name = #{commonName} ,</if>
+            <if test="dosageForm != null and dosageForm != ''">dosage_form = #{dosageForm} ,</if>
+            <if test="unitPrice != null and unitPrice != ''">unit_price = #{unitPrice} ,</if>
+            <if test="batchNumber != null and batchNumber != ''">batch_number = #{batchNumber} ,</if>
+            <if test="mah != null and mah != ''">mah = #{mah} ,</if>
+            <if test="mahAddress != null and mahAddress != ''">mah_address = #{mahAddress} ,</if>
+            <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer} ,</if>
+            <if test="manufacturerAddress != null and manufacturerAddress != ''">manufacturer_address= #{manufacturerAddress} ,</if>
+            <if test="indications != null and indications != ''">indications = #{indications} ,</if>
+            <if test="dosage != null and dosage != ''">dosage = #{dosage} ,</if>
+            <if test="adverseReactions != null and adverseReactions != ''">adverse_reactions = #{adverseReactions} ,</if>
+            <if test="contraindications != null and contraindications != ''">contraindications = #{contraindications} ,</if>
+            <if test="precautions != null and precautions != ''">precautions = #{precautions} ,</if>
+            <if test="isAudit != null and isAudit != ''">is_audit = #{isAudit} ,</if>
+
         </trim>
         where product_id = #{productId}
     </update>
@@ -277,10 +371,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     <if test="companyIds != null and companyIds != ''">
                         company_ids = #{companyIds}
                     </if>
+                    <if test="isAudit != null and isAudit != ''">
+                        is_audit = #{isAudit}
+                    </if>
             where product_id = #{item}
         </foreach>
     </update>
 
+    <update id="batchAudit" parameterType="com.fs.statis.dto.ProductAuditDTO">
+        UPDATE fs_store_product_scrm
+        SET is_audit = #{isAudit}
+        WHERE product_id IN
+        <foreach item="productId" collection="productIds" open="(" separator="," close=")">
+            #{productId}
+        </foreach>
+    </update>
+
     <delete id="deleteFsStoreProductById" parameterType="Long">
         delete from fs_store_product_scrm where product_id = #{productId}
     </delete>

+ 110 - 1
fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml

@@ -34,10 +34,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="refundConsignee"    column="refund_consignee"    />
         <result property="deliveryType"    column="delivery_type"    />
         <result property="sendPhone"    column="send_phone"    />
+        <result property="enterpriseAddress"	column="enterprise_address" />
+        <result property="legalPersonName"	column="legal_person_name" />
+        <result property="unifiedSocialCreditCode"	column="unified_social_credit_code" />
+        <result property="businessScope"	column="business_scope" />
+        <result property="businessLicense"	column="business_license" />
+        <result property="businessLicenseExpireStart"	column="business_license_expire_start" />
+        <result property="businessLicenseExpireEnd"	column="business_license_expire_end" />
+        <result property="drugLicense"	column="drug_license" />
+        <result property="drugLicenseExpiryStart"	column="drug_license_expiry_start" />
+        <result property="drugLicenseExpiryEnd"	column="drug_license_expiry_end" />
+        <result property="medicalDevice1"	column="medical_device1" />
+        <result property="medicalDevice1ExpiryStart"	column="medical_device1_expiry_start" />
+        <result property="medicalDevice1ExpiryEnd"	column="medical_device1_expiry_end" />
+        <result property="medicalDevice2"	column="medicalDevice2" />
+        <result property="medicalDevice2ExpiryStart"	column="medical_device2_expiry_start" />
+        <result property="medicalDevice2ExpiryEnd"	column="medical_device2_expiry_end" />
+        <result property="medicalDevice3"	column="medicalDevice3" />
+        <result property="medicalDevice3ExpiryStart"	column="medical_device3_expiry_start" />
+        <result property="medicalDevice3ExpiryEnd"	column="medical_device3_expiry_end" />
+        <result property="foodLicense"	column="food_license" />
+        <result property="foodLicenseExpiryStart"	column="food_license_expiry_start" />
+        <result property="foodLicenseExpiryEnd"	column="food_license_expiry_end" />
+        <result property="medicalLicense"	column="medical_license" />
+        <result property="medicalLicenseExpiryStart"	column="medical_license_expiry_start" />
+        <result property="medicalLicenseExpiryEnd"	column="medical_license_expiry_end" />
     </resultMap>
 
     <sql id="selectFsStoreVo">
-        select store_id,full_name,delivery_type,send_phone, brokerage_rate,refund_phone,refund_address,refund_consignee,city_ids, store_name, descs, brokerage_type,logo_url, address, lng, lat, phone, license_images, product_count, status, create_time, update_time, sales_count, balance, total_money, is_audit, account, password, shipping_type from fs_store_scrm
+        select store_id,full_name,delivery_type,send_phone, brokerage_rate,refund_phone,refund_address,refund_consignee,
+               city_ids, store_name, descs, brokerage_type,logo_url, address, lng, lat, phone, license_images, product_count,
+               status, create_time, update_time, sales_count, balance, total_money, is_audit, account, password, shipping_type,
+               enterprise_address,legal_person_name,unified_social_credit_code,
+               business_scope,business_license,business_license_expire_start,business_license_expire_end,drug_license,
+               drug_license_expiry_start,drug_license_expiry_end,medical_device1,medical_device1_expiry_start,medical_device1_expiry_end,
+               medicalDevice2,medical_device2_expiry_start,medical_device2_expiry_end,medicalDevice3,medical_device3_expiry_start,
+               medical_device3_expiry_end,food_license,food_license_expiry_start,food_license_expiry_end,medical_license,
+               medical_license_expiry_start,medical_license_expiry_end
+        from fs_store_scrm
     </sql>
 
     <select id="selectFsStoreList" parameterType="FsStoreScrm" resultMap="FsStoreResult">
@@ -89,6 +123,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="refundConsignee != null">refund_consignee,</if>
             <if test="deliveryType != null">delivery_type,</if>
             <if test="sendPhone != null">send_phone,</if>
+            <if test="enterpriseAddress !=null">enterprise_address , </if>
+            <if test="legalPersonName !=null">legal_person_name , </if>
+            <if test="unifiedSocialCreditCode !=null">unified_social_credit_code , </if>
+            <if test="businessScope !=null">business_scope , </if>
+            <if test="businessLicense !=null">business_license , </if>
+            <if test="businessLicenseExpireStart !=null ">business_license_expire_start, </if>
+            <if test="businessLicenseExpireEnd !=null ">business_license_expire_end , </if>
+            <if test="drugLicense !=null">drug_license , </if>
+            <if test="drugLicenseExpiryStart !=null ">drug_license_expiry_start , </if>
+            <if test="drugLicenseExpiryEnd !=null ">drug_license_expiry_end , </if>
+            <if test="medicalDevice1 !=null">medical_device1 , </if>
+            <if test="medicalDevice1ExpiryStart !=null ">medical_device1_expiry_start , </if>
+            <if test="medicalDevice1ExpiryEnd !=null ">medical_device1_expiry_end , </if>
+            <if test="medicalDevice2 !=null">medicalDevice2 , </if>
+            <if test="medicalDevice2ExpiryStart !=null ">medical_device2_expiry_start , </if>
+            <if test="medicalDevice2ExpiryEnd !=null ">medical_device2_expiry_end , </if>
+            <if test="medicalDevice3 !=null">medicalDevice3 , </if>
+            <if test="medicalDevice3ExpiryStart !=null ">medical_device3_expiry_start , </if>
+            <if test="medicalDevice3ExpiryEnd !=null ">medical_device3_expiry_end , </if>
+            <if test="foodLicense !=null">food_license , </if>
+            <if test="foodLicenseExpiryStart !=null ">food_license_expiry_start , </if>
+            <if test="foodLicenseExpiryEnd !=null ">food_license_expiry_end , </if>
+            <if test="medicalLicense !=null">medical_license , </if>
+            <if test="medicalLicenseExpiryStart !=null ">medical_license_expiry_start , </if>
+            <if test="medicalLicenseExpiryEnd !=null ">medical_license_expiry_end , </if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="cityIds != null">#{cityIds},</if>
@@ -119,6 +178,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="refundConsignee != null">#{refundConsignee},</if>
             <if test="deliveryType != null">#{deliveryType},</if>
             <if test="sendPhone != null">#{sendPhone},</if>
+            <if test="enterpriseAddress !=null">#{enterpriseAddress}, </if>
+            <if test="legalPersonName !=null">#{legalPersonName}, </if>
+            <if test="unifiedSocialCreditCode !=null">#{unifiedSocialCreditCode}, </if>
+            <if test="businessScope !=null">#{businessScope}, </if>
+            <if test="businessLicense !=null">#{businessLicense}, </if>
+            <if test="businessLicenseExpireStart !=null ">#{businessLicenseExpireStart}, </if>
+            <if test="businessLicenseExpireEnd !=null ">#{businessLicenseExpireEnd}, </if>
+            <if test="drugLicense !=null">#{drugLicense}, </if>
+            <if test="drugLicenseExpiryStart !=null ">#{drugLicenseExpiryStart}, </if>
+            <if test="drugLicenseExpiryEnd !=null ">#{drugLicenseExpiryEnd}, </if>
+            <if test="medicalDevice1 !=null">#{medicalDevice1}, </if>
+            <if test="medicalDevice1ExpiryStart !=null ">#{medicalDevice1ExpiryStart}, </if>
+            <if test="medicalDevice1ExpiryEnd !=null ">#{medicalDevice1ExpiryEnd}, </if>
+            <if test="medicalDevice2 !=null">#{medicalDevice2}, </if>
+            <if test="medicalDevice2ExpiryStart !=null ">#{medicalDevice2ExpiryStart}, </if>
+            <if test="medicalDevice2ExpiryEnd !=null ">#{medicalDevice2ExpiryEnd}, </if>
+            <if test="medicalDevice3 !=null">#{medicalDevice3}, </if>
+            <if test="medicalDevice3ExpiryStart !=null ">#{medicalDevice3ExpiryStart}, </if>
+            <if test="medicalDevice3ExpiryEnd !=null ">#{medicalDevice3ExpiryEnd}, </if>
+            <if test="foodLicense !=null">#{foodLicense}, </if>
+            <if test="foodLicenseExpiryStart !=null ">#{foodLicenseExpiryStart}, </if>
+            <if test="foodLicenseExpiryEnd !=null ">#{foodLicenseExpiryEnd}, </if>
+            <if test="medicalLicense !=null">#{medicalLicense}, </if>
+            <if test="medicalLicenseExpiryStart !=null ">#{medicalLicenseExpiryStart}, </if>
+            <if test="medicalLicenseExpiryEnd !=null ">#{medicalLicenseExpiryEnd}, </if>
         </trim>
     </insert>
 
@@ -153,6 +237,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="refundConsignee != null">refund_consignee = #{refundConsignee},</if>
             <if test="deliveryType != null">delivery_type = #{deliveryType},</if>
             <if test="sendPhone != null">send_phone = #{sendPhone},</if>
+            <if test="enterpriseAddress !=null and enterpriseAddress !=''"> enterprise_address = #{enterpriseAddress} ,</if>
+            <if test="legalPersonName !=null and legalPersonName !=''"> legal_person_name = #{legalPersonName} ,</if>
+            <if test="unifiedSocialCreditCode !=null and unifiedSocialCreditCode !=''"> unified_social_credit_code = #{unifiedSocialCreditCode} ,</if>
+            <if test="businessScope !=null and businessScope !=''"> business_scope = #{businessScope} ,</if>
+            <if test="businessLicense !=null and businessLicense !=''"> business_license = #{businessLicense} ,</if>
+            <if test="businessLicenseExpireStart !=null "> business_license_expire_start = #{businessLicenseExpireStart} ,</if>
+            <if test="businessLicenseExpireEnd !=null "> business_license_expire_end = #{businessLicenseExpireEnd} ,</if>
+            <if test="drugLicense !=null and drugLicense !=''"> drug_license = #{drugLicense} ,</if>
+            <if test="drugLicenseExpiryStart !=null "> drug_license_expiry_start = #{drugLicenseExpiryStart} ,</if>
+            <if test="drugLicenseExpiryEnd !=null "> drug_license_expiry_end = #{drugLicenseExpiryEnd} ,</if>
+            <if test="medicalDevice1 !=null and medicalDevice1 !=''"> medical_device1 = #{medicalDevice1} ,</if>
+            <if test="medicalDevice1ExpiryStart !=null "> medical_device1_expiry_start = #{medicalDevice1ExpiryStart} ,</if>
+            <if test="medicalDevice1ExpiryEnd !=null "> medical_device1_expiry_end = #{medicalDevice1ExpiryEnd} ,</if>
+            <if test="medicalDevice2 !=null and medicalDevice2 !=''"> medicalDevice2 = #{medicalDevice2} ,</if>
+            <if test="medicalDevice2ExpiryStart !=null "> medical_device2_expiry_start = #{medicalDevice2ExpiryStart} ,</if>
+            <if test="medicalDevice2ExpiryEnd !=null "> medical_device2_expiry_end = #{medicalDevice2ExpiryEnd} ,</if>
+            <if test="medicalDevice3 !=null and medicalDevice3 !=''"> medicalDevice3 = #{medicalDevice3} ,</if>
+            <if test="medicalDevice3ExpiryStart !=null "> medical_device3_expiry_start = #{medicalDevice3ExpiryStart} ,</if>
+            <if test="medicalDevice3ExpiryEnd !=null "> medical_device3_expiry_end = #{medicalDevice3ExpiryEnd} ,</if>
+            <if test="foodLicense !=null and foodLicense !=''"> food_license = #{foodLicense} ,</if>
+            <if test="foodLicenseExpiryStart !=null "> food_license_expiry_start = #{foodLicenseExpiryStart} ,</if>
+            <if test="foodLicenseExpiryEnd !=null "> food_license_expiry_end = #{foodLicenseExpiryEnd} ,</if>
+            <if test="medicalLicense !=null and medicalLicense !=''"> medical_license = #{medicalLicense} ,</if>
+            <if test="medicalLicenseExpiryStart !=null "> medical_license_expiry_start = #{medicalLicenseExpiryStart} ,</if>
+            <if test="medicalLicenseExpiryEnd !=null "> medical_license_expiry_end = #{medicalLicenseExpiryEnd} ,</if>
         </trim>
         where store_id = #{storeId}
     </update>

+ 110 - 3
fs-service/src/main/resources/mapper/hisStore/SysOperLogScrmMapper.xml

@@ -23,10 +23,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="operTime"       column="oper_time"      />
 		<result property="mainType"       column="main_type"       />
 		<result property="des"         column="des"    />
+		<result property="reason"         column="reason"    />
+		<result property="attachImage"     column="attach_image"    />
+		<result property="mainId"         column="main_id"    />
+		<result property="mainName"         column="main_name"    />
 	</resultMap>
 
 	<sql id="selectOperLogVo">
-        select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, main_type, des
+        select oper_id, title, business_type, method, request_method, operator_type, oper_name,
+               dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg,
+               oper_time, main_type, des, reason, attach_image, main_id
         from sys_oper_log_scrm
     </sql>
 
@@ -36,10 +42,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</insert>
 
 	<select id="selectOperLogList" parameterType="SysOperLogScrm" resultMap="SysOperLogResult">
-		<include refid="selectOperLogVo"/>
+			select sol.oper_id, sol.title, sol.business_type, sol.method, sol.request_method,
+			sol.operator_type, sol.oper_name, sol.dept_name, sol.oper_url, sol.oper_ip,
+			sol.oper_location, sol.oper_param, sol.json_result, sol.status, sol.error_msg,
+			sol.oper_time, sol.main_type, sol.des, sol.reason, sol.attach_image, sol.main_id,
+			CASE
+			WHEN sol.main_type = '店铺' THEN fs.store_name
+			WHEN sol.main_type = '商品' THEN fp.product_name
+			ELSE NULL
+			END as main_name
+			from sys_oper_log_scrm sol
+			left join fs_store_scrm fs on fs.store_id = sol.main_id and sol.main_type = '店铺'
+			left join fs_store_product_scrm fp on fp.product_id = sol.main_id and sol.main_type = '商品'
 		<where>
 			<if test="mainType != null and mainType != ''">
-				AND main_type = #{main_type},
+				AND main_type = #{mainType}
 			</if>
 			<if test="title != null and title != ''">
 				AND title like concat('%', #{title}, '%')
@@ -65,6 +82,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
 				and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
 			</if>
+			<if test="mainId != null">
+				and main_id = #{mainId}
+			</if>
 		</where>
 		order by oper_id desc
 	</select>
@@ -75,5 +95,92 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		where oper_id = #{operId}
 	</select>
 
+	<!--insertBatchByIds-->
+	<insert id="insertBatchByIds" useGeneratedKeys="true" keyProperty="operId">
+		INSERT INTO sys_oper_log_scrm (main_id, reason, attach_image)
+		VALUES
+		<foreach collection="entity" item="item" separator=",">
+			(#{item.mainId}, #{item.reason}, #{item.attachImage})
+		</foreach>
+	</insert>
+
+	<!-- 根据mainId获取操作日志 -->
+	<select id="selectOperLogByMainId" resultMap="SysOperLogResult">
+		<include refid="selectOperLogVo"/>
+		where main_id = #{mainId} and status = 0
+	</select>
+
+	<!--updateByIncloudIdStr-->
+	<update id="updateByIncloudIdStr" parameterType="SysOperLogScrm">
+		update sys_oper_log_scrm
+		<set>
+			<if test="status != null">
+				status = #{status},
+			</if>
+			<if test="operIp != null">
+				oper_ip = #{operIp},
+			</if>
+			<if test="jsonResult != null">
+				json_result = #{jsonResult},
+			</if>
+			<if test="operUrl != null">
+				oper_url = #{operUrl},
+			</if>
+			<if test="operName != null">
+				oper_name = #{operName},
+			</if>
+			<if test="errorMsg != null">
+				error_msg = #{errorMsg},
+			</if>
+			<if test="method != null">
+				method = #{method},
+			</if>
+			<if test="requestMethod != null">
+				request_method = #{requestMethod},
+			</if>
+			<if test="businessType != null">
+				business_type = #{businessType},
+			</if>
+			<if test="title != null">
+				title = #{title},
+			</if>
+			<if test="operatorType != null">
+				operator_type = #{operatorType},
+			</if>
+			<if test="operLocation != null">
+				oper_location = #{operLocation},
+			</if>
+			<if test="operParam != null">
+				oper_param = #{operParam},
+			</if>
+			<if test="mainType != null">
+				main_type = #{mainType},
+			</if>
+			<if test="des != null">
+				des = #{des},
+			</if>
+			<if test="mainId != null">
+				main_id = #{mainId},
+			</if>
+			<if test="reason != null">
+				reason = #{reason},
+			</if>
+			<if test="attachImage != null">
+				attach_image = #{attachImage},
+			</if>
+			oper_time = sysdate()
+		</set>
+		where oper_id in
+		    <foreach item="id" collection="operIds" open="(" separator="," close=")">
+				#{id}
+			</foreach>
+	</update>
+
+	<delete id="deleteOperLogByIds" parameterType="Long">
+		delete from sys_oper_log_scrm where oper_id in
+		<foreach collection="array" item="operId" open="(" separator="," close=")">
+			#{operId}
+		</foreach>
+	</delete>
 
 </mapper>