Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

zyp 5 napja
szülő
commit
19a2b9c16a
60 módosított fájl, 2168 hozzáadás és 100 törlés
  1. 38 0
      fs-admin/src/main/java/com/fs/course/controller/FsVideoResourceController.java
  2. 114 0
      fs-admin/src/main/java/com/fs/his/controller/FsPhysicalReportTemplateController.java
  3. 140 0
      fs-admin/src/main/java/com/fs/his/controller/FsPhysicalReportTemplateFieldController.java
  4. 76 11
      fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java
  5. 7 1
      fs-admin/src/main/java/com/fs/his/task/Task.java
  6. 67 0
      fs-company-app/src/main/java/com/fs/app/controller/FsUserCoursePeriodController.java
  7. 46 0
      fs-company-app/src/main/java/com/fs/app/controller/qw/QwFsCourseWatchLogController.java
  8. 4 5
      fs-company/src/main/java/com/fs/company/controller/qw/SopUserLogsInfoController.java
  9. 7 0
      fs-company/src/main/java/com/fs/company/controller/store/FsStoreOrderController.java
  10. 1 1
      fs-service/src/main/java/com/fs/course/service/IFsUserCoursePeriodDaysService.java
  11. 16 1
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCoursePeriodDaysServiceImpl.java
  12. 3 0
      fs-service/src/main/java/com/fs/erp/domain/ErpGoods.java
  13. 10 0
      fs-service/src/main/java/com/fs/erp/dto/OrderItemDTO.java
  14. 2 1
      fs-service/src/main/java/com/fs/erp/http/JstErpHttpService.java
  15. 14 1
      fs-service/src/main/java/com/fs/erp/http/JstErpHttpServiceImpl.java
  16. 36 7
      fs-service/src/main/java/com/fs/erp/service/impl/DfOrderServiceImpl.java
  17. 75 1
      fs-service/src/main/java/com/fs/erp/service/impl/JSTErpGoodsServiceImpl.java
  18. 3 0
      fs-service/src/main/java/com/fs/erp/service/impl/JSTErpOrderServiceImpl.java
  19. 22 2
      fs-service/src/main/java/com/fs/erp/service/impl/JstTokenService.java
  20. 32 0
      fs-service/src/main/java/com/fs/his/domain/FsPhysicalReportTemplate.java
  21. 72 0
      fs-service/src/main/java/com/fs/his/domain/FsPhysicalReportTemplateField.java
  22. 3 0
      fs-service/src/main/java/com/fs/his/domain/FsStoreOrderDf.java
  23. 4 0
      fs-service/src/main/java/com/fs/his/domain/FsStoreProduct.java
  24. 19 0
      fs-service/src/main/java/com/fs/his/dto/FsPhysicalReportTemplateFieldDTO.java
  25. 6 0
      fs-service/src/main/java/com/fs/his/mapper/FsInquiryOrderReportMapper.java
  26. 75 0
      fs-service/src/main/java/com/fs/his/mapper/FsPhysicalReportTemplateFieldMapper.java
  27. 61 0
      fs-service/src/main/java/com/fs/his/mapper/FsPhysicalReportTemplateMapper.java
  28. 3 1
      fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java
  29. 7 1
      fs-service/src/main/java/com/fs/his/mapper/FsStoreProductAttrValueMapper.java
  30. 6 0
      fs-service/src/main/java/com/fs/his/mapper/FsStoreProductMapper.java
  31. 5 0
      fs-service/src/main/java/com/fs/his/param/FsInquiryOrderCreateParam.java
  32. 18 3
      fs-service/src/main/java/com/fs/his/param/FsStoreOrderParam.java
  33. 4 0
      fs-service/src/main/java/com/fs/his/param/FsStoreProductAddEditParam.java
  34. 80 0
      fs-service/src/main/java/com/fs/his/service/IFsPhysicalReportTemplateFieldService.java
  35. 61 0
      fs-service/src/main/java/com/fs/his/service/IFsPhysicalReportTemplateService.java
  36. 2 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java
  37. 7 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreProductAttrValueService.java
  38. 7 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreProductService.java
  39. 1 1
      fs-service/src/main/java/com/fs/his/service/impl/FsInquiryOrderServiceImpl.java
  40. 153 0
      fs-service/src/main/java/com/fs/his/service/impl/FsPhysicalReportTemplateFieldServiceImpl.java
  41. 125 0
      fs-service/src/main/java/com/fs/his/service/impl/FsPhysicalReportTemplateServiceImpl.java
  42. 93 39
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
  43. 5 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductAttrValueServiceImpl.java
  44. 50 6
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductServiceImpl.java
  45. 3 0
      fs-service/src/main/java/com/fs/his/vo/FsStoreOrderListVO.java
  46. 8 0
      fs-service/src/main/java/com/fs/sop/domain/SopUserLogsInfo.java
  47. 1 1
      fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsMapper.java
  48. 3 1
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempServiceImpl.java
  49. 9 4
      fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java
  50. 2 0
      fs-service/src/main/java/com/fs/sop/vo/ExtCourseSopWatchLogVO.java
  51. 3 3
      fs-service/src/main/resources/application-config-druid-xzt.yml
  52. 3 0
      fs-service/src/main/resources/application-druid-jnmy-test.yml
  53. 3 0
      fs-service/src/main/resources/application-druid-jnmy.yml
  54. 175 0
      fs-service/src/main/resources/mapper/his/FsPhysicalReportTemplateFieldMapper.xml
  55. 81 0
      fs-service/src/main/resources/mapper/his/FsPhysicalReportTemplateMapper.xml
  56. 6 1
      fs-service/src/main/resources/mapper/his/FsStoreOrderDfMapper.xml
  57. 268 7
      fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml
  58. 4 0
      fs-service/src/main/resources/mapper/his/FsStoreProductAttrValueMapper.xml
  59. 10 1
      fs-service/src/main/resources/mapper/his/FsStoreProductMapper.xml
  60. 9 0
      fs-store/src/main/java/com/fs/store/controller/store/FsStoreOrderController.java

+ 38 - 0
fs-admin/src/main/java/com/fs/course/controller/FsVideoResourceController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.time.LocalDateTime;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 资源库管理
@@ -102,6 +103,43 @@ public class FsVideoResourceController extends BaseController {
         return AjaxResult.success();
     }
 
+    /**
+     * 批量修改视频分类
+     * @param typeId
+     * @param typeSubId
+     * @param ids
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('course:videoResource:batchUpdateClass')")
+    @Log(title = "视频素材库", businessType = BusinessType.UPDATE)
+    @PostMapping("/batchUpdateClass")
+    public AjaxResult batchUpdateClass(@RequestParam("typeId") Long typeId,
+                                       @RequestParam("typeSubId") Long typeSubId,
+                                       @RequestParam("ids") String ids) {
+        if(typeId == null || typeId <= 0){
+            return AjaxResult.error("请选择分类");
+        }
+        if(typeSubId == null || typeSubId <= 0){
+            return AjaxResult.error("请选择子分类");
+        }
+        if(ids == null || ids.isEmpty()){
+            return AjaxResult.error("请选择要修改的分类");
+        }
+
+        // 将ids字符串分割为ID列表
+        List<String> idList = Arrays.asList(ids.split(","));
+
+        // 创建更新条件
+        Wrapper<FsVideoResource> updateWrapper = Wrappers.<FsVideoResource>lambdaUpdate()
+                .set(FsVideoResource::getTypeId, typeId)
+                .set(FsVideoResource::getTypeSubId, typeSubId)
+                .in(FsVideoResource::getId, idList.stream().map(Long::valueOf).collect(Collectors.toList()));
+
+        // 执行批量更新
+        fsVideoResourceService.update(updateWrapper);
+        return AjaxResult.success();
+    }
+
     @PreAuthorize("@ss.hasPermi('course:videoResource:batchAdd')")
     @Log(title = "视频素材库", businessType = BusinessType.INSERT)
     @PostMapping("/batchAddVideoResource")

+ 114 - 0
fs-admin/src/main/java/com/fs/his/controller/FsPhysicalReportTemplateController.java

@@ -0,0 +1,114 @@
+package com.fs.his.controller;
+
+import java.util.List;
+
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.utils.ServletUtils;
+import com.fs.framework.web.service.TokenService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.his.domain.FsPhysicalReportTemplate;
+import com.fs.his.service.IFsPhysicalReportTemplateService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 体检报告模板Controller
+ * 
+ * @author fs
+ * @date 2025-07-23
+ */
+@RestController
+@RequestMapping("/his/physicalReportTemplate")
+public class FsPhysicalReportTemplateController extends BaseController
+{
+    @Autowired
+    private IFsPhysicalReportTemplateService fsPhysicalReportTemplateService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询体检报告模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        startPage();
+        List<FsPhysicalReportTemplate> list = fsPhysicalReportTemplateService.selectFsPhysicalReportTemplateList(fsPhysicalReportTemplate);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出体检报告模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:export')")
+    @Log(title = "体检报告模板", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        List<FsPhysicalReportTemplate> list = fsPhysicalReportTemplateService.selectFsPhysicalReportTemplateList(fsPhysicalReportTemplate);
+        ExcelUtil<FsPhysicalReportTemplate> util = new ExcelUtil<FsPhysicalReportTemplate>(FsPhysicalReportTemplate.class);
+        return util.exportExcel(list, "体检报告模板数据");
+    }
+
+    /**
+     * 获取体检报告模板详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return AjaxResult.success(fsPhysicalReportTemplateService.selectFsPhysicalReportTemplateById(id));
+    }
+
+    /**
+     * 新增体检报告模板
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:add')")
+    @Log(title = "体检报告模板", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsPhysicalReportTemplate.setCreateBy(String.valueOf(loginUser.getUserId()));
+        return toAjax(fsPhysicalReportTemplateService.insertFsPhysicalReportTemplate(fsPhysicalReportTemplate));
+    }
+
+    /**
+     * 修改体检报告模板
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:edit')")
+    @Log(title = "体检报告模板", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsPhysicalReportTemplate.setUpdateBy(String.valueOf(loginUser.getUserId()));
+        return toAjax(fsPhysicalReportTemplateService.updateFsPhysicalReportTemplate(fsPhysicalReportTemplate));
+    }
+
+    /**
+     * 删除体检报告模板
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:remove')")
+    @Log(title = "体检报告模板", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(fsPhysicalReportTemplateService.deleteFsPhysicalReportTemplateByIds(ids));
+    }
+}

+ 140 - 0
fs-admin/src/main/java/com/fs/his/controller/FsPhysicalReportTemplateFieldController.java

@@ -0,0 +1,140 @@
+package com.fs.his.controller;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.api.R;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.framework.web.service.TokenService;
+import com.fs.his.dto.FsPhysicalReportTemplateFieldDTO;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.his.domain.FsPhysicalReportTemplateField;
+import com.fs.his.service.IFsPhysicalReportTemplateFieldService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 体检报告模板字段Controller
+ *
+ * @author fs
+ * @date 2025-07-24
+ */
+@RestController
+@RequestMapping("/his/physicalReportTemplateField")
+public class FsPhysicalReportTemplateFieldController extends BaseController {
+    @Autowired
+    private IFsPhysicalReportTemplateFieldService fsPhysicalReportTemplateFieldService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询体检报告模板字段列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        startPage();
+        List<FsPhysicalReportTemplateField> list = fsPhysicalReportTemplateFieldService.selectFsPhysicalReportTemplateFieldList(fsPhysicalReportTemplateField);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出体检报告模板字段列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:export')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        List<FsPhysicalReportTemplateField> list = fsPhysicalReportTemplateFieldService.selectFsPhysicalReportTemplateFieldList(fsPhysicalReportTemplateField);
+        ExcelUtil<FsPhysicalReportTemplateField> util = new ExcelUtil<FsPhysicalReportTemplateField>(FsPhysicalReportTemplateField.class);
+        return util.exportExcel(list, "体检报告模板字段数据");
+    }
+
+    /**
+     * 获取体检报告模板字段详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id) {
+        return AjaxResult.success(fsPhysicalReportTemplateFieldService.selectFsPhysicalReportTemplateFieldById(id));
+    }
+
+    /**
+     * 新增体检报告模板字段
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:add')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        return toAjax(fsPhysicalReportTemplateFieldService.insertFsPhysicalReportTemplateField(fsPhysicalReportTemplateField));
+    }
+
+    /**
+     * 修改体检报告模板字段
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:edit')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        return toAjax(fsPhysicalReportTemplateFieldService.updateFsPhysicalReportTemplateField(fsPhysicalReportTemplateField));
+    }
+
+    /**
+     * 删除体检报告模板字段
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:remove')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
+        return toAjax(fsPhysicalReportTemplateFieldService.deleteFsPhysicalReportTemplateFieldByIds(ids));
+    }
+
+    /**
+     * 获取模板自定义字段
+     *
+     * @param templateId 模板ID
+     * @return R
+     **/
+    @PostMapping("/getTemplateField/{templateId}")
+    public R getTemplateField(@PathVariable String templateId) {
+        if (StringUtils.isNull(templateId)) {
+            return R.failed("操作失败,模板ID不能为空!");
+        }
+        return fsPhysicalReportTemplateFieldService.getTemplateField(templateId);
+    }
+
+    /**
+     * 新增模板
+     *
+     * @param fieldDTO
+     * @return AjaxResult
+     **/
+    @Log(title = "体检报告模板字段", businessType = BusinessType.INSERT)
+    @PostMapping("/saveTemplate")
+    public AjaxResult saveTemplate(@RequestBody FsPhysicalReportTemplateFieldDTO fieldDTO) {
+        if (StringUtils.isNull(fieldDTO.getTemplateId())) {
+            throw new ServiceException("操作失败,模板ID不能为空!");
+        } else if (fieldDTO.getTemplateFieldList().isEmpty()) {
+            throw new ServiceException("操作失败,字段列表不能为空!");
+        }
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fieldDTO.setCreateBy(String.valueOf(loginUser.getUserId()));
+        return toAjax(fsPhysicalReportTemplateFieldService.saveFsPhysicalReportTemplateField(fieldDTO));
+    }
+}

+ 76 - 11
fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java

@@ -17,6 +17,7 @@ import com.fs.common.utils.StringUtils;
 import com.fs.company.param.CompanyStoreOrderMoneyLogsListParam;
 import com.fs.company.service.ICompanyMoneyLogsService;
 import com.fs.company.vo.CompanyStoreOrderMoneyLogsVO;
+import com.fs.config.cloud.CloudHostProper;
 import com.fs.erp.domain.ErpDeliverys;
 import com.fs.erp.domain.ErpOrderQuery;
 import com.fs.erp.dto.ErpDeliverysRequest;
@@ -42,6 +43,7 @@ import com.fs.his.utils.ConfigUtil;
 import com.fs.his.vo.*;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
+import com.github.pagehelper.PageHelper;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -100,23 +102,50 @@ public class FsStoreOrderController extends BaseController
     @Qualifier("dfOrderServiceImpl")
     private IErpOrderService dfOrderService;
 
+    @Autowired
+    @Qualifier("JSTErpOrderServiceImpl")
+    private IErpOrderService jSTOrderService;
+
     @Autowired
     SysConfigMapper sysConfigMapper;
 
     @Autowired
     private IFsStoreOrderDfService fsStoreOrderDfService;
