xdd 1 місяць тому
батько
коміт
914714908b

+ 5 - 1
fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java

@@ -4,10 +4,12 @@ import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.utils.ParseUtils;
@@ -802,7 +804,9 @@ public class FsStoreOrderController extends BaseController
     public R getErpAccount()
     {
         List<DFConfigVo> erpAccounts = fsStoreOrderService.getErpAccount();
-        List<String> list = erpAccounts.stream().map(DFConfigVo::getLoginAccount).collect(Collectors.toList());
+        List<String> list = erpAccounts.stream()
+                .filter(e-> ObjectUtils.isNotNull(e) && ObjectUtils.isNotNull(e.getLoginAccount()))
+                .map(DFConfigVo::getLoginAccount).collect(Collectors.toList());
         return R.ok().put("data", list);
     }
 }

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

@@ -64,32 +64,7 @@ public interface FsPrescribeMapper
      * @return 结果
      */
     public int deleteFsPrescribeByPrescribeIds(Long[] prescribeIds);
-    @Select({"<script> " +
-            "select so.*,us.nick_name,dc.doctor_name,dp.doctor_name doctor_drug_name,fso.order_code,fso.`status` order_status,fse.store_name FROM fs_prescribe so  LEFT JOIN fs_user us ON us.user_id=so.user_id LEFT JOIN fs_doctor dc ON dc.doctor_id = so.doctor_id LEFT JOIN fs_doctor dp ON dp.doctor_id =so.drug_doctor_id LEFT JOIN fs_store_order fso ON fso.order_id = so.store_order_id LEFT JOIN fs_store fse ON fse.store_id = so.store_id "+
-            "<where>\n" +
-            "        <if test=\"companyId != null \"> and fso.company_id = #{companyId}</if>\n" +
-            "        <if test=\"companyUserId != null \"> and fso.company_user_id = #{companyUserId}</if>\n" +
-            "        <if test=\"prescribeType != null \"> and so.prescribe_type = #{prescribeType}</if>\n" +
-            "        <if test=\"inquiryOrderId != null \"> and so.inquiry_order_id = #{inquiryOrderId}</if>\n" +
-            "        <if test=\"storeOrderId != null \"> and so.store_order_id = #{storeOrderId}</if>\n" +
-            "        <if test=\"userId != null \"> and so.user_id = #{userId}</if>\n" +
-            "        <if test=\"prescribeCode != null  and prescribeCode != ''\"> and so.prescribe_code = #{prescribeCode}</if>\n" +
-            "        <if test=\"patientName != null  and patientName != ''\"> and so.patient_name like concat('%', #{patientName}, '%')</if>\n" +
-            "        <if test=\"doctorName != null  and doctorName != ''\"> and dc.doctor_name like concat('%', #{doctorName}, '%')</if>\n" +
-            "        <if test=\"patientTel != null  and patientTel != ''\"> and so.patient_tel = #{patientTel}</if>\n" +
-            "        <if test=\"doctorId != null  and doctorId != ''\"> and so.doctor_id = #{doctorId}</if>\n" +
-            "        <if test=\"status != null \"> and so.status = #{status}</if>\n" +
-            "        <if test=\"sTime != null \">  and DATE(so.create_time) &gt;= DATE(#{sTime})</if>\n" +
-            "        <if test=\"eTime != null \">  and DATE(so.create_time) &lt;= DATE(#{eTime})</if>\n" +
-            "        <if test=\"auditSTime != null \">  and DATE(so.audit_time) &gt;= DATE(#{auditSTime})</if>\n" +
-            "        <if test=\"auditETime != null \">  and DATE(so.audit_time) &lt;= DATE(#{auditETime})</if>\n" +
-            "        <if test=\"auditTime != null \"> and so.audit_time = #{auditTime}</if>\n" +
-            "        <if test=\"orderCode != null \"> and fso.order_code = #{orderCode}</if>\n" +
-            "        <if test=\"orderStatus != null \"> and fso.`status` = #{orderStatus}</if>\n" +
-            "        <if test=\"storeId != null \"> and so.store_id = #{storeId}</if>\n" +
-            "    </where>\n" +
-            "    order by prescribe_id desc"+
-            "</script>"})
+
     List<FsPrescribeListVO> selectFsPrescribeListVO(FsPrescribeParam fsPrescribe);
     @Select({"<script> " +
             "select p.*  from fs_prescribe p    " +

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

@@ -15,6 +15,5 @@ public class FsStoreOrderPayParam implements Serializable {
     String remark;
     Long userId;
     @ApiModelProperty(value = "payType")
-    @NotNull(message = "支付类型不能为空")
     private Integer payType;
 }

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

@@ -157,7 +157,7 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
 
     @Override
     public List<FsPrescribeListVO> selectFsPrescribeListVO(FsPrescribeParam fsPrescribe) {
-        return  fsPrescribeMapper.selectFsPrescribeListVO(fsPrescribe);
+        return fsPrescribeMapper.selectFsPrescribeListVO(fsPrescribe);
     }
 
     @Override

+ 4 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -566,7 +566,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
         }
         //中药总价处理
         if (prescribe.getPrescribeType().equals(2)) {
+
             FsPrescribeUsageDTO dto = JSONUtil.toBean(prescribe.getUsageJson(), FsPrescribeUsageDTO.class);
+            log.info("中药总价处理 dto: {},prescribe: {}",dto,prescribe);
             totalPrice = totalPrice.multiply(BigDecimal.valueOf(dto.getCounts()));
             totalNum = dto.getCounts();
             totalCostPrice = totalCostPrice.multiply(BigDecimal.valueOf(dto.getCounts()));
@@ -3386,11 +3388,11 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
         }
 
         // 如果订单状态不是待支付
-        if(ObjectUtils.notEqual(1L,fsStoreOrder.getStatus())) {
+        if(ObjectUtils.notEqual(1,fsStoreOrder.getStatus())) {
             throw new RuntimeException("当前订单状态不为待支付!");
         }
         // 修改支付金额
-        fsStoreOrder.setPayMoney(param.getPrice());
+        fsStoreOrder.setPayPrice(param.getPrice());
         // 是否改价
         fsStoreOrder.setIsEditMoney(1);
         // 订单备注

+ 26 - 0
fs-service/src/main/resources/mapper/his/FsPrescribeMapper.xml

@@ -305,4 +305,30 @@
         case when p.user_confirm=0 or p.user_confirm is null then 0 else 1 end,
         p.create_time desc
     </select>
+    <select id="selectFsPrescribeListVO" resultType="com.fs.his.vo.FsPrescribeListVO">
+        select so.*,us.nick_name,dc.doctor_name,dp.doctor_name doctor_drug_name,fso.order_code,fso.`status` order_status,fse.store_name FROM fs_prescribe so  LEFT JOIN fs_user us ON us.user_id=so.user_id LEFT JOIN fs_doctor dc ON dc.doctor_id = so.doctor_id LEFT JOIN fs_doctor dp ON dp.doctor_id =so.drug_doctor_id LEFT JOIN fs_store_order fso ON fso.order_id = so.store_order_id LEFT JOIN fs_store fse ON fse.store_id = so.store_id
+        <where>
+            <if test="companyId != null "> and fso.company_id = #{companyId}</if>
+            <if test="companyUserId != null "> and fso.company_user_id = #{companyUserId}</if>
+            <if test="prescribeType != null "> and so.prescribe_type = #{prescribeType}</if>
+            <if test="inquiryOrderId != null "> and so.inquiry_order_id = #{inquiryOrderId}</if>
+            <if test="storeOrderId != null "> and so.store_order_id = #{storeOrderId}</if>
+            <if test="userId != null "> and so.user_id = #{userId}</if>
+            <if test="prescribeCode != null  and prescribeCode != ''"> and so.prescribe_code = #{prescribeCode}</if>
+            <if test="patientName != null  and patientName != ''"> and so.patient_name like concat('%', #{patientName}, '%')</if>
+            <if test="doctorName != null  and doctorName != ''"> and dc.doctor_name like concat('%', #{doctorName}, '%')</if>
+            <if test="patientTel != null  and patientTel != ''"> and so.patient_tel = #{patientTel}</if>
+            <if test="doctorId != null  and doctorId != ''"> and so.doctor_id = #{doctorId}</if>
+            <if test="status != null "> and so.status = #{status}</if>
+            <if test="sTime != null ">  and DATE(so.create_time) &gt;= DATE(#{sTime})</if>
+            <if test="eTime != null ">  and DATE(so.create_time) &lt;= DATE(#{eTime})</if>
+            <if test="auditSTime != null ">  and DATE(so.audit_time) &gt;= DATE(#{auditSTime})</if>
+            <if test="auditETime != null ">  and DATE(so.audit_time) &lt;= DATE(#{auditETime})</if>
+            <if test="auditTime != null "> and so.audit_time = #{auditTime}</if>
+            <if test="orderCode != null "> and fso.order_code = #{orderCode}</if>
+            <if test="orderStatus != null and orderStatus!=''"> and fso.`status` = #{orderStatus}</if>
+            <if test="storeId != null "> and so.store_id = #{storeId}</if>
+        </where>
+        order by prescribe_id desc
+    </select>
 </mapper>

+ 2 - 6
fs-user-app/src/main/java/com/fs/app/controller/StoreOrderController.java

@@ -132,17 +132,13 @@ public class StoreOrderController extends  AppBaseController {
 
     @Login
     @PostMapping("/modifyStoreOrderPrice")
-    public R modifyStoreOrderPrice(ModifyStoreOrderPriceParam param){
+    public R modifyStoreOrderPrice(@RequestBody ModifyStoreOrderPriceParam param){
         log.info("销售修改订单价格 {}", param);
 
         if(ObjectUtil.isEmpty(param.getOrderId())){
             throw new IllegalArgumentException("订单号不能为空!");
         }
 
-        if(StringUtils.isBlank(param.getNote())){
-            throw new IllegalArgumentException("修改原因不能为空!");
-        }
-
         if(ObjectUtil.isEmpty(param.getPrice())) {
             throw new IllegalArgumentException("订单修改价格不能为空!");
         }
@@ -197,7 +193,7 @@ public class StoreOrderController extends  AppBaseController {
 
         String config=configService.selectConfigByKey("store.config");
         StoreConfig storeConfig= JSONUtil.toBean(config,StoreConfig.class);
-        // 普通这种
+        // 全款支付
         if(param.getPayType().equals(1)){
             order.setPayType(1);
             order.setPayMoney(order.getPayPrice());