Просмотр исходного кода

商城订单增加手写信息采集表主键字段

cgp 1 день назад
Родитель
Сommit
010ad46667

+ 10 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsStoreProductScrmController.java

@@ -3,6 +3,7 @@ package com.fs.hisStore.controller;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.utils.StringUtils;
 import com.fs.framework.security.SecurityUtils;
 import com.fs.hisStore.domain.FsStoreProductAttrValueScrm;
 import com.fs.hisStore.domain.FsStoreProductScrm;
@@ -68,4 +69,13 @@ public class FsStoreProductScrmController extends BaseController
         return getDataTable(list);
     }
 
+    @GetMapping("/getProductMedicineFlagByOrderCode/{orderCode}")
+    public R getProductMedicineFlagByOrderCode(@PathVariable("orderCode") String orderCode)
+    {
+        if (StringUtils.isBlank(orderCode)){
+            return R.error("订单号不能为空");
+        }
+        return R.ok().put("flag",fsStoreProductService.getProductMedicineFlagByOrderCode(orderCode));
+    }
+
 }

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreOrderScrm.java

@@ -375,4 +375,9 @@ public class FsStoreOrderScrm extends BaseEntity
 
     //患者信息id
     private Long companyCustomerId;
+
+    /**
+     * 手写信息采集表(fs_handwrite_collection)的主键id
+     * */
+    private Long handleCollectionId;
 }

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

@@ -142,4 +142,11 @@ public interface IFsStoreProductScrmService
     List<FsStoreProductScrm> getStoreProductInProductIds(List<Long> storeProductIds);
 
     List<OptionsVO> selectProductOptions();
+
+    /**
+     *  获取商品是否为医保商品
+     *  @param orderCode 订单编号
+     *  @return true:是药品/false:非药品
+     * */
+    Boolean getProductMedicineFlagByOrderCode(String orderCode);
 }

+ 30 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -21,6 +21,8 @@ import com.fs.config.cloud.CloudHostProper;
 import com.fs.erp.domain.ErpGoods;
 import com.fs.erp.service.IErpGoodsService;
 import com.fs.his.config.FsSysConfig;
+import com.fs.his.domain.FsStoreProduct;
+import com.fs.his.mapper.FsStoreProductMapper;
 import com.fs.his.param.FsStoreProductListSParam;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.his.vo.FsStoreProductExcelVO;
@@ -46,6 +48,7 @@ import org.springframework.stereotype.Service;
 import com.fs.hisStore.service.IFsStoreProductScrmService;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
 /**
  * 商品Service业务层处理
@@ -98,6 +101,12 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Autowired
     private CloudHostProper cloudHostProper;
 
+    @Autowired
+    private FsStoreOrderItemScrmMapper itemScrmMapper;
+
+    @Autowired
+    private FsStoreProductMapper storeProductMapper;
+
     /**
      * 查询商品
      *
@@ -1157,4 +1166,25 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     public List<OptionsVO> selectProductOptions() {
         return fsStoreProductMapper.selectProductOptions();
     }
+
+    @Override
+    public Boolean getProductMedicineFlagByOrderCode(String orderCode) {
+        FsStoreOrderItemScrm queryCondition=new FsStoreOrderItemScrm();
+        queryCondition.setOrderCode(orderCode);
+        List<FsStoreOrderItemScrm> fsStoreOrderItemScrms = itemScrmMapper.selectFsStoreOrderItemList(queryCondition);
+        if (CollectionUtils.isEmpty(fsStoreOrderItemScrms)){
+            return false;
+        }
+        //收集商品ID
+        List<Long> productIds=fsStoreOrderItemScrms.stream().map(FsStoreOrderItemScrm::getProductId).collect(Collectors.toList());
+        //批量查询商品列表信息
+        List<FsStoreProduct> storeProductInProductIds = storeProductMapper.getStoreProductInProductIds(productIds);
+        //遍历产品信息,只要有一个含有药品标识(isDrug=1),则返回true
+        for (FsStoreProduct storeProduct : storeProductInProductIds) {
+            if (1==storeProduct.getIsDrug()){
+                return true;
+            }
+        }
+        return false;
+    }
 }

+ 6 - 1
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -97,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="erpType"    column="erp_type"    />
         <result property="appRewardFlag"    column="app_reward_flag"    />
         <result property="companyCustomerId" column="company_customer_id" />
+        <result property="handleCollectionId" column="handle_collection_id" />
     </resultMap>
 
     <sql id="selectFsStoreOrderVo">
@@ -111,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                company_id,company_user_id,is_package,package_json,item_json,order_type,package_id,finish_time,delivery_status,
                delivery_pay_status,delivery_time,delivery_pay_time,delivery_pay_money,tui_money,tui_money_status,delivery_import_time,
                tui_user_id,tui_user_money_status,order_create_type,store_house_code,dept_id,is_edit_money,customer_id,is_pay_remain,
-               delivery_send_time,certificates,schedule_id,div_amount, div_huifu_id,zyy_div_amount,zyy_huifu_id,tag_names,erp_type,app_reward_flag,company_customer_id from fs_store_order_scrm
+               delivery_send_time,certificates,schedule_id,div_amount, div_huifu_id,zyy_div_amount,zyy_huifu_id,tag_names,erp_type,app_reward_flag,company_customer_id,handle_collection_id from fs_store_order_scrm
     </sql>
 
     <select id="selectFsStoreOrderList" parameterType="FsStoreOrderScrm" resultMap="FsStoreOrderResult">
@@ -172,6 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deliveryTime != null "> and delivery_time = #{deliveryTime}</if>
             <if test="deliveryImportTime != null "> and delivery_import_time = #{deliveryImportTime}</if>
             <if test="appRewardFlag != null "> and app_reward_flag = #{appRewardFlag}</if>
+            <if test="handleCollectionId != null "> and handle_collection_id = #{handleCollectionId}</if>
         </where>
     </select>
 
@@ -276,6 +278,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="erpType != null">erp_type,</if>
             <if test="appRewardFlag != null">app_reward_flag,</if>
             <if test="companyCustomerId != null"> company_customer_id,</if>
+            <if test="handleCollectionId != null"> handle_collection_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderCode != null and orderCode != ''">#{orderCode},</if>
@@ -370,6 +373,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="erpType != null">#{erpType},</if>
             <if test="appRewardFlag != null">#{appRewardFlag},</if>
             <if test="companyCustomerId != null">#{companyCustomerId},</if>
+            <if test="handleCollectionId != null">#{handleCollectionId},</if>
          </trim>
     </insert>
 
@@ -471,6 +475,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="erpType != null and erpType != ''">erp_type = #{erpType},</if>
             <if test="appRewardFlag != null and appRewardFlag != ''">app_reward_flag = #{appRewardFlag},</if>
             <if test="companyCustomerId != null "> company_customer_id = #{companyCustomerId},</if>
+            <if test="handleCollectionId != null "> handle_collection_id = #{handleCollectionId},</if>
         </trim>
         where id = #{id}
     </update>