+
+    @Autowired
+    private CloudHostProper cloudHostProper;
     /**
      * 查询订单列表
      */
-    @GetMapping("/list")
-    public TableDataInfo list(FsStoreOrderParam fsStoreOrder)
+    @PostMapping("/list")
+    public TableDataInfo list(@RequestBody FsStoreOrderParam fsStoreOrder)
     {
-        startPage();
-        if (fsStoreOrder.getUserPhoneMk()!=null&&fsStoreOrder.getUserPhoneMk()!=""){
+        PageHelper.startPage(fsStoreOrder);
+        if (fsStoreOrder.getUserPhoneMk()!=null&& !fsStoreOrder.getUserPhoneMk().isEmpty()){
             fsStoreOrder.setUserPhone(encryptPhone(fsStoreOrder.getUserPhoneMk()));
         }
-        List<FsStoreOrderListVO> list = fsStoreOrderService.selectFsStoreOrderListVO(fsStoreOrder);
-        return getDataTable(list);
+        List<FsStoreOrderListVO> list;
+        if (StringUtils.isNotBlank(fsStoreOrder.getErpAccount())){
+            //金牛erp查询
+            list = fsStoreOrderService.selectFsStoreOrderListVOByErpAccount(fsStoreOrder);
+        } else {
+            list = fsStoreOrderService.selectFsStoreOrderListVO(fsStoreOrder);
+        }
+        //金牛需求 区别其他项目 status = 6 (金牛代服管家) ,其他项目请避免使用订单状态status = 6
+        TableDataInfo dataTable = getDataTable(list);
+        if ("金牛明医".equals(cloudHostProper.getCompanyName())){
+            if (fsStoreOrder.getStatus() !=null && fsStoreOrder.getStatus() != 1){
+                list.forEach(vo->{
+                    //查询顺丰代服账号
+                    FsStoreOrderDf df = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(vo.getOrderId());
+                    if (df != null){
+                        vo.setErpAccount(df.getLoginAccount());
+                    }
+                });
+            }
+            dataTable.setMsg("jnmy");
+        }
+        return dataTable;
     }
 
     /**
@@ -388,6 +417,8 @@ public class FsStoreOrderController extends BaseController
                 } else if (erpType == 4){
                     //代服
                     erpOrderService =  dfOrderService;
+                }else if(erpType == 5){
+                    erpOrderService=jSTOrderService;
                 }
                 return erpOrderService;
 
@@ -527,13 +558,9 @@ public class FsStoreOrderController extends BaseController
             try {
                 df.setOrderId(orderId);
                 FsStoreOrderDf temp = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(df.getOrderId());
-                if (temp != null){
-                    df.setUpdateTime(new Date());
-                    fsStoreOrderDfService.updateFsStoreOrderDf(df);
-                } else {
+                if (temp == null){
                     fsStoreOrderDfService.insertFsStoreOrderDf(df);
                 }
-
                 fsStoreOrderService.createOmsOrder(orderId);
             } catch (ParseException e) {
                 throw new RuntimeException(e);
@@ -543,6 +570,44 @@ public class FsStoreOrderController extends BaseController
         return R.ok();
     }
 
+
+    @ApiOperation("批量设置订单账户")
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:createErpOrder')")
+    @PostMapping(value = "/batchSetErpOrder")
+    public R batchSetErpOrder(@RequestBody FsStoreOrderSetErpPhoneParam param)
+    {
+        String loginAccount = param.getLoginAccount();
+        if (StringUtils.isBlank(loginAccount)){
+            return R.error("未选择erp账户");
+        }
+        FsStoreOrderDf df = getDFInfo(loginAccount);
+        if (df.getLoginAccount() == null){
+            return R.error("未查询到所选erp账户");
+        }
+        List<Long> orderIds = param.getOrderIds();
+        if (orderIds  == null || orderIds.isEmpty()) {
+            if (param.getUserPhoneMk() != null && !param.getUserPhoneMk().isEmpty()) {
+                param.setUserPhone(encryptPhone(param.getUserPhoneMk()));
+            }
+            List<FsStoreOrderListVO> list = fsStoreOrderService.selectFsStoreOrderListVO(param);
+            orderIds = list.stream().map(FsStoreOrderListVO::getOrderId).collect(Collectors.toList());
+        }
+        if (orderIds.isEmpty()){
+            return R.ok();
+        }
+        orderIds.forEach(orderId->{
+            df.setOrderId(orderId);
+            FsStoreOrderDf temp = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(df.getOrderId());
+            if (temp != null){
+                df.setUpdateTime(new Date());
+                fsStoreOrderDfService.updateFsStoreOrderDf(df);
+            } else {
+                fsStoreOrderDfService.insertFsStoreOrderDf(df);
+            }
+        });
+        return R.ok();
+    }
+
     private FsStoreOrderDf getDFInfo(String loginAccount) {
         //查询订单账户 判断是否存在该订单账户
         List<DFConfigVo> erpAccounts = fsStoreOrderService.getErpAccount();

+ 7 - 1
fs-admin/src/main/java/com/fs/his/task/Task.java

@@ -266,7 +266,7 @@ public class Task {
         List<FsStoreOrder> orders = null;
         if (erpOrderService == gyOrderService){
             orders = fsStoreOrderMapper.selectOmsOrderdeliveryOp();
-        } else if (erpOrderService == wdtOrderService || erpOrderService == dfOrderService){
+        } else if (erpOrderService == wdtOrderService || erpOrderService == dfOrderService || erpOrderService == jSTOrderService){
             orders = fsStoreOrderMapper.selectWdtOmsOrderdeliveryOp();
         }
 
@@ -1030,6 +1030,10 @@ public class Task {
     @Qualifier("dfOrderServiceImpl")
     private IErpOrderService dfOrderService;
 
+    @Autowired
+    @Qualifier("JSTErpOrderServiceImpl")
+    private IErpOrderService jSTOrderService;
+
     private IErpOrderService getErpService() {
         FsSysConfig sysConfig = configUtil.getSysConfig();
         Integer erpOpen = sysConfig.getErpOpen();
@@ -1050,6 +1054,8 @@ public class Task {
                 } else if (erpType == 4){
                     //代服
                     erpOrderService =  dfOrderService;
+                }else if(erpType == 5){
+                    erpOrderService=jSTOrderService;
                 }
                 return erpOrderService;
 

+ 67 - 0
fs-company-app/src/main/java/com/fs/app/controller/FsUserCoursePeriodController.java

@@ -0,0 +1,67 @@
+package com.fs.app.controller;
+
+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.course.domain.FsUserCoursePeriod;
+import com.fs.course.domain.FsUserCoursePeriodDays;
+import com.fs.course.domain.FsUserCourseVideoRedPackage;
+import com.fs.course.param.CompanyRedPacketParam;
+import com.fs.course.param.FsBatchPeriodRedPackageParam;
+import com.fs.course.param.PeriodCountParam;
+import com.fs.course.param.PeriodStatisticCountParam;
+import com.fs.course.service.IFsUserCoursePeriodDaysService;
+import com.fs.course.service.IFsUserCoursePeriodService;
+import com.fs.course.service.IFsUserCourseVideoRedPackageService;
+import com.fs.course.vo.FsPeriodCountVO;
+import com.fs.course.vo.FsUserCoursePeriodVO;
+import com.fs.course.vo.PeriodRedPacketVO;
+import com.fs.course.vo.UpdateCourseTimeVo;
+import com.fs.his.vo.OptionsVO;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 会员营期Controller
+ *
+ * @author fs
+ * @date 2025-04-11
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/course/period")
+@Slf4j
+public class FsUserCoursePeriodController extends BaseController {
+
+    private final IFsUserCoursePeriodService fsUserCoursePeriodService;
+
+    @PostMapping("/periodCourseStatisticCount")
+    @ApiOperation("会员详情训练营数据总览")
+    public R periodCourseStatisticCount(@RequestBody PeriodStatisticCountParam param) {
+        if (param == null) {
+            return R.error("请求参数不能为空!");
+        }
+        return R.ok().put("data", fsUserCoursePeriodService.periodCourseStatisticCount(param));
+    }
+
+    @PostMapping("/periodlist")
+    public R periodList(@RequestBody PeriodStatisticCountParam param)
+    {
+        List<FsUserCoursePeriod> list = fsUserCoursePeriodService.selectFsPeriodlist(param);
+        return R.ok().put("data", list);
+    }
+}

+ 46 - 0
fs-company-app/src/main/java/com/fs/app/controller/qw/QwFsCourseWatchLogController.java

@@ -0,0 +1,46 @@
+package com.fs.app.controller.qw;
+
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.exception.CustomException;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.course.domain.FsCourseWatchLog;
+import com.fs.course.param.FsCourseWatchLogListParam;
+import com.fs.course.param.FsCourseWatchLogStatisticsListParam;
+import com.fs.course.param.PeriodStatisticCountParam;
+import com.fs.course.service.IFsCourseWatchLogService;
+import com.fs.course.vo.FsCourseWatchLogListVO;
+import com.fs.course.vo.FsCourseWatchLogStatisticsListVO;
+import com.fs.qw.param.QwWatchLogStatisticsListParam;
+import com.fs.qw.service.IQwWatchLogService;
+import com.fs.qw.vo.QwWatchLogAllStatisticsListVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 短链课程看课记录Controller
+ *
+ * @author fs
+ * @date 2024-10-24
+ */
+@RestController
+@RequestMapping("/qw/course/courseWatchLog")
+public class QwFsCourseWatchLogController extends BaseController {
+    @Autowired
+    private IFsCourseWatchLogService fsCourseWatchLogService;
+
+    //    @PreAuthorize("@ss.hasPermi('course:courseWatchLog:list')")
+    @GetMapping("/listBytrainingCampId")
+    public TableDataInfo listBytrainingCampId(PeriodStatisticCountParam param) {
+        startPage();
+        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectListBytrainingCampId(param);
+        return getDataTable(list);
+    }
+}

+ 4 - 5
fs-company/src/main/java/com/fs/company/controller/qw/SopUserLogsInfoController.java

@@ -26,14 +26,11 @@ import com.fs.sop.params.SendUserLogsInfoMsgParam;
 import com.fs.sop.service.ISopUserLogsInfoService;
 import com.fs.voice.utils.StringUtil;
 import com.google.gson.Gson;
-import com.google.gson.JsonSyntaxException;
 import com.google.gson.reflect.TypeToken;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.io.IOException;
-import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
@@ -98,8 +95,10 @@ public class SopUserLogsInfoController extends BaseController
                     Map<String, QwTag> tagMap = PubFun.listToMapByGroupObject(tagList, QwTag::getTagId);
                     qwExternalContactVOTimes.forEach(e -> {
                         List<String> tagId = JSON.parseArray(e.getTagIds(), String.class);
-                        List<String> tagNameList = tagId.stream().filter(tagMap::containsKey).map(t -> tagMap.get(t).getName()).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
-                        e.setTagIdsName(tagNameList);
+                        if(StringUtils.isNotEmpty(tagId)){
+                            List<String> tagNameList = tagId.stream().filter(tagMap::containsKey).map(t -> tagMap.get(t).getName()).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
+                            e.setTagIdsName(tagNameList);
+                        }
                     });
                 }
                 // 设置联系信息

+ 7 - 0
fs-company/src/main/java/com/fs/company/controller/store/FsStoreOrderController.java

@@ -527,6 +527,11 @@ public class FsStoreOrderController extends BaseController
     @Autowired
     @Qualifier("wdtErpOrderServiceImpl")
     private IErpOrderService wdtOrderService;
+
+    @Autowired
+    @Qualifier("JSTErpOrderServiceImpl")
+    private IErpOrderService jSTOrderService;
+
     private IErpOrderService getErpService() {
         FsSysConfig sysConfig = configUtil.getSysConfig();
         Integer erpOpen = sysConfig.getErpOpen();
@@ -541,6 +546,8 @@ public class FsStoreOrderController extends BaseController
                 } else if (erpType == 2){
                     //旺店通
                     erpOrderService =  wdtOrderService;
+                }else if(erpType == 5){
+                    erpOrderService = jSTOrderService;
                 }
                 return erpOrderService;
 

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

@@ -13,7 +13,7 @@ import com.fs.his.vo.OptionsVO;
 import java.util.List;
 import java.util.Map;
 
-/**
+    /**
  * 营期课程Service接口
  *
  * @author fs

+ 16 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsUserCoursePeriodDaysServiceImpl.java

@@ -1,6 +1,7 @@
 package com.fs.course.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.common.core.domain.R;
 import com.fs.common.utils.DateUtils;
@@ -24,6 +25,8 @@ import com.fs.course.vo.UpdateCourseTimeVo;
 import com.fs.course.vo.newfs.FsCourseAnalysisCountVO;
 import com.fs.his.mapper.FsUserMapper;
 import com.fs.his.vo.OptionsVO;
+import com.fs.system.domain.SysConfig;
+import com.fs.system.mapper.SysConfigMapper;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -54,6 +57,7 @@ public class FsUserCoursePeriodDaysServiceImpl extends ServiceImpl<FsUserCourseP
     private final FsUserCoursePeriodMapper fsUserCoursePeriodMapper;
 
     private final FsUserMapper fsUserMapper;
+    private final SysConfigMapper sysConfigMapper;
 
     private final FsUserCoursePeriodDaysMapper fsUserCoursePeriodDaysMapper;
     private final IFsUserCourseVideoService fsUserCourseVideoService;
@@ -178,6 +182,10 @@ public class FsUserCoursePeriodDaysServiceImpl extends ServiceImpl<FsUserCourseP
             }else if(video.getViewEndTime() != null){
                 day.setEndDateTime(LocalDateTime.of(day.getDayDate(), video.getViewEndTime()));
             }
+            SysConfig config = sysConfigMapper.selectConfigByConfigKey("joinTime.switch.config");
+            if (ObjectUtils.isNotEmpty(config)&&config.getConfigValue().equals("1")){
+                entity.setJoinTime(entity.getEndTime1());
+            }
             if(entity.getJoinTime() != null){
                 day.setLastJoinTime(LocalDateTime.of(day.getDayDate(), entity.getJoinTime()));
             }else if(video.getLastJoinTime() != null){
@@ -339,7 +347,14 @@ public class FsUserCoursePeriodDaysServiceImpl extends ServiceImpl<FsUserCourseP
             // 调整时间为直接接收前端传入的年月日,不使用营期的日期(2025年6月11日 10点41分)
             day.setStartDateTime(vo.getStartTime());
             day.setEndDateTime(vo.getEndTime1());
-            day.setLastJoinTime(vo.getJoinTime());
+
+            SysConfig config = sysConfigMapper.selectConfigByConfigKey("joinTime.switch.config");
+            if (ObjectUtils.isNotEmpty(config)&&config.getConfigValue().equals("1")){
+                day.setLastJoinTime(vo.getEndTime1());
+            }else {
+                day.setLastJoinTime(vo.getJoinTime());
+            }
+
             // 把营期时间改成开始时间
             day.setDayDate(vo.getStartTime().toLocalDate());
             // 设置状态

+ 3 - 0
fs-service/src/main/java/com/fs/erp/domain/ErpGoods.java

@@ -21,4 +21,7 @@ public class ErpGoods {
     List<ErpCombineItem> combine_item;
     //hzOMSErp 使用 商品id
     Long storeProductId;
+
+    //适用多商品批量上传
+    List<Long> productIdList;
 }

+ 10 - 0
fs-service/src/main/java/com/fs/erp/dto/OrderItemDTO.java

@@ -55,4 +55,14 @@ public class OrderItemDTO implements Serializable {
      * 生产日期
      */
     private String producedDate;
