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

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

三七 1 день назад
Родитель
Сommit
7af57eceb4

+ 29 - 1
fs-company/src/main/java/com/fs/company/controller/qw/FsCompanyCustomerController.java

@@ -1,5 +1,6 @@
 package com.fs.company.controller.qw;
 
+import com.alibaba.fastjson.JSON;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
@@ -13,6 +14,7 @@ import com.fs.framework.security.LoginUser;
 import com.fs.framework.security.SecurityUtils;
 import com.fs.his.domain.FsDoctorPatient;
 import com.fs.his.domain.FsPrescribe;
+import com.fs.his.dto.AddressInfoDTO;
 import com.fs.his.param.CollectionPhoneParam;
 import com.fs.his.param.PrescribePhoneParam;
 import com.fs.his.service.IFsDoctorPatientService;
@@ -66,7 +68,7 @@ public class FsCompanyCustomerController extends BaseController {
     private IFsDoctorPatientService fsDoctorPatientService;
 
     @Autowired
-    private FsUserInformationCollectionServiceImpl informationCollectionService;
+    private IFsUserInformationCollectionService informationCollectionService;
 
     /**
      * 查询客户列表
@@ -296,4 +298,30 @@ public class FsCompanyCustomerController extends BaseController {
         String appId="wx50bcb040b4963a7e";
         return informationCollectionService.getCustomerGenerateQRCode(orderId,appId);
     }
+
+    @GetMapping(value = "/getAddress")
+    public AjaxResult getAddress(@RequestParam("address") String address)
+    {
+        String kdnAddress = fsCompanyCustomerService.getKdnAddress(address);
+
+        AddressInfoDTO addressInfoDTO = JSON.parseObject(kdnAddress, AddressInfoDTO.class);
+        if (!addressInfoDTO.isSuccess()) {
+            return AjaxResult.error(addressInfoDTO.getReason());
+        }
+        AddressInfoDTO.AddressData data = addressInfoDTO.getData();
+        logger.info("快递鸟返回{}:",kdnAddress);
+        if (data==null){
+            return AjaxResult.error("解析地址失败请输入正确地址");
+        }
+        String provinceName = data.getProvinceName();
+        if (!provinceName.contains("省") && !provinceName.contains("区")){
+            data.setProvinceName(data.getProvinceName()+"市");
+            if (data.getExpAreaName().contains("县")){
+                data.setCityName("县");
+            }else {
+                data.setCityName("市辖区");
+            }
+        }
+        return AjaxResult.success(addressInfoDTO);
+    }
 }

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

@@ -459,6 +459,13 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
     @Override
     @Transactional
     public R addOrEdit(FsStoreProductAddEditParam param) {
+        if (param.getValues() != null) {
+            for (FsStoreProductAttrValue value : param.getValues()) {
+                if (value.getMinPrice() == null) {
+                    value.setMinPrice(BigDecimal.ZERO);
+                }
+            }
+        }
         ProductAttrCountDTO countDto = computedProductCount(param.getValues());
         FsSysConfig sysConfig = configUtil.getSysConfig();
         Integer erpOpen = sysConfig.getErpOpen();

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsCompanyCustomerOrderParam.java

@@ -20,6 +20,11 @@ public class FsCompanyCustomerOrderParam extends BaseEntity implements Serializa
      * */
     private String productName;
 
+    /**
+     * 订单号
+     * */
+    private String orderCode;
+
     //分页相关
     private Integer pageNum;
     private Integer pageSize;

+ 2 - 0
fs-service/src/main/java/com/fs/qw/service/IFsCompanyCustomerService.java

@@ -37,4 +37,6 @@ public interface IFsCompanyCustomerService {
 
     //查询客户订单列表
     List<FsStoreOrderVO> selectStoreOrderScrmByCompanyCustomerParam(FsCompanyCustomerOrderParam param);
+
+    String getKdnAddress(String address);
 }

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

@@ -1,14 +1,19 @@
 package com.fs.qw.service.impl;
 
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONUtil;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.CompanyDept;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.mapper.CompanyDeptMapper;
 import com.fs.his.domain.FsImportMember;
 import com.fs.his.mapper.FsImportMemberMapper;
+import com.fs.his.service.IFsUserAddressService;
 import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
 import com.fs.hisStore.param.FsCompanyCustomerOrderParam;
+import com.fs.hisStore.vo.FsStoreOrderItemVO;
 import com.fs.hisStore.vo.FsStoreOrderVO;
 import com.fs.qw.domain.FsCompanyCustomer;
 import com.fs.qw.domain.FsCompanyCustomerLog;
@@ -56,6 +61,9 @@ public class FsCompanyCustomerServiceImpl implements IFsCompanyCustomerService {
     @Autowired
     private FsCompanyExternalPayReceiptMapper externalPayReceiptMapper;
 
+    @Autowired
+    private IFsUserAddressService fsUserAddressService;
+
     @Override
     public FsCompanyCustomer selectFsCompanyCustomerById(Long id) {
         return fsCompanyCustomerMapper.selectFsCompanyCustomerById(id);
@@ -221,6 +229,23 @@ public class FsCompanyCustomerServiceImpl implements IFsCompanyCustomerService {
         if (CollectionUtils.isEmpty(fsStoreOrderVOS)){
             return Collections.emptyList();
         }
+        for (FsStoreOrderVO vo : fsStoreOrderVOS) {
+            String maskedNumber = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2");
+            vo.setPhone(maskedNumber);
+            vo.setUserPhone(maskedNumber);
+            if (StringUtils.isNotEmpty(vo.getItemJson())) {
+                JSONArray jsonArray = JSONUtil.parseArray(vo.getItemJson());
+                List<FsStoreOrderItemVO> items = JSONUtil.toList(jsonArray, FsStoreOrderItemVO.class);
+                if (!items.isEmpty()) {
+                    vo.setItems(items);
+                }
+            }
+        }
         return fsStoreOrderVOS;
     }
+
+    @Override
+    public String getKdnAddress(String address) {
+        return fsUserAddressService.getKdnAddress(address);
+    }
 }

+ 13 - 4
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -1145,8 +1145,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
 
-    <select id="selectStoreOrderScrmByCompanyCustomerParam" parameterType="com.fs.hisStore.param.FsCompanyCustomerOrderParam" resultType="com.fs.hisStore.vo.FsStoreOrderVO">
-        select o.*, u.phone, u.register_code, u.register_date, u.source,
+    <select id="selectStoreOrderScrmByCompanyCustomerParam" resultType="com.fs.hisStore.vo.FsStoreOrderVO">
+        select distinct o.*, u.phone, u.register_code, u.register_date, u.source,
         c.company_name,
         cu.nick_name as company_user_nick_name,
         cu.phonenumber as company_usere_phonenumber
@@ -1155,10 +1155,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join company c on c.company_id = o.company_id
         left join company_user cu on cu.user_id = o.company_user_id
         <where>
-            company_customer_id = #{maps.companyCustomerId}
+            o.company_customer_id = #{maps.companyCustomerId}
+            <if test="maps.orderCode != null and maps.orderCode != ''">
+                and o.order_code = #{maps.orderCode}
+            </if>
             <if test="maps.productName != null and maps.productName != ''">
-                and fsp.product_name like concat('%', #{maps.productName}, '%')
+                and exists (
+                select 1 from fs_store_order_item_scrm oi
+                left join fs_store_product_scrm p on oi.product_id = p.product_id
+                where oi.order_id = o.id
+                and p.product_name like concat('%', #{maps.productName}, '%')
+                )
             </if>
         </where>
+        order by o.create_time desc
     </select>
 </mapper>