+
+    /**
+     * 商品属性
+     * **/
+    private String propertiesValue;
+
+    /**
+     * 款式编码
+     * **/
+    private String shopIId;
 }

+ 2 - 1
fs-service/src/main/java/com/fs/erp/http/JstErpHttpService.java

@@ -1,5 +1,6 @@
 package com.fs.erp.http;
 
+import com.alibaba.fastjson.JSONObject;
 import com.fs.erp.dto.*;
 import com.fs.ybPay.dto.RefundOrderDTO;
 
@@ -32,7 +33,7 @@ public interface JstErpHttpService {
      * @param dto 请求参数
      * @return ProductUploadResultDTO
      */
-    ProductUploadResultDTO uploadGoods(GoodsInfoDTO dto);
+    ProductUploadResultDTO uploadGoods(JSONObject dto);
 
     /**
      * 普通商品资料查询(按sku查询)

+ 14 - 1
fs-service/src/main/java/com/fs/erp/http/JstErpHttpServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.map.MapUtil;
 import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.PropertyNamingStrategy;
 import com.alibaba.fastjson.TypeReference;
 import com.alibaba.fastjson.serializer.SerializeConfig;
@@ -27,6 +28,7 @@ import java.util.Map;
 @Service
 public class JstErpHttpServiceImpl implements JstErpHttpService {
 
+    //正式
     private static final String BASE_URL = "https://openapi.jushuitan.com/";
     /**
      * 获取access_token、refresh_token url
@@ -38,6 +40,17 @@ public class JstErpHttpServiceImpl implements JstErpHttpService {
      */
     private static final String REFRESH_TOKEN_URL = BASE_URL + "openWeb/auth/refreshToken";
 
+    //测试
+//    private static final String BASE_URL = "https://dev-api.jushuitan.com/";
+//    /**
+//     * 获取access_token、refresh_token url
+//     */
+//    private static final String GET_INIT_TOKEN_URL = BASE_URL + "openWebIsv/auth/getInitToken";
+//
+//    /**
+//     * 更新access_token、refresh_token url
+//     */
+//    private static final String REFRESH_TOKEN_URL = BASE_URL + "openWebIsv/auth/refreshToken;
 
     @Value("${jst.app_key:''}")
     private String appKey;
@@ -68,7 +81,7 @@ public class JstErpHttpServiceImpl implements JstErpHttpService {
     }
 
     @Override
-    public ProductUploadResultDTO uploadGoods(GoodsInfoDTO dto) {
+    public ProductUploadResultDTO uploadGoods(JSONObject dto) {
         String url = BASE_URL + "/open/jushuitan/itemsku/upload";
         log.info("上传商品信息 - URL: {}, 请求体: {}", url, JSON.toJSONString(dto));
 

+ 36 - 7
fs-service/src/main/java/com/fs/erp/service/impl/DfOrderServiceImpl.java

@@ -155,7 +155,7 @@ public class DfOrderServiceImpl implements IErpOrderService
                         if (dfApiResponse != null && "ok".equals(dfApiResponse.getCode())) {
                             dfApiResponse.setCode(mailNumber);
                             Object result = dfApiResponse.getResult();
-                            String jsonStr = JSONUtil.toJsonStr(result);
+                            String jsonStr = JSON.toJSONString(JSON.parseObject(JSONUtil.toJsonStr(result), HashMap.class).get("list"));
                             List<ErpDeliverys> dfDeliveryResponse = null;
                             try {
                                 dfDeliveryResponse = JSON.parseArray(jsonStr, ErpDeliverys.class);
@@ -264,10 +264,11 @@ public class DfOrderServiceImpl implements IErpOrderService
             //3.处理请求结果
             if (dfApiResponse != null && "ok".equals(dfApiResponse.getCode())) {
                 String jsonString = JSON.toJSONString(dfApiResponse.getResult());
-                List<DFOrderStatusResultRequest> requestList = JSON.parseArray(jsonString, DFOrderStatusResultRequest.class);
-                if (requestList != null && !requestList.isEmpty()){
+//                List<DFOrderStatusResultRequest> requestList = JSON.parseArray(jsonString, DFOrderStatusResultRequest.class);
+                DFOrderStatusResultRequest temp = JSON.parseObject(jsonString, DFOrderStatusResultRequest.class);
+//                if (requestList != null && !requestList.isEmpty()){
                     //0待揽收 1已揽收 2运输中 3派送中 4异常件 5退回件 6退回签收 7转寄件 8作废件 9已签收 10 已取消
-                    for (DFOrderStatusResultRequest temp : requestList) {
+//                    for (DFOrderStatusResultRequest temp : requestList) {
                         if (temp.getStatus() == 10){
                             //取消订单
                             String mailNumber = temp.getMailNumber();
@@ -287,10 +288,13 @@ public class DfOrderServiceImpl implements IErpOrderService
                                     log.info("代服管家 订单取消成功: {}", response);
                                 });
                             }
+                        } else if (temp.getStatus() == 9){
+                            //已签收
+                            fsStoreOrderService.getGoods(order.getOrderId());
                         }
                     }
-                }
-            }
+//                }
+//            }
         } catch (IOException e) {
             e.printStackTrace();
         }
@@ -533,7 +537,17 @@ public class DfOrderServiceImpl implements IErpOrderService
                         //下单结果
                         BspOrderResponseWrapper bspOrderResponse = JSONUtil.toBean(jsonString, BspOrderResponseWrapper.class);
                         if (bspOrderResponse != null) {
-                            setExpress(bspOrderResponse);
+                            String failMsg = bspOrderResponse.getFailMsg();
+                            if (StringUtils.isNotBlank(failMsg)) {
+                                if (failMsg.equals("暂未结果, 请稍后再查")){
+                                    return;
+                                }
+                                //下单失败 返回未推送状态
+                                String  orderNumber = bspOrderResponse.getOrderNumber();
+                                rollBackOrder(orderNumber,failMsg);
+                            } else {
+                                setExpress(bspOrderResponse);
+                            }
                         }
                     } else if ("2".equals(status)) {
                         //取消订单
@@ -556,6 +570,21 @@ public class DfOrderServiceImpl implements IErpOrderService
         }
     }
 
+    private void rollBackOrder(String orderNumber,String failMsg) {
+        FsStoreOrder fsStoreOrder = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(orderNumber);
+        FsStoreOrder tempOrder = new FsStoreOrder();
+        tempOrder.setOrderId(fsStoreOrder.getOrderId());
+        tempOrder.setExtendOrderId("");
+        fsStoreOrderMapper.updateFsStoreOrder(tempOrder);
+        FsStoreOrderDf df = new FsStoreOrderDf();
+        df.setOrderId(fsStoreOrder.getOrderId());
+        df.setStatus(0); //回到默认
+        df.setFailMsg(failMsg); //失败消息
+        df.setUpdateTime(new Date());
+        fsStoreOrderDfMapper.updateFsStoreOrderDf(df);
+        //推送失败消息
+    }
+
     /**
      * 顺丰会有自己的轨迹推送 不使用快递鸟(代服务管家设置推送地址)
      *

+ 75 - 1
fs-service/src/main/java/com/fs/erp/service/impl/JSTErpGoodsServiceImpl.java

@@ -1,22 +1,54 @@
 package com.fs.erp.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.utils.StringUtils;
 import com.fs.erp.domain.ErpGoods;
 import com.fs.erp.dto.*;
 import com.fs.erp.http.JstErpHttpService;
 import com.fs.erp.service.IErpGoodsService;
+import com.fs.his.domain.FsStoreProduct;
+import com.fs.his.domain.FsStoreProductAttrValue;
+import com.fs.his.service.IFsStoreProductAttrValueService;
+import com.fs.his.service.IFsStoreProductService;
+import com.fs.voice.utils.StringUtil;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
 
 @Service("JSTErpGoodsServiceImpl")
 public class JSTErpGoodsServiceImpl implements IErpGoodsService {
     @Autowired
     private JstErpHttpService jstErpHttpService;
+
+    @Autowired
+    private IFsStoreProductService fsStoreProductService;
+
+    @Autowired
+    private IFsStoreProductAttrValueService fsStoreProductAttrValueService;
+
+    // 每次最大处理数量
+    private static final int BATCH_SIZE = 190;
+
     @Override
     public BaseResponse addGoods(ErpGoods goods) {
+        List<Long> storeProductIds = goods.getProductIdList();
+        JSONArray bulidJSONArray = buildGoods(storeProductIds);
+
+        //调用接口
+        for (int i = 0; i < bulidJSONArray.size(); i += BATCH_SIZE) {
+            JSONObject request=new JSONObject();
+            int end = Math.min(i + BATCH_SIZE, bulidJSONArray.size());
+            request.put("items",bulidJSONArray.subList(i, end));
+            jstErpHttpService.uploadGoods(request);
+        }
+
         return null;
     }
 
@@ -27,7 +59,7 @@ public class JSTErpGoodsServiceImpl implements IErpGoodsService {
         ProductResponseDTO productResponseDTO = jstErpHttpService.queryGoods(requestDTO);
         List<ProductResponseDTO.ProductInfo> datas = productResponseDTO.getDatas();
         ErpGoodsQueryResponse erpGoodsQueryResponse = new ErpGoodsQueryResponse();
-        if(CollectionUtils.isNotEmpty(datas)){
+        if (CollectionUtils.isNotEmpty(datas)) {
             List<ErpGoods> erpGoodsList = new ArrayList<>();
             for (ProductResponseDTO.ProductInfo data : datas) {
                 ErpGoods erpGoods = new ErpGoods();
@@ -49,4 +81,46 @@ public class JSTErpGoodsServiceImpl implements IErpGoodsService {
     public ErpGoodsStockQueryResponse getGoodsStock(ErpGoodsStockQueryRequert param) {
         return null;
     }
+
+    /**
+     * 构建店铺商品上传的参数
+     *
+     * @param storeProductIds
+     * @return
+     */
+    public JSONArray buildGoods(List<Long> storeProductIds) {
+        JSONArray res = new JSONArray();
+        //商品
+        List<FsStoreProduct> fsStoreProductList = fsStoreProductService.getStoreProductInProductIds(storeProductIds);
+        if (!fsStoreProductList.isEmpty()) {
+
+            Map<Long, FsStoreProduct> productMap = fsStoreProductList.stream().collect(Collectors.toMap(FsStoreProduct::getProductId, p -> p));
+            //商品规格List
+            List<FsStoreProductAttrValue> fsStoreProductAttrValues = fsStoreProductAttrValueService.getFsStoreProductAttrValueListInProductId(storeProductIds);
+
+            //按规格构建商品数据
+            fsStoreProductAttrValues.forEach(v -> {
+                JSONObject productJson = new JSONObject();
+                FsStoreProduct product = productMap.get(v.getProductId());
+                productJson.put("sku_id", v.getBarCode());//商品编码
+                productJson.put("i_id", v.getBarCode());//如果没有款式默认商品编码一致
+                productJson.put("name", v.getSku());//名称
+                productJson.put("short_name", product.getKeyword());//简称
+                if(StringUtils.isNotEmpty(product.getBrand())){
+                    productJson.put("brand", product.getBrand());//品牌
+                }
+                productJson.put("weight", v.getWeight());//重量
+                productJson.put("s_price",v.getPrice());//基本售价
+                productJson.put("c_price", v.getCost());//成本
+                productJson.put("market_price", v.getOtPrice());//市场|吊牌价
+                productJson.put("unit", product.getUnitName());//单位
+                productJson.put("sku_pic", v.getImage());//商品图片
+                productJson.put("pic", v.getImage());//图片地址(款图片)
+                productJson.put("pic_big", v.getImage());//大图地址
+                res.add(productJson);
+            });
+        }
+
+        return res;
+    }
 }

+ 3 - 0
fs-service/src/main/java/com/fs/erp/service/impl/JSTErpOrderServiceImpl.java

@@ -135,10 +135,13 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
 
             String barCode = jsonObject.getString("barCode");
             String productName = jsonObject.getString("productName");
+            String sku=jsonObject.getString("sku");
 
             orderItemDTO.setSkuId(barCode);
             orderItemDTO.setShopSkuId(barCode);
             orderItemDTO.setName(productName);
+            orderItemDTO.setShopIId(orderItemDTO.getSkuId());//款式编码ID,当前没有这个目前就与SKU ID一致
+            orderItemDTO.setPropertiesValue(sku);//商品属性
 
             FsStoreProduct fsStoreProduct = fsStoreProductService.selectFsStoreProductById(item.getProductId());
 

+ 22 - 2
fs-service/src/main/java/com/fs/erp/service/impl/JstTokenService.java

@@ -6,6 +6,8 @@ import com.fs.erp.dto.GetInitTokenResponseDTO;
 import com.fs.erp.dto.RefreshTokenRequestDTO;
 import com.fs.erp.http.JstErpHttpService;
 import com.fs.erp.utils.SignUtil;
+import com.fs.his.config.FsSysConfig;
+import com.fs.his.utils.ConfigUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,6 +42,9 @@ public class JstTokenService {
     @Autowired
     private StringRedisTemplate redisTemplate;
 
+    @Autowired
+    private ConfigUtil configUtil;
+
     /**
      * 获取访问令牌,如果缓存中存在有效令牌则直接返回,否则重新获取
      * @return 有效的访问令牌
@@ -159,14 +164,29 @@ public class JstTokenService {
     }
 
     /**
-     * 定时任务,每20天刷新一次令牌
+     * 定时任务,每28天凌晨3点刷新一次令牌
      * 根据文档说明,刷新token必须在有效期小于15天时进行,所以这里设置20天刷新一次
      */
 //    @Scheduled(fixedRate = 20 * 24 * 60 * 60 * 1000)
+    @Scheduled(cron = "0 0 3 */28 * ?")
     public void scheduleTokenRefresh() {
         log.info("定时任务:刷新聚水潭API令牌");
         try {
-            refreshAccessToken();
+            //判断是否开启erp
+            FsSysConfig sysConfig = configUtil.getSysConfig();
+            Integer erpOpen = sysConfig.getErpOpen();
+            if (erpOpen == null || erpOpen == 0) {
+                return;
+            }
+
+            //判断erp类型
+            Integer erpType = sysConfig.getErpType();
+            if (erpType == null) {
+                return;
+            } else if (erpType == 5){
+                //聚水潭
+                refreshAccessToken();
+            }
         } catch (Exception e) {
             log.error("定时刷新令牌失败", e);
         }

+ 32 - 0
fs-service/src/main/java/com/fs/his/domain/FsPhysicalReportTemplate.java

@@ -0,0 +1,32 @@
+package com.fs.his.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 体检报告模板对象 fs_physical_report_template
+ *
+ * @author fs
+ * @date 2025-07-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FsPhysicalReportTemplate extends BaseEntity{
+
+    /** 体检模板ID */
+    @Excel(name = "模板编码")
+    private Long id;
+
+    /** 体检模板名称 */
+    @Excel(name = "模板名称")
+    private String templateName;
+
+    /** 状态(0未启用、1启用) */
+    @Excel(name = "状态", readConverterExp = "0=未启用、1启用")
+    private String status;
+
+
+}

+ 72 - 0
fs-service/src/main/java/com/fs/his/domain/FsPhysicalReportTemplateField.java

@@ -0,0 +1,72 @@
+package com.fs.his.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 体检报告模板字段对象 fs_physical_report_template_field
+ *
+ * @author fs
+ * @date 2025-07-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FsPhysicalReportTemplateField extends BaseEntity{
+
+    /** 字段id */
+    private String id;
+
+    /** 模板ID */
+    @Excel(name = "模板ID")
+    private Long templateId;
+
+    /** 组件ID,后续可联动组件 */
+    @Excel(name = "组件ID,后续可联动组件")
+    private Long componentId;
+
+    /** 字段组件名称 */
+    @Excel(name = "字段组件名称")
+    private String label;
+
+    /** 字段类型 */
+    @Excel(name = "字段类型")
+    private String type;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Integer sort;
+
+    /** 是否必填0否1是 */
+    @Excel(name = "是否必填0否1是")
+    private Integer required;
+
+    /** 是否多选0否1是 */
+    @Excel(name = "是否多选0否1是")
+    private Integer multiple;
+
+    /** 多选下来数据 */
+    @Excel(name = "多选下来数据")
+    private String multiples;
+
+    /** 输入框最大长度 */
+    @Excel(name = "输入框最大长度")
+    private Long maxLength;
+
+    /** 输入框最小长度 */
+    @Excel(name = "输入框最小长度")
+    private Long minLength;
+
+    /** 状态(1未启用、2启用) */
+    @Excel(name = "状态", readConverterExp = "1=未启用、2启用")
+    private Long status;
+
+    /**
+     * 下拉多选,复选框多选值
+     * **/
+    private String options;
+
+
+}

+ 3 - 0
fs-service/src/main/java/com/fs/his/domain/FsStoreOrderDf.java

@@ -54,5 +54,8 @@ public class FsStoreOrderDf extends BaseEntity{
     @Excel(name = "0:默认 1下单 2取消订单")
     private Integer status;
 
+    /** 失败原因 */
+    private String failMsg;
+
 
 }

+ 4 - 0
fs-service/src/main/java/com/fs/his/domain/FsStoreProduct.java

@@ -229,6 +229,10 @@ public class FsStoreProduct extends BaseEntity {
     @Excel(name = "是否在商品展示")
     private Integer isDisplay;
 
+    /** 品牌 */
+    @Excel(name = "品牌")
+    private String brand;
+
     /**
      * 运费模板
      */

+ 19 - 0
fs-service/src/main/java/com/fs/his/dto/FsPhysicalReportTemplateFieldDTO.java

@@ -0,0 +1,19 @@
+package com.fs.his.dto;
+
+import com.fs.his.domain.FsPhysicalReportTemplateField;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class FsPhysicalReportTemplateFieldDTO implements Serializable {
+    //模板ID
+    private Long templateId;
+
+    //自定义字段类型
+    private List<FsPhysicalReportTemplateField> templateFieldList;
+
+    //创建人
+    private String createBy;
+}

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

@@ -102,19 +102,25 @@ public interface FsInquiryOrderReportMapper
 
     @Select("select ior.*,u.nick_name,u.phone,d.doctor_name,su.nick_name user_name,send.nick_name send_name,fio.status inquiry_status,fio. inquiry_sub_type,fio.company_user_remark FROM fs_inquiry_order_report ior  LEFT JOIN fs_user u ON u.user_id=ior.user_id LEFT JOIN fs_doctor d ON d.doctor_id=ior.doctor_id LEFT JOIN sys_user su ON su.user_id=ior.audit_user_id LEFT JOIN fs_inquiry_order fio ON fio.order_id=ior.order_id LEFT JOIN fs_user_coupon fuc ON fuc.business_type =1 AND fuc.business_id=ior.order_id LEFT JOIN sys_user send ON send.user_id=fuc.send_user_id  where ior.report_id=#{reportId}")
     FsInquiryOrderReportVO selectFsInquiryOrderReportByReportIdVO(Long reportId);
+
     @Select("select report_id FROM fs_inquiry_order_report WHERE order_id=#{id}")
     Integer selectFsInquiryOrderReportIdByOrderId(Long id);
+
     @Select("select * FROM fs_inquiry_order_report   where order_id=#{orderId}")
     FsInquiryOrderReport selectFsInquiryOrderReportByOrderId(Long orderId);
+
     @Select("select o.*,d.dept_id FROM fs_inquiry_order_report o  LEFT JOIN fs_doctor d ON d.doctor_id=o.doctor_id   where o.order_id=#{orderId}")
     FsInquiryOrderReportUVO selectFsInquiryOrderReportUVOByOrderId(Long orderId);
+
     @Select("select item_type_json FROM fs_test_temp WHERE temp_code ='C1694077002122'")
     String selectFsTestBody();
 
     @Select("select * from fs_inquiry_order_report where patient_json LIKE '%https://htj-1258038825.cos.ap-beijing.myqcloud.com%' order by report_id desc limit 2 ")
     List<FsInquiryOrderReport> selectFsInquiryOrderReportListByUpdate();
+
     @Select("select ior.*,u.nick_name,u.phone,d.doctor_name,su.nick_name user_name,send.nick_name send_name,fio.status inquiry_status,fio. inquiry_sub_type,fio.company_user_remark FROM fs_inquiry_order_report ior  LEFT JOIN fs_user u ON u.user_id=ior.user_id LEFT JOIN fs_doctor d ON d.doctor_id=ior.doctor_id LEFT JOIN sys_user su ON su.user_id=ior.audit_user_id LEFT JOIN fs_inquiry_order fio ON fio.order_id=ior.order_id LEFT JOIN fs_user_coupon fuc ON fuc.business_type =1 AND fuc.business_id=ior.order_id LEFT JOIN sys_user send ON send.user_id=fuc.send_user_id  where ior.order_id=#{orderId} limit 1")
     FsInquiryOrderReportVO selectFsInquiryOrderReportByOrderIdVO(Long orderId);
+
     @Select({"<script> " +
             "select count(1) FROM fs_inquiry_order_report ior  " +
             " LEFT JOIN fs_user u ON u.user_id=ior.user_id " +

+ 75 - 0
fs-service/src/main/java/com/fs/his/mapper/FsPhysicalReportTemplateFieldMapper.java

@@ -0,0 +1,75 @@
+package com.fs.his.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.his.domain.FsPhysicalReportTemplateField;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 体检报告模板字段Mapper接口
+ *
+ * @author fs
+ * @date 2025-07-24
+ */
+public interface FsPhysicalReportTemplateFieldMapper extends BaseMapper<FsPhysicalReportTemplateField> {
+    /**
+     * 查询体检报告模板字段
+     *
+     * @param id 体检报告模板字段主键
+     * @return 体检报告模板字段
+     */
+    FsPhysicalReportTemplateField selectFsPhysicalReportTemplateFieldById(String id);
+
+    /**
+     * 查询体检报告模板字段列表
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 体检报告模板字段集合
+     */
+    List<FsPhysicalReportTemplateField> selectFsPhysicalReportTemplateFieldList(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 新增体检报告模板字段
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    int insertFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 修改体检报告模板字段
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    int updateFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 删除体检报告模板字段
+     *
+     * @param id 体检报告模板字段主键
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateFieldById(String id);
+
+    /**
+     * 批量删除体检报告模板字段
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateFieldByIds(String[] ids);
+
+    /**
+     * 批量插入模板自定义字段
+     *
+     * @param templateFieldList 插入数据
+     **/
+    void batchInsertFsPhysicalReportTemplateField(@Param("templateFieldList") List<FsPhysicalReportTemplateField> templateFieldList);
+
+    /**
+     * 删除自定也模板
+     * **/
+    void deleteTemplateFieldByTemplateId(@Param("templateId") Long templateId);
+}

+ 61 - 0
fs-service/src/main/java/com/fs/his/mapper/FsPhysicalReportTemplateMapper.java

@@ -0,0 +1,61 @@
+package com.fs.his.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.his.domain.FsPhysicalReportTemplate;
+
+/**
+ * 体检报告模板Mapper接口
+ * 
+ * @author fs
+ * @date 2025-07-23
+ */
+public interface FsPhysicalReportTemplateMapper extends BaseMapper<FsPhysicalReportTemplate>{
+    /**
+     * 查询体检报告模板
+     * 
+     * @param id 体检报告模板主键
+     * @return 体检报告模板
+     */
+    FsPhysicalReportTemplate selectFsPhysicalReportTemplateById(String id);
+
+    /**
+     * 查询体检报告模板列表
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 体检报告模板集合
+     */
+    List<FsPhysicalReportTemplate> selectFsPhysicalReportTemplateList(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 新增体检报告模板
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    int insertFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 修改体检报告模板
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    int updateFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 删除体检报告模板
+     * 
+     * @param id 体检报告模板主键
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateById(String id);
+
+    /**
+     * 批量删除体检报告模板
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateByIds(String[] ids);
+}

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

@@ -1082,7 +1082,7 @@ public interface FsStoreOrderMapper
             "</script>"})
     Integer selectFsStoreOrderCountByType(@Param("companyId") Long companyId,@Param("userId") long userId, @Param("type")int type);
 
-    @Select("select * from fs_store_order where  `status`=2 and extend_order_id is not null ")
+    @Select("select * from fs_store_order where  `status`=2 and extend_order_id is not null and extend_order_id != '' ")
     List<FsStoreOrder> selectWdtOmsOrderdeliveryOp();
 
     int batchUpdateErpByOrderIds(@Param("maps") List<Map<String, String>> maps);
@@ -1097,4 +1097,6 @@ public interface FsStoreOrderMapper
 
     @Select("select * from fs_store_order where  `status`=3 and extend_order_id is not null and delivery_sn is not null")
     List<FsStoreOrder> selectShippedOrder();
+
+    List<FsStoreOrderListVO> selectFsStoreOrderListVOByErpAccount(@Param("maps") FsStoreOrderParam fsStoreOrder);
 }

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

@@ -1,7 +1,6 @@
 package com.fs.his.mapper;
 
 
-import com.fs.his.domain.FsStoreProductAttr;
 import com.fs.his.domain.FsStoreProductAttrValue;
 import com.fs.his.param.FsStoreProductAttrValueListDParam;
 import com.fs.his.vo.FsStoreProductAttrValueListDVO;
@@ -164,4 +163,11 @@ public interface FsStoreProductAttrValueMapper
 
     @Select("select * from fs_store_product_attr_value where product_id = #{productId}")
     List<FsStoreProductAttrValue> selectFsStoreProductAttrValueListByProductId(@Param("productId") Long productId);
+
+    /**
+     * 批量获取商品规格
+     * @param productIds
+     * @return productIds
+     * **/
+    List<FsStoreProductAttrValue> getFsStoreProductAttrValueListInProductId(@Param("productIds") List<Long> productIds);
 }

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

@@ -259,4 +259,10 @@ public interface FsStoreProductMapper {
     int updateStoreProductStock(@Param("productId") Long productId, @Param("stock") Integer stock);
 
 
+    /**
+     * 批量获取商品信息
+     * @param productIds
+     * @return List<FsStoreProduct>
+     * **/
+    List<FsStoreProduct> getStoreProductInProductIds(@Param("productIds") List<Long> productIds);
 }

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

@@ -18,6 +18,8 @@ public class FsInquiryOrderCreateParam implements Serializable {
 
     @NotEmpty(message = "病情描述不能为空")
     private String title;
+
+    private String companyUserRemark;
 //    @NotEmpty(message = "患病时长不能为空")
     private String duration;
 //    @NotEmpty(message = "是否就诊不能为空")
@@ -25,9 +27,12 @@ public class FsInquiryOrderCreateParam implements Serializable {
 
     @NotNull(message = "问诊类型不能为空")
     private Integer inquiryType;
+
     private Integer inquirySubType;
+
     @NotNull(message = "订单类型不能为空")
     private Integer orderType;
+
     private Long doctorId;
     private String reportImages;//检测报告
     private String tongueImages;//舌苔

+ 18 - 3
fs-service/src/main/java/com/fs/his/param/FsStoreOrderParam.java

@@ -8,6 +8,7 @@ import lombok.Data;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 @Data
 public class FsStoreOrderParam extends BaseEntity implements Serializable {
@@ -18,6 +19,8 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable {
     private Long storeId;
     @Excel(name = "订单号")
     private String orderCode;
+    //多个订单号搜索
+    private List<String> orderCodes;
     /** 订单号 */
     @Excel(name = "订单号")
     private String subOrderCode;
@@ -77,7 +80,7 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable {
     @Excel(name = "支付方式 1微信")
     private String payType;
 
-    /** 订单状态(-1 : 申请退款 -2 : 退货成功 1:待支付 2:待发货;3:待收货;4:待评价;5:已完成) */
+    /** 订单状态(-1 : 申请退款 -2 : 退货成功 1:待支付 2:待发货;3:待收货;4:待评价;5:已完成) 6(金牛代服待推送,请避开6)*/
     @Excel(name = "订单状态", readConverterExp = "-=1,:=,申=请退款,-=2,:=,退=货成功,1=:待支付,2=:待发货;3:待收货;4:待评价;5:已完成")
     private Integer status;
 
@@ -176,6 +179,7 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable {
     @Excel(name = "订单类型")
     private Integer orderType;
     private Long companyId;
+    private List<Long> companyIds;
     private Long companyUserId;
 
     private Long userCouponId;
@@ -212,9 +216,9 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable {
 
     private String qwSubject;
 //    @ApiModelProperty(value = "页码,默认为1")
-//    private Integer pageNum =1;
+    private Integer pageNum;
 //    @ApiModelProperty(value = "页大小,默认为10")
-//    private Integer pageSize = 10;
+    private Integer pageSize;
 
 
     private String packageSecondName;
@@ -228,4 +232,15 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable {
     private String source;
 
     private Long taskId;//任务ID
+
+    //排序字段
+    private String sortField;
+    //排序规则
+    private String sortOrder;
+
+    //erp电话
+    private String erpPhoneNumber;
+
+    //erp账户
+    private String erpAccount;
 }

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

@@ -156,6 +156,10 @@ public class FsStoreProductAddEditParam implements Serializable {
     @Excel(name = "运费模板")
     private Long tempId;
 
+    /** 品牌 */
+    @Excel(name = "品牌")
+    private String brand;
+
     //属性项目
     private List<ProductArrtDTO> items;
     //sku结果集

+ 80 - 0
fs-service/src/main/java/com/fs/his/service/IFsPhysicalReportTemplateFieldService.java

@@ -0,0 +1,80 @@
+package com.fs.his.service;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.api.R;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.his.domain.FsPhysicalReportTemplateField;
+import com.fs.his.dto.FsPhysicalReportTemplateFieldDTO;
+
+/**
+ * 体检报告模板字段Service接口
+ * 
+ * @author fs
+ * @date 2025-07-24
+ */
+public interface IFsPhysicalReportTemplateFieldService extends IService<FsPhysicalReportTemplateField>{
+    /**
+     * 查询体检报告模板字段
+     * 
+     * @param id 体检报告模板字段主键
+     * @return 体检报告模板字段
+     */
+    FsPhysicalReportTemplateField selectFsPhysicalReportTemplateFieldById(String id);
+
+    /**
+     * 查询体检报告模板字段列表
+     * 
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 体检报告模板字段集合
+     */
+    List<FsPhysicalReportTemplateField> selectFsPhysicalReportTemplateFieldList(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 新增体检报告模板字段
+     * 
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    int insertFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 修改体检报告模板字段
+     * 
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    int updateFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 批量删除体检报告模板字段
+     * 
+     * @param ids 需要删除的体检报告模板字段主键集合
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateFieldByIds(String[] ids);
+
+    /**
+     * 删除体检报告模板字段信息
+     * 
+     * @param id 体检报告模板字段主键
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateFieldById(String id);
+
+    /**
+     * 获取模板自定义字段
+     * @param templateId 模板ID
+     * @return R
+     * **/
+    R getTemplateField(String templateId);
+
+
+    /**
+     * 新增体检报告模板字段
+     *
+     * @param fieldDTO 体检报告模板字段
+     * @return 结果
+     */
+    int saveFsPhysicalReportTemplateField(FsPhysicalReportTemplateFieldDTO fieldDTO);
+}

+ 61 - 0
fs-service/src/main/java/com/fs/his/service/IFsPhysicalReportTemplateService.java

@@ -0,0 +1,61 @@
+package com.fs.his.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.his.domain.FsPhysicalReportTemplate;
+
+/**
+ * 体检报告模板Service接口
+ * 
+ * @author fs
+ * @date 2025-07-23
+ */
+public interface IFsPhysicalReportTemplateService extends IService<FsPhysicalReportTemplate>{
+    /**
+     * 查询体检报告模板
+     * 
+     * @param id 体检报告模板主键
+     * @return 体检报告模板
+     */
+    FsPhysicalReportTemplate selectFsPhysicalReportTemplateById(String id);
+
+    /**
+     * 查询体检报告模板列表
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 体检报告模板集合
+     */
+    List<FsPhysicalReportTemplate> selectFsPhysicalReportTemplateList(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 新增体检报告模板
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    int insertFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 修改体检报告模板
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    int updateFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 批量删除体检报告模板
+     * 
+     * @param ids 需要删除的体检报告模板主键集合
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateByIds(String[] ids);
+
+    /**
+     * 删除体检报告模板信息
+     * 
+     * @param id 体检报告模板主键
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateById(String id);
+}

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

@@ -245,4 +245,6 @@ public interface IFsStoreOrderService
      * @return
      */
     R receiveWaybillPush(String body);
+
+    List<FsStoreOrderListVO> selectFsStoreOrderListVOByErpAccount(FsStoreOrderParam fsStoreOrder);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreProductAttrValueService.java

@@ -68,4 +68,11 @@ public interface IFsStoreProductAttrValueService
     int updateStoreProductAttrValueStock(Long id , Integer stock);
 
     List<FsStoreProductAttrValue> selectFsStoreProductAttrValueListByProductId( Long productId);
+
+    /**
+     * 批量获取商品规格
+     * @param productIds
+     * @return productIds
+     * **/
+    List<FsStoreProductAttrValue> getFsStoreProductAttrValueListInProductId(List<Long> productIds);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreProductService.java

@@ -97,4 +97,11 @@ public interface IFsStoreProductService
     FsStoreProduct getStoreProductByProductIdAndStoreId(Long productId, Long storeId);
 
     int updateStoreProductStock(Long productId, Integer num);
+
+    /**
+     * 批量获取商品信息
+     * @param productIds
+     * @return List<FsStoreProduct>
+     * **/
+    List<FsStoreProduct> getStoreProductInProductIds(List<Long> productIds);
 }

+ 1 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsInquiryOrderServiceImpl.java

@@ -532,7 +532,6 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
         fsInquiryOrderLogsService.insertFsInquiryOrderLogs(log);
         return R.ok("操作成功");
     }
-
     @Override
     @Transactional
     public R createOrder(FsInquiryOrderCreateParam param) {
@@ -593,6 +592,7 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
         order.setUserId(param.getUserId());
         order.setPatientId(patient.getPatientId());
         order.setInquirySubType(param.getInquirySubType());
+        order.setCompanyUserRemark(param.getCompanyUserRemark());
         if (param.getSource()!=null){
             order.setSource(param.getSource());
         }

+ 153 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPhysicalReportTemplateFieldServiceImpl.java

@@ -0,0 +1,153 @@
+package com.fs.his.service.impl;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.api.R;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.utils.StringUtils;
+import com.fs.his.domain.FsPhysicalReportTemplate;
+import com.fs.his.dto.FsPhysicalReportTemplateFieldDTO;
+import com.fs.his.mapper.FsPhysicalReportTemplateMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.fs.his.mapper.FsPhysicalReportTemplateFieldMapper;
+import com.fs.his.domain.FsPhysicalReportTemplateField;
+import com.fs.his.service.IFsPhysicalReportTemplateFieldService;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 体检报告模板字段Service业务层处理
+ *
+ * @author fs
+ * @date 2025-07-24
+ */
+@Service
+public class FsPhysicalReportTemplateFieldServiceImpl extends ServiceImpl<FsPhysicalReportTemplateFieldMapper, FsPhysicalReportTemplateField> implements IFsPhysicalReportTemplateFieldService {
+
+    @Autowired
+    private FsPhysicalReportTemplateMapper physicalReportTemplateMapper;
+
+
+    /**
+     * 查询体检报告模板字段
+     *
+     * @param id 体检报告模板字段主键
+     * @return 体检报告模板字段
+     */
+    @Override
+    public FsPhysicalReportTemplateField selectFsPhysicalReportTemplateFieldById(String id) {
+        return baseMapper.selectFsPhysicalReportTemplateFieldById(id);
+    }
+
+    /**
+     * 查询体检报告模板字段列表
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 体检报告模板字段
+     */
+    @Override
+    public List<FsPhysicalReportTemplateField> selectFsPhysicalReportTemplateFieldList(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        return baseMapper.selectFsPhysicalReportTemplateFieldList(fsPhysicalReportTemplateField);
+    }
+
+    /**
+     * 新增体检报告模板字段
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    @Override
+    public int insertFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        fsPhysicalReportTemplateField.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertFsPhysicalReportTemplateField(fsPhysicalReportTemplateField);
+    }
+
+    /**
+     * 修改体检报告模板字段
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    @Override
+    public int updateFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        fsPhysicalReportTemplateField.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateFsPhysicalReportTemplateField(fsPhysicalReportTemplateField);
+    }
+
+    /**
+     * 批量删除体检报告模板字段
+     *
+     * @param ids 需要删除的体检报告模板字段主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsPhysicalReportTemplateFieldByIds(String[] ids) {
+        return baseMapper.deleteFsPhysicalReportTemplateFieldByIds(ids);
+    }
+
+    /**
+     * 删除体检报告模板字段信息
+     *
+     * @param id 体检报告模板字段主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsPhysicalReportTemplateFieldById(String id) {
+        return baseMapper.deleteFsPhysicalReportTemplateFieldById(id);
+    }
+
+    @Override
+    public R getTemplateField(String templateId) {
+        //查询模板信息是否存在
+        FsPhysicalReportTemplate reportTemplate = physicalReportTemplateMapper.selectById(templateId);
+        if (StringUtils.isNull(reportTemplate)) {
+            return R.failed("操作失败,模板信息不存在!");
+        } else if (!reportTemplate.getStatus().equals("1")) {
+            return R.failed("操作失败,当前模板已禁用!");
+        }
+
+        //查询模板下自定义数据信息
+        return R.ok(baseMapper.selectList(new LambdaQueryWrapper<FsPhysicalReportTemplateField>().eq(FsPhysicalReportTemplateField::getTemplateId, templateId).orderByAsc(FsPhysicalReportTemplateField::getSort)));
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int saveFsPhysicalReportTemplateField(FsPhysicalReportTemplateFieldDTO fieldDTO) {
+        //查询模板信息是否存在
+        FsPhysicalReportTemplate reportTemplate = physicalReportTemplateMapper.selectById(fieldDTO.getTemplateId());
+        if (StringUtils.isNull(reportTemplate)) {
+            throw new ServiceException("操作失败,模板信息不存在!");
+        } else if (!reportTemplate.getStatus().equals("1")) {
+            throw new ServiceException("操作失败,当前模板已禁用!");
+        }
+
+        //验证数据主要数据是否存在
+        AtomicInteger num = new AtomicInteger();
+        Date date=new Date();
+        fieldDTO.getTemplateFieldList().forEach(t -> {
+            num.getAndIncrement();
+            if (StringUtils.isNull(t.getComponentId())) {
+                throw new ServiceException("操作失败,模板ID不能为空!");
+            } else if (StringUtils.isNull(t.getLabel())) {
+                throw new ServiceException("操作失败,组件名称不能为空!");
+            } else if (StringUtils.isNull(t.getType())) {
+                throw new ServiceException("操作失败,字段类型不能为空!");
+            }
+            t.setCreateBy(fieldDTO.getCreateBy());
+            t.setTemplateId(reportTemplate.getId());
+            t.setCreateTime(date);
+            t.setSort(num.get());
+        });
+
+        //删除相关数据
+        baseMapper.deleteTemplateFieldByTemplateId(reportTemplate.getId());
+        //批量插入
+        baseMapper.batchInsertFsPhysicalReportTemplateField(fieldDTO.getTemplateFieldList());
+        return 1;
+    }
+}

+ 125 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPhysicalReportTemplateServiceImpl.java

@@ -0,0 +1,125 @@
+package com.fs.his.service.impl;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.utils.StringUtils;
+import com.fs.huifuPay.sdk.opps.core.utils.ObjectUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.fs.his.mapper.FsPhysicalReportTemplateMapper;
+import com.fs.his.domain.FsPhysicalReportTemplate;
+import com.fs.his.service.IFsPhysicalReportTemplateService;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 体检报告模板Service业务层处理
+ *
+ * @author fs
+ * @date 2025-07-23
+ */
+@Service
+public class FsPhysicalReportTemplateServiceImpl extends ServiceImpl<FsPhysicalReportTemplateMapper, FsPhysicalReportTemplate> implements IFsPhysicalReportTemplateService {
+
+    /**
+     * 查询体检报告模板
+     *
+     * @param id 体检报告模板主键
+     * @return 体检报告模板
+     */
+    @Override
+    public FsPhysicalReportTemplate selectFsPhysicalReportTemplateById(String id) {
+        return baseMapper.selectFsPhysicalReportTemplateById(id);
+    }
+
+    /**
+     * 查询体检报告模板列表
+     *
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 体检报告模板
+     */
+    @Override
+    public List<FsPhysicalReportTemplate> selectFsPhysicalReportTemplateList(FsPhysicalReportTemplate fsPhysicalReportTemplate) {
+        return baseMapper.selectFsPhysicalReportTemplateList(fsPhysicalReportTemplate);
+    }
+
+    /**
+     * 新增体检报告模板
+     *
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int insertFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate) {
+        //验证模板是否存在
+        if (baseMapper.selectCount(new LambdaQueryWrapper<FsPhysicalReportTemplate>().eq(FsPhysicalReportTemplate::getTemplateName, fsPhysicalReportTemplate.getTemplateName()).eq(FsPhysicalReportTemplate::getStatus, "1")) > 0) {
+            throw new ServiceException("操作失败,当前模板:" + fsPhysicalReportTemplate.getTemplateName() + "名称已存在!");
+        }
+
+        fsPhysicalReportTemplate.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertFsPhysicalReportTemplate(fsPhysicalReportTemplate);
+    }
+
+    /**
+     * 修改体检报告模板
+     *
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int updateFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate) {
+        //验证修改数据是否存在
+        FsPhysicalReportTemplate reportTemplate = baseMapper.selectById(fsPhysicalReportTemplate.getId());
+        if (StringUtils.isNull(reportTemplate)) {
+            throw new ServiceException("操作失败,修改数据不存在!");
+        }
+
+        //验证模板是否存在
+        if (baseMapper.selectCount(new LambdaQueryWrapper<FsPhysicalReportTemplate>().eq(FsPhysicalReportTemplate::getTemplateName, fsPhysicalReportTemplate.getTemplateName()).eq(FsPhysicalReportTemplate::getStatus, "1").ne(FsPhysicalReportTemplate::getId, fsPhysicalReportTemplate.getId())) > 0) {
+            throw new ServiceException("操作失败,当前模板:" + fsPhysicalReportTemplate.getTemplateName() + "名称已存在!");
+        }
+
+        fsPhysicalReportTemplate.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateFsPhysicalReportTemplate(fsPhysicalReportTemplate);
+    }
+
+    /**
+     * 批量删除体检报告模板
+     *
+     * @param ids 需要删除的体检报告模板主键
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int deleteFsPhysicalReportTemplateByIds(String[] ids) {
+        //验证删除数据是否存在启用数据
+        List<FsPhysicalReportTemplate> reportTemplateList = baseMapper.selectList(new LambdaQueryWrapper<FsPhysicalReportTemplate>().in(FsPhysicalReportTemplate::getId, ids));
+        if (reportTemplateList.isEmpty() || reportTemplateList.size() != ids.length) {
+            throw new ServiceException("操作失败,删除数据不匹配!");
+        }
+        //校验数据数据状态是否
+        String templateName = reportTemplateList.stream().filter(r -> r.getStatus().equals("1")).findFirst().map(FsPhysicalReportTemplate::getTemplateName).orElse(null);
+        if (StringUtils.isNotEmpty(templateName)) {
+            throw new ServiceException("操作失败,当前模板:" + templateName + "正在启用中,无法删除!");
+        }
+
+        return baseMapper.deleteFsPhysicalReportTemplateByIds(ids);
+    }
+
+    /**
+     * 删除体检报告模板信息
+     *
+     * @param id 体检报告模板主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsPhysicalReportTemplateById(String id) {
+        return baseMapper.deleteFsPhysicalReportTemplateById(id);
+    }
+}

+ 93 - 39
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -1596,6 +1596,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
             return;
         }
         IErpOrderService erpOrderService = null;
+        ErpOrder erpOrder = new ErpOrder();
+        erpOrder.setShop_code(sysConfig.getErpShopCode());
         if (erpType == 1) {
             //管易
             erpOrderService = gyOrderService;
@@ -1611,6 +1613,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
         } else if (erpType == 5){
             //聚水潭
             erpOrderService =  jSTOrderService;
+            erpOrder.setShop_code(sysConfig.getErpJstShopCode());
         }else {
             return;
         }
@@ -1621,7 +1624,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
         if (order == null) {
             return;
         }
-        ErpOrder erpOrder = new ErpOrder();
+
         if (order.getCompanyId() != null) {
             erpOrder.setVip_code(order.getUserId().toString() + order.getCompanyId().toString());
         } else {
@@ -1629,7 +1632,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
         }
         erpOrder.setPlatform_code(order.getOrderCode());
 
-        erpOrder.setShop_code(sysConfig.getErpShopCode());
+        erpOrder.setBuyer_account(order.getUserName());
         erpOrder.setSeller_memo(order.getRemark());
         List<ErpOrderPayment> payments = new ArrayList<>();
         ErpOrderPayment payment = new ErpOrderPayment();
@@ -3176,38 +3179,60 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
 
         } else {
             BspOrderResponseWrapper addParam = JSON.parseObject(body, BspOrderResponseWrapper.class);
+            if (addParam == null) {
+                return R.ok("接收成功").put("code", "ok");
+            }
+            String failMsg = addParam.getFailMsg();
+            if (com.hc.openapi.tool.util.StringUtils.isNotBlank(failMsg)) {
+                if (failMsg.equals("暂未结果, 请稍后再查")){
+                    return R.ok("接收成功").put("code", "ok");
+                }
+                //下单失败 返回未推送状态
+                String  orderNumber = addParam.getOrderNumber();
+                FsStoreOrder fsStoreOrder = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(orderNumber);
+                FsStoreOrder tempOrder = new FsStoreOrder();
+                tempOrder.setOrderId(fsStoreOrder.getOrderId());
+                tempOrder.setExtendOrderId("");
+                fsStoreOrderMapper.updateFsStoreOrder(tempOrder);
+                FsStoreOrderDf df = new FsStoreOrderDf();
+                df.setOrderId(fsStoreOrder.getOrderId());
+                df.setStatus(0); //回到默认
+                df.setFailMsg(failMsg); //失败消息
+                df.setUpdateTime(new Date());
+                fsStoreOrderDfMapper.updateFsStoreOrderDf(df);
+                //推送失败消息
+                return R.ok("接收成功").put("code", "ok");
+            }
             if (addParam.getBspResponse() != null) {
                 //更新物流
-                if (addParam != null) {
-                    log.info("代服管家创建订单回调,{}", JSON.toJSONString(addParam));
-                    List<OrderResponse> list = addParam.getBspResponse().getBody();
-                    if (list != null && !list.isEmpty()) {
-                        for (OrderResponse orderResponse : list) {
-                            List<RlsInfo> rlsInfos = orderResponse.getRlsInfo();
-                            String orderNumber = orderResponse.getOrderNumber();
-                            String mailNumber = orderResponse.getMailNumber();
-                            if (rlsInfos != null && rlsInfos.size() > 0) {
-                                RlsInfo rlsInfo = rlsInfos.get(0);
-                                List<RlsDetail> rlsDetails = rlsInfo.getRlsDetail();
-                                if (rlsDetails != null && !rlsDetails.isEmpty()) {
-                                    RlsDetail rlsDetail = rlsDetails.get(0);
-                                    String proName = rlsDetail.getProName();
-                                    if (com.hc.openapi.tool.util.StringUtils.isNotBlank(proName)) {
-                                        FsStoreOrder order = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(orderNumber);
-                                        if (order != null && order.getStatus() == 2) {
-                                            order.setDeliverySn(mailNumber);
-                                            order.setDeliveryName(proName);
-                                            order.setDeliveryCode("SF");
-                                            order.setStatus(3);
-                                            order.setDeliverySendTime(DateUtils.getNowDate());
-                                            fsStoreOrderMapper.updateFsStoreOrder(order);
-                                            fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.DELIVERY_GOODS.getValue(), FsStoreOrderLogEnum.DELIVERY_GOODS.getDesc());
-                                            if (order.getCompanyId() != null && order.getCompanyId() > 0) {
-                                                companyService.subtractCompanyMoney(order);
-                                            }
+                log.info("代服管家创建订单回调,{}", JSON.toJSONString(addParam));
+                List<OrderResponse> list = addParam.getBspResponse().getBody();
+                if (list != null && !list.isEmpty()) {
+                    for (OrderResponse orderResponse : list) {
+                        List<RlsInfo> rlsInfos = orderResponse.getRlsInfo();
+                        String orderNumber = orderResponse.getOrderNumber();
+                        String mailNumber = orderResponse.getMailNumber();
+                        if (rlsInfos != null && rlsInfos.size() > 0) {
+                            RlsInfo rlsInfo = rlsInfos.get(0);
+                            List<RlsDetail> rlsDetails = rlsInfo.getRlsDetail();
+                            if (rlsDetails != null && !rlsDetails.isEmpty()) {
+                                RlsDetail rlsDetail = rlsDetails.get(0);
+                                String proName = rlsDetail.getProName();
+                                if (com.hc.openapi.tool.util.StringUtils.isNotBlank(proName)) {
+                                    FsStoreOrder order = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(orderNumber);
+                                    if (order != null && order.getStatus() == 2) {
+                                        order.setDeliverySn(mailNumber);
+                                        order.setDeliveryName(proName);
+                                        order.setDeliveryCode("SF");
+                                        order.setStatus(3);
+                                        order.setDeliverySendTime(DateUtils.getNowDate());
+                                        fsStoreOrderMapper.updateFsStoreOrder(order);
+                                        fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.DELIVERY_GOODS.getValue(), FsStoreOrderLogEnum.DELIVERY_GOODS.getDesc());
+                                        if (order.getCompanyId() != null && order.getCompanyId() > 0) {
+                                            companyService.subtractCompanyMoney(order);
                                         }
-                                        break;
                                     }
+                                    break;
                                 }
                             }
                         }
@@ -3229,13 +3254,16 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
             return R.error(dto.getReason());
         }
         FsStoreOrder map = new FsStoreOrder();
-        map.setDeliveryStatus(Integer.parseInt(dto.getState()));
-        map.setOrderId(order.getOrderId());
-        map.setDeliveryType(dto.getStateEx());
-        fsStoreOrderMapper.updateFsStoreOrder(map);
-        //如果是正常签收,更新订单状态
-        if (dto.getState().equals("3") && (dto.getStateEx().equals("301") || dto.getStateEx().equals("302") || dto.getStateEx().equals("304") || dto.getStateEx().equals("311"))) {
-            this.getGoods(order.getOrderId());
+        if(dto != null && dto.getState() != null){
+            map.setDeliveryStatus(Integer.parseInt(dto.getState()));
+            map.setOrderId(order.getOrderId());
+            map.setDeliveryType(dto.getStateEx());
+            fsStoreOrderMapper.updateFsStoreOrder(map);
+            //如果是正常签收,更新订单状态
+            if (dto.getState().equals("3")) {
+                this.getGoods(order.getOrderId());
+            }
+
         }
         return R.ok();
     }
@@ -3243,6 +3271,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
     @Override
     public ExpressInfoDTO getDfExpressInfoDTO(FsStoreOrder order) {
         ExpressInfoDTO expressInfoDTO = new ExpressInfoDTO();
+        expressInfoDTO.setOrderCode(order.getOrderCode());
+        expressInfoDTO.setSuccess(true);
         ErpDeliverysRequest erpDeliverysRequest = new ErpDeliverysRequest();
         erpDeliverysRequest.setCode(order.getOrderCode());
         ErpDeliverysResponse deliver = null;
@@ -3258,14 +3288,33 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                 List<TracesDTO> tracesDTOS = new ArrayList<>();
                 for (ErpDeliverys item : deliverys) {
                     TracesDTO dto = new TracesDTO();
-//                        dto.setAction();
                     dto.setLocation(item.getAcceptAddress());
                     dto.setAcceptStation(item.getRemark());
                     dto.setAcceptTime(item.getAcceptTime());
+                    tracesDTOS.add(dto);
+
                 }
                 expressInfoDTO.setTraces(tracesDTOS);
-                expressInfoDTO.setOrderCode(order.getOrderCode());
+                //匹配原代码物流编码
+                ErpDeliverys item = deliverys.get(deliverys.size()-1);
+                String opCode = item.getOpCode();
+                if ("54".equals(opCode)) {
+                    //54 取件
+                    expressInfoDTO.setState("1");
+                    expressInfoDTO.setStateEx("1");
+                } else if (opCode.startsWith("3")) {
+                    //30 分拣,36 31
+                    expressInfoDTO.setState("2");
+                    expressInfoDTO.setStateEx("2");
+                } else if ("80".equals(opCode)) {
+                    //80:您的快件已派送至本人
+                    expressInfoDTO.setState("3");
+                    expressInfoDTO.setStateEx("301");
+                }
             }
+        } else {
+            expressInfoDTO.setState("0");
+            expressInfoDTO.setStateEx("0");
         }
         return expressInfoDTO;
     }
@@ -3317,6 +3366,11 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
         return null;
     }
 
+    @Override
+    public List<FsStoreOrderListVO> selectFsStoreOrderListVOByErpAccount(FsStoreOrderParam fsStoreOrder) {
+        return fsStoreOrderMapper.selectFsStoreOrderListVOByErpAccount(fsStoreOrder);
+    }
+
     private IErpOrderService getErpService() {
         FsSysConfig sysConfig = configUtil.getSysConfig();
         Integer erpOpen = sysConfig.getErpOpen();

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

@@ -113,4 +113,9 @@ public class FsStoreProductAttrValueServiceImpl implements IFsStoreProductAttrVa
     public List<FsStoreProductAttrValue> selectFsStoreProductAttrValueListByProductId( Long productId){
         return fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueListByProductId(productId);
     }
+
+    @Override
+    public List<FsStoreProductAttrValue> getFsStoreProductAttrValueListInProductId(List<Long> productIds) {
+        return fsStoreProductAttrValueMapper.getFsStoreProductAttrValueListInProductId(productIds);
+    }
 }

+ 50 - 6
fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductServiceImpl.java

@@ -19,6 +19,7 @@ import com.fs.common.exception.ServiceException;
 import com.fs.common.utils.DateUtils;
 import com.fs.erp.domain.ErpGoods;
 import com.fs.erp.service.IErpGoodsService;
+import com.fs.erp.service.IErpOrderService;
 import com.fs.his.config.FsSysConfig;
 import com.fs.his.domain.*;
 import com.fs.his.dto.FsPackagePruductDTO;
@@ -71,6 +72,12 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
     @Qualifier("hzOMSErpGoodsServiceImpl")
     private IErpGoodsService hzOMSErpGoodsService;
 
+    @Autowired
+    @Qualifier("JSTErpGoodsServiceImpl")
+    private IErpGoodsService jSTErpGoodsService;
+
+
+
     /**
      * 查询商品
      *
@@ -451,7 +458,9 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
     @Transactional
     public R addOrEdit(FsStoreProductAddEditParam param) {
         ProductAttrCountDTO countDto = computedProductCount(param.getValues());
-
+        FsSysConfig sysConfig = configUtil.getSysConfig();
+        Integer erpOpen = sysConfig.getErpOpen();
+        ErpGoods params = new ErpGoods();
         if (param.getProductId() != null) {
             FsStoreProduct product = new FsStoreProduct();
             BeanUtils.copyProperties(param, product);
@@ -504,7 +513,22 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
                     pack.setProductJson(JSON.toJSONString(products));
                     fsPackageService.updateFsPackage(pack);
                 }
+            }
 
+            //todo 添加商品HzOMSerp调用
+            //判断是否开启erp
+            if (erpOpen == null || erpOpen == 0) {
+                //不作操作
+            } else {
+                //判断erp类型
+                Integer erpType = sysConfig.getErpType();
+                if (erpType == null) {
+                    //不作操作
+                } else if (erpType == 5){
+                    //聚水潭商品同步
+                    params.setProductIdList(Arrays.asList(product.getProductId()));
+                    jSTErpGoodsService.addGoods(params);
+                }
             }
         } else {
             FsStoreProduct product = new FsStoreProduct();
@@ -512,6 +536,7 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
             product.setPrice(countDto.getMinPrice());
             product.setOtPrice(countDto.getMinOtPrice());
             product.setCostPrice(countDto.getMinCost());
+            product.setBarCode(param.getValues().get(0).getBarCode());
             product.setGiveIntegral(new BigDecimal(countDto.getMinIntegral()));
             product.setStock(countDto.getStock());
             fsStoreProductMapper.insertFsStoreProduct(product);
@@ -527,10 +552,9 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
             } else {
                 addProductAttr(product.getProductId(), param.getItems(), param.getValues());
             }
+
             //todo 添加商品HzOMSerp调用
             //判断是否开启erp
-            FsSysConfig sysConfig = configUtil.getSysConfig();
-            Integer erpOpen = sysConfig.getErpOpen();
             if (erpOpen == null || erpOpen == 0) {
                 //不作操作
             } else {
@@ -539,14 +563,15 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
                 if (erpType == null) {
                     //不作操作
                 } else if (erpType == 3) {
-                    ErpGoods params = new ErpGoods();
                     params.setStoreProductId(product.getProductId());
                     //瀚智OMS 维护添加商品
                     hzOMSErpGoodsService.addGoods(params);
+                }else if (erpType == 5){
+                    //聚水潭商品同步
+                    params.setProductIdList(Arrays.asList(product.getProductId()));
+                    jSTErpGoodsService.addGoods(params);
                 }
             }
-
-
         }
         return R.ok();
     }
@@ -652,6 +677,8 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
         StringBuilder successMsg = new StringBuilder();
         StringBuilder failureMsg = new StringBuilder();
 
+        //存储商品Id
+        List<Long> jstProductIds=new LinkedList<>();
         for (FsStoreProductExcelVO productVO : productList) {
             try {
 
@@ -738,6 +765,7 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
                 fsStoreProductAttrMapper.insertFsStoreProductAttr(attr);
                 successNum++;
                 successMsg.append("<br/>" + successNum + "、商品 " + product.getProductName() + " 导入成功");
+
                 //todo 添加商品HzOMSerp调用
                 //判断是否开启erp
                 FsSysConfig sysConfig = configUtil.getSysConfig();
@@ -754,6 +782,8 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
                         params.setStoreProductId(product.getProductId());
                         //瀚智OMS 维护添加商品
                         hzOMSErpGoodsService.addGoods(params);
+                    }else if(erpType == 5){
+                        jstProductIds.add(product.getProductId());
                     }
                 }
             } catch (Exception e) {
@@ -763,6 +793,16 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
                 failureMsg.append(msg + e.getMessage());
             }
         }
+
+        //验证聚水潭商品Id
+        if(!jstProductIds.isEmpty()){
+            //同步聚水潭商品
+            ErpGoods params = new ErpGoods();
+            params.setProductIdList(jstProductIds);
+            jSTErpGoodsService.addGoods(params);
+        }
+
+
         if (failureNum > 0) {
             failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
             throw new ServiceException(failureMsg.toString());
@@ -826,4 +866,8 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
         return fsStoreProductMapper.updateStoreProductStock(productId, num);
     }
 
+    @Override
+    public List<FsStoreProduct> getStoreProductInProductIds(List<Long> productIds) {
+        return fsStoreProductMapper.getStoreProductInProductIds(productIds);
+    }
 }

+ 3 - 0
fs-service/src/main/java/com/fs/his/vo/FsStoreOrderListVO.java

@@ -63,4 +63,7 @@ public class FsStoreOrderListVO {
 
     //erp推送号码
     private String erpPhone;
+
+    //erp推送账号
+    private String erpAccount;
 }

+ 8 - 0
fs-service/src/main/java/com/fs/sop/domain/SopUserLogsInfo.java

@@ -73,6 +73,14 @@ public class SopUserLogsInfo implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private String inComingETime;
 
+    /**
+     * 营期时间
+     */
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String startTime;
+
+
     @TableField(exist = false)
     private Integer level;
 

+ 1 - 1
fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsMapper.java

@@ -109,7 +109,7 @@ public interface SopUserLogsMapper {
 
     @DataSource(DataSourceType.SOP)
     @Select("<script>" +
-            "select li.sop_id,li.external_contact_id,li.qw_user_id,li.corp_id,li.external_id,li.external_user_name " +
+            "select li.sop_id,li.external_contact_id,li.qw_user_id,li.corp_id,li.external_id,li.external_user_name,li.fs_user_id,ul.start_time,li.is_days_not_study " +
             "from sop_user_logs ul  " +
             "left join  sop_user_logs_info li on ul.id=li.user_logs_id " +
             "        WHERE ul.id IN\n" +

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

@@ -276,7 +276,9 @@ public class QwSopTempServiceImpl implements IQwSopTempService
             Map<Long, List<QwSopTempContent>> contentMap = PubFun.listToMapByGroupList(contentList, QwSopTempContent::getRulesId);
             rulesList.forEach(e -> {
                 List<QwSopTempContent> contents = contentMap.get(e.getId());
-                e.setSetting(contents.stream().map(c -> JSON.parseObject(c.getContent())).collect(Collectors.toList()));
+                if (CollectionUtils.isNotEmpty(contents)){
+                    e.setSetting(contents.stream().map(c -> JSON.parseObject(c.getContent())).collect(Collectors.toList()));
+                }
             });
         }
         day.setList(rulesList);

+ 9 - 4
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -805,7 +805,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             break;
                         //小程序单独
                         case "4":
-                            addWatchLogIfNeeded(param.getSopId(), param.getVideoId(), param.getCourseId(),item.getFsUserId(), qwUserId, companyUserId, companyId, item.getExternalId(),param.getStartTime(),createTime );
+                            addWatchLogIfNeeded(item.getSopId(), param.getVideoId(), param.getCourseId(),item.getFsUserId(), qwUserId, companyUserId, companyId, item.getExternalId(),item.getStartTime(),createTime );
 
                             String linkByMiniApp = createLinkByMiniApp(st, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
                                     qwUserId, companyUserId, companyId, item.getExternalId(), config);
@@ -821,7 +821,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             break;
                         //app
                         case "9":
-                            addWatchLogIfNeeded(param.getSopId(), param.getVideoId(), param.getCourseId(),item.getFsUserId(), qwUserId, companyUserId, companyId, item.getExternalId(),param.getStartTime(),createTime );
+                            addWatchLogIfNeeded(item.getSopId(), param.getVideoId(), param.getCourseId(),item.getFsUserId(), qwUserId, companyUserId, companyId, item.getExternalId(),item.getStartTime(),createTime );
 
                             QwCreateLinkByAppVO linkByApp = createLinkByApp(st, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
                                     qwUserId, companyUserId, companyId, item.getExternalId(), config,qwUser.getQwUserName(),contact.getFsUserId());
@@ -877,10 +877,15 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
     @Override
     public List<ExtCourseSopWatchLogVO> getExtCourseSopWatchLog(QwExtCourseSopWatchLog qwExternalContactId) {
 
+
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSON.parseObject(json, CourseConfig.class);
+
         List<ExtCourseSopWatchLogVO> watchLogVOList = sopUserLogsInfoMapper.getExtCourseSopWatchLog(qwExternalContactId);
 
         watchLogVOList.forEach(item->{
             item.setTitle(iFsUserCourseVideoService.selectFsUserCourseVideoByVideoForTitle(item.getVideoId()));
+            item.setUrl(config.getSidebarImageUrl());
         });
 
         return watchLogVOList;
@@ -1139,8 +1144,8 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                 //小程序单独
                 case "4":
 
-                    addWatchLogIfNeeded(param.getSopId(), param.getVideoId(), param.getCourseId(),item.getFsUserId(), String.valueOf(qwUser.getId()), companyUserId, companyId,
-                            item.getExternalId(),param.getStartTime(),dataTime );
+                    addWatchLogIfNeeded(item.getSopId(), param.getVideoId(), param.getCourseId(),item.getFsUserId(), String.valueOf(qwUser.getId()), companyUserId, companyId,
+                            item.getExternalId(),item.getStartTime(),dataTime );
 
                     String linkByMiniApp = createLinkByMiniApp(st, param.getCorpId(), dataTime, param.getCourseId(), param.getVideoId(),
                             String.valueOf(qwUser.getId()), companyUserId, companyId, item.getExternalId(), config);

+ 2 - 0
fs-service/src/main/java/com/fs/sop/vo/ExtCourseSopWatchLogVO.java

@@ -34,6 +34,8 @@ public class ExtCourseSopWatchLogVO {
     */
     private String title;
 
+    private String url;
+
 
     /**
     * 营期时间

+ 3 - 3
fs-service/src/main/resources/application-config-druid-xzt.yml

@@ -87,9 +87,9 @@ wx_miniapp_temp:
   inquiry_temp_id:
 # 聚水潭API配置
 jst:
-  app_key: bd7a7d06a6d54377842f883f9a4c502a
-  app_secret: 1d112cb9d21d41e187ff824b5852f4cf
-  authorization_code: zzzzzz
+  app_key: a4b1fab173c84f67b3873857eea11d90 #聚水潭2025-07-25
+  app_secret: dfce1f8dc8a64ddc91212fc3fcdd9349 #聚水潭2025-07-25
+  authorization_code: 666666
   shop_code: "18461733"
 
 

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

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

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

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

+ 175 - 0
fs-service/src/main/resources/mapper/his/FsPhysicalReportTemplateFieldMapper.xml

@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.his.mapper.FsPhysicalReportTemplateFieldMapper">
+    
+    <resultMap type="FsPhysicalReportTemplateField" id="FsPhysicalReportTemplateFieldResult">
+        <result property="id"    column="id"    />
+        <result property="templateId"    column="template_id"    />
+        <result property="componentId"    column="component_id"    />
+        <result property="label"    column="label"    />
+        <result property="remark"    column="remark"    />
+        <result property="type"    column="type"    />
+        <result property="sort"    column="sort"    />
+        <result property="required"    column="required"    />
+        <result property="multiple"    column="multiple"    />
+        <result property="multiples"    column="multiples"    />
+        <result property="maxLength"    column="max_length"    />
+        <result property="minLength"    column="min_length"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="status"    column="status"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateBy"    column="update_by"    />
+    </resultMap>
+
+    <sql id="selectFsPhysicalReportTemplateFieldVo">
+        select id, template_id, component_id, label, remark, type, sort, required, multiple, multiples, max_length, min_length, create_time, update_time, status, create_by, update_by from fs_physical_report_template_field
+    </sql>
+
+    <select id="selectFsPhysicalReportTemplateFieldList" parameterType="FsPhysicalReportTemplateField" resultMap="FsPhysicalReportTemplateFieldResult">
+        <include refid="selectFsPhysicalReportTemplateFieldVo"/>
+        <where>  
+            <if test="templateId != null "> and template_id = #{templateId}</if>
+            <if test="componentId != null "> and component_id = #{componentId}</if>
+            <if test="label != null  and label != ''"> and label = #{label}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="sort != null "> and sort = #{sort}</if>
+            <if test="required != null "> and required = #{required}</if>
+            <if test="multiple != null "> and multiple = #{multiple}</if>
+            <if test="multiples != null  and multiples != ''"> and multiples = #{multiples}</if>
+            <if test="maxLength != null "> and max_length = #{maxLength}</if>
+            <if test="minLength != null "> and min_length = #{minLength}</if>
+            <if test="status != null "> and status = #{status}</if>
+        </where>
+    </select>
+    
+    <select id="selectFsPhysicalReportTemplateFieldById" parameterType="String" resultMap="FsPhysicalReportTemplateFieldResult">
+        <include refid="selectFsPhysicalReportTemplateFieldVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertFsPhysicalReportTemplateField" parameterType="FsPhysicalReportTemplateField" useGeneratedKeys="true" keyProperty="id">
+        insert into fs_physical_report_template_field
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="templateId != null">template_id,</if>
+            <if test="componentId != null">component_id,</if>
+            <if test="label != null and label != ''">label,</if>
+            <if test="remark != null">remark,</if>
+            <if test="type != null and type != ''">type,</if>
+            <if test="sort != null">sort,</if>
+            <if test="required != null">required,</if>
+            <if test="multiple != null">multiple,</if>
+            <if test="multiples != null">multiples,</if>
+            <if test="maxLength != null">max_length,</if>
+            <if test="minLength != null">min_length,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="status != null">status,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="templateId != null">#{templateId},</if>
+            <if test="componentId != null">#{componentId},</if>
+            <if test="label != null and label != ''">#{label},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="type != null and type != ''">#{type},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="required != null">#{required},</if>
+            <if test="multiple != null">#{multiple},</if>
+            <if test="multiples != null">#{multiples},</if>
+            <if test="maxLength != null">#{maxLength},</if>
+            <if test="minLength != null">#{minLength},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="status != null">#{status},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsPhysicalReportTemplateField" parameterType="FsPhysicalReportTemplateField">
+        update fs_physical_report_template_field
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="templateId != null">template_id = #{templateId},</if>
+            <if test="componentId != null">component_id = #{componentId},</if>
+            <if test="label != null and label != ''">label = #{label},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="type != null and type != ''">type = #{type},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="required != null">required = #{required},</if>
+            <if test="multiple != null">multiple = #{multiple},</if>
+            <if test="multiples != null">multiples = #{multiples},</if>
+            <if test="maxLength != null">max_length = #{maxLength},</if>
+            <if test="minLength != null">min_length = #{minLength},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteFsPhysicalReportTemplateFieldById" parameterType="String">
+        delete from fs_physical_report_template_field where id = #{id}
+    </delete>
+
+    <delete id="deleteFsPhysicalReportTemplateFieldByIds" parameterType="String">
+        delete from fs_physical_report_template_field where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <insert id="batchInsertFsPhysicalReportTemplateField" parameterType="java.util.List">
+        insert into fs_physical_report_template_field
+        (
+        template_id,
+        component_id,
+        label,
+        remark,
+        type,
+        sort,
+        required,
+        multiple,
+        multiples,
+        max_length,
+        min_length,
+        create_time,
+        update_time,
+        status,
+        create_by,
+        update_by,
+        options
+        )
+        values
+        <foreach collection="templateFieldList" index="index" item="item" separator=",">
+            (
+            #{item.templateId},
+            #{item.componentId},
+            #{item.label},
+            #{item.remark},
+            #{item.type},
+            #{item.sort},
+            #{item.required},
+            #{item.multiple},
+            #{item.multiples},
+            #{item.maxLength},
+            #{item.minLength},
+            #{item.createTime},
+            #{item.updateTime},
+            #{item.status},
+            #{item.createBy},
+            #{item.updateBy},
+            #{item.options}
+            )
+        </foreach>
+    </insert>
+
+    <delete id="deleteTemplateFieldByTemplateId">
+        delete from fs_physical_report_template_field where template_id = #{templateId}
+    </delete>
+</mapper>

+ 81 - 0
fs-service/src/main/resources/mapper/his/FsPhysicalReportTemplateMapper.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.his.mapper.FsPhysicalReportTemplateMapper">
+    
+    <resultMap type="FsPhysicalReportTemplate" id="FsPhysicalReportTemplateResult">
+        <result property="id"    column="id"    />
+        <result property="templateName"    column="template_name"    />
+        <result property="remark"    column="remark"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="status"    column="status"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateBy"    column="update_by"    />
+    </resultMap>
+
+    <sql id="selectFsPhysicalReportTemplateVo">
+        select id, template_name, remark, create_time, update_time, status, create_by, update_by from fs_physical_report_template
+    </sql>
+
+    <select id="selectFsPhysicalReportTemplateList" parameterType="FsPhysicalReportTemplate" resultMap="FsPhysicalReportTemplateResult">
+        <include refid="selectFsPhysicalReportTemplateVo"/>
+        <where>  
+            <if test="templateName != null  and templateName != ''"> and template_name like concat('%', #{templateName}, '%')</if>
+            <if test="status != null "> and status = #{status}</if>
+        </where>
+    </select>
+    
+    <select id="selectFsPhysicalReportTemplateById" parameterType="String" resultMap="FsPhysicalReportTemplateResult">
+        <include refid="selectFsPhysicalReportTemplateVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertFsPhysicalReportTemplate" parameterType="FsPhysicalReportTemplate" useGeneratedKeys="true" keyProperty="id">
+        insert into fs_physical_report_template
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="templateName != null and templateName != ''">template_name,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="status != null">status,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="templateName != null and templateName != ''">#{templateName},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="status != null">#{status},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsPhysicalReportTemplate" parameterType="FsPhysicalReportTemplate">
+        update fs_physical_report_template
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="templateName != null and templateName != ''">template_name = #{templateName},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteFsPhysicalReportTemplateById" parameterType="String">
+        delete from fs_physical_report_template where id = #{id}
+    </delete>
+
+    <delete id="deleteFsPhysicalReportTemplateByIds" parameterType="String">
+        delete from fs_physical_report_template where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 6 - 1
fs-service/src/main/resources/mapper/his/FsStoreOrderDfMapper.xml

@@ -17,10 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="status"    column="status"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
+        <result property="failMsg"    column="fail_msg"    />
     </resultMap>
 
     <sql id="selectFsStoreOrderDfVo">
-        select order_id, order_code, app_key, app_secret, login_account, monthly_card, express_product_code,total_price, platform_price, status, create_time, update_time from fs_store_order_df
+        select order_id, order_code, app_key, app_secret, login_account, monthly_card, express_product_code,total_price, platform_price, status, create_time, update_time,fail_msg from fs_store_order_df
     </sql>
 
     <select id="selectFsStoreOrderDfList" parameterType="FsStoreOrderDf" resultMap="FsStoreOrderDfResult">
@@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalPrice != null "> and total_price = #{totalPrice}</if>
             <if test="platformPrice != null "> and platform_price = #{platformPrice}</if>
             <if test="status != null "> and status = #{status}</if>
+            <if test="failMsg != null and failMsg != ''"> and fail_msg like concat(#{failMsg},'%')</if>
         </where>
     </select>
 
@@ -58,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null">status,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
+            <if test="failMsg != null">fail_msg,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderId != null">#{orderId},</if>
@@ -72,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null">#{status},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
+            <if test="failMsg != null">#{failMsg},</if>
          </trim>
     </insert>
 
@@ -89,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null">status = #{status},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="failMsg != null and failMsg != ''">fail_msg = #{failMsg},</if>
         </trim>
         where order_id = #{orderId}
     </update>

+ 268 - 7
fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml

@@ -530,6 +530,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="maps.storeId != null ">
             and so.store_id = #{maps.storeId}
         </if>
+        <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
+            and so.order_code in
+            <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
+                #{orderCode}
+            </foreach>
+        </if>
         <if test="maps.orderCode != null and maps.orderCode != ''">
             and so.order_code = #{maps.orderCode}
         </if>
@@ -548,15 +554,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="maps.isFirst != null ">
             and so.is_first = #{maps.isFirst}
         </if>
-        <if test="maps.status != null  and maps.status != 5">
+        <if test="maps.status != null  and maps.status != 6">
             and so.status = #{maps.status}
         </if>
-        <if test="maps.status == 5">
+        <if test="maps.status == 6">
             and so.`status`= 2
             and (
             so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1)
             )
-            and  so.extend_order_id is null
+            and  (so.extend_order_id is null or so.extend_order_id like '')
         </if>
         <if test="maps.deliverySn != null and maps.deliverySn != ''">
             and so.delivery_sn = #{maps.deliverySn}
@@ -612,6 +618,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="maps.companyUserNickName != null and maps.companyUserNickName !='' ">
             and cu.nick_name like concat( #{maps.companyUserNickName}, '%')
         </if>
+        <if test="maps.companyIds != null and  maps.companyIds.size >0">
+            and so.company_id in
+            <foreach collection="maps.companyIds" item="companyId" open="(" close=")" separator=",">
+                #{companyId}
+            </foreach>
+        </if>
         <if test='maps.companyId != null and maps.companyId != "-1" '>
             and so.company_id = #{maps.companyId}
         </if>
@@ -678,6 +690,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 #{item}
             </foreach>
         </if>
+        <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
+            and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')
+        </if>
         ${maps.params.dataScope}
     </select>
     <select id="selectFsStoreOrderByOrderIdIn" resultType="com.fs.his.domain.FsStoreOrder">
@@ -709,6 +724,220 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.storeId != null">
                 and so.store_id = #{maps.storeId}
             </if>
+            <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
+                and so.order_code in
+                <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
+                    #{orderCode}
+                </foreach>
+            </if>
+            <if test="maps.orderCode != null  and maps.orderCode != ''">
+                and so.order_code = #{maps.orderCode}
+            </if>
+            <if test="maps.prescribeCode != null  and maps.prescribeCode != ''">
+                and p.prescribe_code = #{maps.prescribeCode}
+            </if>
+            <if test="maps.userName != null  and maps.userName != ''">
+                and so.user_name like concat('%', #{maps.userName}, '%')
+            </if>
+            <if test="maps.userPhone != null  and maps.userPhone != ''">
+                and so.user_phone = #{maps.userPhone}
+            </if>
+            <if test="maps.userId != null ">
+                and so.user_id = #{maps.userId}
+            </if>
+            <if test="maps.isFirst != null">
+                and so.is_first = #{maps.isFirst}
+            </if>
+            <if test="maps.status != null and maps.status != 6">
+                and so.status = #{maps.status}
+            </if>
+            <if test="maps.status == 6">
+                and so.`status`= 2
+                and (
+                so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1)
+                )
+                and  (so.extend_order_id is null or  so.extend_order_id like '')
+            </if>
+            <if test="maps.source != null">
+                and so.source = #{maps.source}
+            </if>
+            <if test="maps.deliverySn != null  and maps.deliverySn != ''">
+                and so.delivery_sn = #{maps.deliverySn}
+            </if>
+            <if test="maps.prescribeId != null">
+                and so.prescribe_id = #{maps.prescribeId}
+            </if>
+            <if test="maps.companyUserId != null">
+                and so.company_user_id = #{maps.companyUserId}
+            </if>
+            <if test="maps.sTime != null">
+                and DATE(so.create_time) &gt;= DATE(#{maps.sTime})
+            </if>
+            <if test="maps.eTime != null">
+                and DATE(so.create_time) &lt;= DATE(#{maps.eTime})
+            </if>
+            <if test="maps.paysTime != null">
+                and DATE(so.pay_time) &gt;= DATE(#{maps.paysTime})
+            </if>
+            <if test="maps.payeTime != null">
+                and DATE(so.pay_time) &lt;= DATE(#{maps.payeTime})
+            </if>
+            <if test="maps.orderCreateType != null">
+                and so.order_create_type = #{maps.orderCreateType}
+            </if>
+            <if test="maps.patientName != null">
+                and p.patient_name like concat('%', #{maps.patientName}, '%')
+            </if>
+            <if test="maps.doctorName != null">
+                and d.doctor_name like concat('%', #{maps.doctorName}, '%')
+            </if>
+            <if test="maps.orderType != null">
+                and so.order_type = #{maps.orderType}
+            </if>
+            <if test="maps.deliverySendsTime != null">
+                and DATE(so.delivery_send_time) &gt;= DATE(#{maps.deliverySendsTime})
+            </if>
+            <if test="maps.deliverySendeTime != null">
+                and DATE(so.delivery_send_time) &lt;= DATE(#{maps.deliverySendeTime})
+            </if>
+            <if test="maps.deliveryImportsTime != null">
+                and DATE(so.delivery_import_time) &gt;= DATE(#{maps.deliveryImportsTime})
+            </if>
+            <if test="maps.deliveryImporteTime != null">
+                and DATE(so.delivery_import_time) &lt;= DATE(#{maps.deliveryImporteTime})
+            </if>
+            <if test="maps.tuisTime != null">
+                and DATE(so.tui_money_time) &gt;= DATE(#{maps.tuisTime})
+            </if>
+            <if test="maps.tuieTime != null">
+                and DATE(so.tui_money_time) &lt;= DATE(#{maps.tuieTime})
+            </if>
+            <if test="maps.companyUserNickName != null and  maps.companyUserNickName !=''">
+                and cu.nick_name like concat( #{maps.companyUserNickName}, '%')
+            </if>
+            <if test="maps.companyIds != null and  maps.companyIds.size >0">
+                and so.company_id in
+                <foreach collection="maps.companyIds" item="companyId" open="(" close=")" separator=",">
+                    #{companyId}
+                </foreach>
+            </if>
+            <if test="maps.companyId != null and  maps.companyId != -1">
+                and so.company_id =#{maps.companyId}
+            </if>
+            <if test="maps.companyId == -1">
+                and so.company_id is null
+            </if>
+            <if test="maps.deliveryStatus != null">
+                and so.delivery_status =#{maps.deliveryStatus}
+            </if>
+            <if test="maps.customerId != null">
+                and so.customer_id =#{maps.customerId}
+            </if>
+            <if test="maps.deliveryPayStatus != null">
+                and so.delivery_pay_status =#{maps.deliveryPayStatus}
+            </if>
+            <if test="maps.tuiMoneyStatus != null">
+                and so.tui_money_status =#{maps.tuiMoneyStatus}
+            </if>
+            <if test="maps.deptId != null">
+                AND (so.dept_id = #{maps.deptId} OR so.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
+            </if>
+            <if test="maps.packageName != null and maps.packageName != ''">
+                and so.package_name like concat('%', #{maps.packageName}, '%')
+            </if>
+            <if test="maps.payType != null">
+                and so.pay_type IN
+                <foreach collection="maps.payType.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.scheduleId != null  and  maps.scheduleId != -1">
+                and so.schedule_id IN
+                <foreach collection="maps.scheduleId.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.scheduleId == -1">
+                and so.schedule_id is null
+            </if>
+            <if test="maps.orderBuyType != null and maps.orderBuyType != -1">
+                and so.order_buy_type IN
+                <foreach collection="maps.orderBuyType.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.orderBuyType == -1">
+                and so.order_buy_type is null
+            </if>
+            <if test="maps.orderChannel == -1">
+                and so.order_channel is null
+            </if>
+            <if test="maps.orderChannel != null and maps.orderChannel != -1">
+                and so.order_channel IN
+                <foreach collection="maps.orderChannel.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.qwSubject == -1">
+                and so.qw_subject is null
+            </if>
+            <if test="maps.qwSubject != null and maps.qwSubject != -1">
+                and so.qw_subject IN
+                <foreach collection="maps.qwSubject.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
+                and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')
+            </if>
+
+        </where>
+
+        ORDER BY
+
+        <if test="maps.sortField == 'companyUserName'">
+            cu.nick_name
+        </if>
+        <if test="maps.sortField == 'packageName'">
+            so.package_name
+        </if>
+        <if test="maps.sortField == 'payPrice'">
+            so.pay_price
+        </if>
+        <if test="maps.sortField == 'payMoney'">
+            so.pay_money
+        </if>
+        <if test="maps.sortOrder != null and maps.sortOrder != ''">
+            ${maps.sortOrder}
+        </if>
+        <if test="maps.sortField == null or maps.sortField == ''">
+            so.order_id desc
+        </if>
+        ${maps.params.dataScope}
+    </select>
+    <select id="selectFsStoreOrderListVOByErpAccount" resultType="com.fs.his.vo.FsStoreOrderListVO">
+        select so.*,st.store_name,us.nick_name,us.phone,d.doctor_name,p.patient_name,p.prescribe_code,c.company_name,
+        cu.nick_name company_user_name
+        FROM fs_store_order so LEFT JOIN fs_store st ON so.store_id =st.store_id
+        LEFT JOIN fs_user us ON us.user_id=so.user_id
+        LEFT JOIN fs_prescribe p ON p.prescribe_id =so.prescribe_id
+        LEFT JOIN fs_doctor d ON so.doctor_id= d.doctor_id
+        LEFT JOIN company c on c.company_id =so.company_id
+        LEFT JOIN company_user cu on cu.user_id=so.company_user_id
+        LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
+        <where>
+            <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
+                and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')
+            </if>
+            <if test="maps.storeId != null">
+                and so.store_id = #{maps.storeId}
+            </if>
+            <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
+                and so.order_code in
+                <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
+                    #{orderCode}
+                </foreach>
+            </if>
             <if test="maps.orderCode != null  and maps.orderCode != ''">
                 and so.order_code = #{maps.orderCode}
             </if>
@@ -727,15 +956,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.isFirst != null">
                 and so.is_first = #{maps.isFirst}
             </if>
-            <if test="maps.status != null and maps.status != 5">
+            <if test="maps.status != null and maps.status != 6">
                 and so.status = #{maps.status}
             </if>
-            <if test="maps.status == 5">
+            <if test="maps.status == 6">
                 and so.`status`= 2
                 and (
                 so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1)
                 )
-                and  so.extend_order_id is null
+                and  (so.extend_order_id is null or  so.extend_order_id like '')
             </if>
             <if test="maps.source != null">
                 and so.source = #{maps.source}
@@ -794,6 +1023,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.companyUserNickName != null and  maps.companyUserNickName !=''">
                 and cu.nick_name like concat( #{maps.companyUserNickName}, '%')
             </if>
+            <if test="maps.companyIds != null and  maps.companyIds.size >0">
+                and so.company_id in
+                <foreach collection="maps.companyIds" item="companyId" open="(" close=")" separator=",">
+                    #{companyId}
+                </foreach>
+            </if>
             <if test="maps.companyId != null and  maps.companyId != -1">
                 and so.company_id =#{maps.companyId}
             </if>
@@ -860,9 +1095,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{item}
                 </foreach>
             </if>
+            <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
+                and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')
+            </if>
+            <if test="maps.erpAccount != null and maps.erpAccount != ''">
+                and df.login_account like #{maps.erpAccount}
+            </if>
 
         </where>
+
+        ORDER BY
+
+        <if test="maps.sortField == 'companyUserName'">
+            cu.nick_name
+        </if>
+        <if test="maps.sortField == 'packageName'">
+            so.package_name
+        </if>
+        <if test="maps.sortField == 'payPrice'">
+            so.pay_price
+        </if>
+        <if test="maps.sortField == 'payMoney'">
+            so.pay_money
+        </if>
+        <if test="maps.sortOrder != null and maps.sortOrder != ''">
+            ${maps.sortOrder}
+        </if>
+        <if test="maps.sortField == null or maps.sortField == ''">
+            so.order_id desc
+        </if>
         ${maps.params.dataScope}
-        ORDER BY so.order_id desc
     </select>
 </mapper>

+ 4 - 0
fs-service/src/main/resources/mapper/his/FsStoreProductAttrValueMapper.xml

@@ -134,4 +134,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
 
+    <select id="getFsStoreProductAttrValueListInProductId" resultType="com.fs.his.domain.FsStoreProductAttrValue">
+        select *,cost_price AS cost from fs_store_product_attr_value where product_id IN <foreach collection="productIds" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
+    </select>
+
 </mapper>

+ 10 - 1
fs-service/src/main/resources/mapper/his/FsStoreProductMapper.xml

@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectFsStoreProductVo">
-        select product_id,is_prescribe,is_drug, store_id, img_url, images, product_name, product_introduce, keyword, bar_code, cate_id, price, ot_price, unit_name, sort, sales, stock, is_show, is_hot, is_benefit, is_best, is_new, `desc`, create_time, update_time, is_postage, is_del, give_integral, cost_price, views, code_url, spec_type, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name, is_display, temp_id from fs_store_product
+        select product_id,is_prescribe,is_drug, store_id, img_url, images, product_name, product_introduce, keyword, bar_code, cate_id, price, ot_price, unit_name, sort, sales, stock, is_show, is_hot, is_benefit, is_best, is_new, `desc`, create_time, update_time, is_postage, is_del, give_integral, cost_price, views, code_url, spec_type, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name, is_display, temp_id,brand from fs_store_product
     </sql>
 
     <select id="selectFsStoreProductList" parameterType="FsStoreProduct" resultMap="FsStoreProductResult">
@@ -140,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tempId != null">temp_id,</if>
             <if test="isPrescribe != null">is_prescribe,</if>
             <if test="isDrug != null">is_drug,</if>
+            <if test="brand != null">brand,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="storeId != null">#{storeId},</if>
@@ -180,6 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tempId != null">#{tempId},</if>
             <if test="isPrescribe != null">#{isPrescribe},</if>
             <if test="isDrug != null">#{isDrug},</if>
+            <if test="brand != null">#{brand},</if>
          </trim>
     </insert>
 
@@ -238,4 +240,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{productId}
         </foreach>
     </delete>
+
+    <select id="getStoreProductInProductIds" resultType="com.fs.his.domain.FsStoreProduct">
+        <include refid="selectFsStoreProductVo"/>
+        where product_id IN <foreach collection="productIds" index="index" item="item" open="(" separator="," close=")">
+        #{item}
+    </foreach>
+    </select>
 </mapper>

+ 9 - 0
fs-store/src/main/java/com/fs/store/controller/store/FsStoreOrderController.java

@@ -68,6 +68,11 @@ public class FsStoreOrderController extends BaseController
     @Autowired
     @Qualifier("wdtErpOrderServiceImpl")
     private IErpOrderService wdtOrderService;
+
+    @Autowired
+    @Qualifier("JSTErpOrderServiceImpl")
+    private IErpOrderService jSTOrderService;
+
     /**
      * 查询订单列表
      */
@@ -343,7 +348,11 @@ public class FsStoreOrderController extends BaseController
                 } else if (erpType == 2){
                     //旺店通
                     erpOrderService =  wdtOrderService;
+                }else if (erpType == 5){
+                    //聚水潭
+                    erpOrderService =  jSTOrderService;
                 }
+
                 return erpOrderService;