Преглед изворни кода

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

fcw пре 1 месец
родитељ
комит
f13e75808d

+ 4 - 1
alien-entity/src/main/java/shop/alien/mapper/second/SecondEntrustUserMapper.java

@@ -58,9 +58,12 @@ public interface SecondEntrustUserMapper extends BaseMapper<SecondEntrustUser> {
             "where entrust_user_name = #{entrustUserName} " +
             "and entrust_id_card = #{entrustIdCard} " +
             "and delete_flag = 0 " +
+            "and id = #{id} " +
             "order by created_time desc")
     List<SecondEntrustUser> getByUserNameAndIdCard(@Param("entrustUserName") String entrustUserName, 
-                                                     @Param("entrustIdCard") String entrustIdCard);
+                                                     @Param("entrustIdCard") String entrustIdCard,
+                                                    @Param("id") Integer id
+    );
 
 }
 

+ 5 - 4
alien-second/src/main/java/shop/alien/second/controller/SecondEntrustUserController.java

@@ -188,13 +188,14 @@ public class SecondEntrustUserController {
     @ApiOperationSupport(order = 8)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "entrustUserName", value = "委托人姓名", dataType = "String", paramType = "query", required = true),
-            @ApiImplicitParam(name = "entrustIdCard", value = "委托人身份证号", dataType = "String", paramType = "query", required = true)
+            @ApiImplicitParam(name = "entrustIdCard", value = "委托人身份证号", dataType = "String", paramType = "query", required = true),
+            @ApiImplicitParam(name = "id", value = "id", dataType = "Integer", paramType = "query", required = true)
     })
     @GetMapping("/detail")
-    public R<SecondEntrustUserDetailVo> getEntrustUserDetail(@RequestParam String entrustUserName, @RequestParam String entrustIdCard) {
-        log.info("SecondEntrustUserController.getEntrustUserDetail entrustUserName={}, entrustIdCard={}", entrustUserName, entrustIdCard);
+    public R<SecondEntrustUserDetailVo> getEntrustUserDetail(@RequestParam String entrustUserName, @RequestParam String entrustIdCard, @RequestParam Integer id) {
+        log.info("SecondEntrustUserController.getEntrustUserDetail entrustUserName={}, entrustIdCard={},id={}", entrustUserName, entrustIdCard,id);
         try {
-            SecondEntrustUserDetailVo detailVo = secondEntrustUserService.getEntrustUserDetail(entrustUserName, entrustIdCard);
+            SecondEntrustUserDetailVo detailVo = secondEntrustUserService.getEntrustUserDetail(entrustUserName, entrustIdCard,id);
             return R.data(detailVo);
         } catch (Exception e) {
             log.error("SecondEntrustUserController.getEntrustUserDetail error: {}", e.getMessage(), e);

+ 1 - 1
alien-second/src/main/java/shop/alien/second/service/SecondEntrustUserService.java

@@ -84,7 +84,7 @@ public interface SecondEntrustUserService extends IService<SecondEntrustUser> {
      * @param entrustIdCard 委托人身份证号
      * @return 委托人详情
      */
-    SecondEntrustUserDetailVo getEntrustUserDetail(String entrustUserName, String entrustIdCard) throws Exception;
+    SecondEntrustUserDetailVo getEntrustUserDetail(String entrustUserName, String entrustIdCard,Integer id) throws Exception;
 
 }
 

+ 2 - 2
alien-second/src/main/java/shop/alien/second/service/impl/SecondEntrustUserServiceImpl.java

@@ -227,11 +227,11 @@ public class SecondEntrustUserServiceImpl extends ServiceImpl<SecondEntrustUserM
      * @return 委托人详情
      */
     @Override
-    public SecondEntrustUserDetailVo getEntrustUserDetail(String entrustUserName, String entrustIdCard) throws Exception {
+    public SecondEntrustUserDetailVo getEntrustUserDetail(String entrustUserName, String entrustIdCard,Integer id) throws Exception {
         log.info("SecondEntrustUserServiceImpl.getEntrustUserDetail entrustUserName={}, entrustIdCard={}", entrustUserName, entrustIdCard);
         try {
             // 1. 根据姓名和身份证号查询该人的所有委托记录
-            List<SecondEntrustUser> entrustUsers = secondEntrustUserMapper.getByUserNameAndIdCard(entrustUserName, entrustIdCard);
+            List<SecondEntrustUser> entrustUsers = secondEntrustUserMapper.getByUserNameAndIdCard(entrustUserName, entrustIdCard, id);
             
             if (entrustUsers == null || entrustUsers.isEmpty()) {
                 log.warn("委托人信息不存在, entrustUserName={}, entrustIdCard={}", entrustUserName, entrustIdCard);

+ 43 - 42
alien-store/src/main/java/shop/alien/store/service/impl/LicenseAuditAsyncService.java

@@ -126,47 +126,6 @@ public class LicenseAuditAsyncService {
             log.info("{}证照审核结果,门店ID:{},图片URL:{},is_valid={},expiry_date={},is_expired={},remaining_days={},license_type={}",
                     licenseTypeName, storeId, imageUrl, isValid, expiryDateStr, isExpired, remainingDays, licenseType);
 
-            // 如果是营业执照,解析并存入到期时间
-            if (licenseStatus == 1 && StringUtils.isNotEmpty(expiryDateStr)) {
-                try {
-                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-                    Date expiryDate = sdf.parse(expiryDateStr);
-
-                    StoreInfo updateStoreInfo = new StoreInfo();
-                    updateStoreInfo.setId(storeId);
-                    updateStoreInfo.setBusinessLicenseExpirationTime(expiryDate);
-
-                    // 同步更新门店到期时间(expirationTime)
-                    // 门店到期时间 = min(合同到期时间, 营业执照到期时间)
-                    // 由于合同到期时间未单独存储,需要根据旧值推断
-                    StoreInfo currentStore = storeInfoMapper.selectById(storeId);
-                    if (currentStore != null) {
-                        Date currentExpiration = currentStore.getExpirationTime();
-                        Date oldBizExpiration = currentStore.getBusinessLicenseExpirationTime();
-                        if (currentExpiration != null && oldBizExpiration != null
-                                && currentExpiration.before(oldBizExpiration)) {
-                            // 合同到期时间 < 旧营业执照到期时间,说明合同是瓶颈
-                            // 新的门店到期时间 = min(合同到期时间, 新营业执照到期时间)
-                            updateStoreInfo.setExpirationTime(
-                                    expiryDate.before(currentExpiration) ? expiryDate : currentExpiration
-                            );
-                        } else {
-                            // 营业执照是瓶颈(或两者相等、或旧值为空)
-                            // 直接用新的营业执照到期时间更新
-                            updateStoreInfo.setExpirationTime(expiryDate);
-                        }
-                    } else {
-                        updateStoreInfo.setExpirationTime(expiryDate);
-                    }
-
-                    storeInfoMapper.updateById(updateStoreInfo);
-                    log.info("营业执照到期时间已更新,门店ID:{},营业执照到期:{},门店到期:{}",
-                            storeId, expiryDateStr, updateStoreInfo.getExpirationTime());
-                } catch (Exception e) {
-                    log.error("解析营业执照到期时间失败,门店ID:{},expiryDate:{}", storeId, expiryDateStr, e);
-                }
-            }
-
             // 判断审核结果
             boolean needReject = false;
             boolean needApprove = false;
@@ -322,8 +281,50 @@ public class LicenseAuditAsyncService {
                     storeInfoMapper.update(null, new LambdaUpdateWrapper<StoreInfo>()
                             .eq(StoreInfo::getId, storeId)
                             .set(StoreInfo::getBusinessLicenseStatus, 1)
+                            .set(StoreInfo::getUpdateBusinessLicenseTime, new Date())
                     );
-                    
+
+                    // 审核通过后,解析并存入营业执照到期时间
+                    if (StringUtils.isNotEmpty(expiryDateStr)) {
+                        try {
+                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                            Date expiryDate = sdf.parse(expiryDateStr);
+
+                            StoreInfo updateStoreInfo = new StoreInfo();
+                            updateStoreInfo.setId(storeId);
+                            updateStoreInfo.setBusinessLicenseExpirationTime(expiryDate);
+
+                            // 同步更新门店到期时间(expirationTime)
+                            // 门店到期时间 = min(合同到期时间, 营业执照到期时间)
+                            // 由于合同到期时间未单独存储,需要根据旧值推断
+                            StoreInfo currentStore = storeInfoMapper.selectById(storeId);
+                            if (currentStore != null) {
+                                Date currentExpiration = currentStore.getExpirationTime();
+                                Date oldBizExpiration = currentStore.getBusinessLicenseExpirationTime();
+                                if (currentExpiration != null && oldBizExpiration != null
+                                        && currentExpiration.before(oldBizExpiration)) {
+                                    // 合同到期时间 < 旧营业执照到期时间,说明合同是瓶颈
+                                    // 新的门店到期时间 = min(合同到期时间, 新营业执照到期时间)
+                                    updateStoreInfo.setExpirationTime(
+                                            expiryDate.before(currentExpiration) ? expiryDate : currentExpiration
+                                    );
+                                } else {
+                                    // 营业执照是瓶颈(或两者相等、或旧值为空)
+                                    // 直接用新的营业执照到期时间更新
+                                    updateStoreInfo.setExpirationTime(expiryDate);
+                                }
+                            } else {
+                                updateStoreInfo.setExpirationTime(expiryDate);
+                            }
+
+                            storeInfoMapper.updateById(updateStoreInfo);
+                            log.info("营业执照到期时间已更新,门店ID:{},营业执照到期:{},门店到期:{}",
+                                    storeId, expiryDateStr, updateStoreInfo.getExpirationTime());
+                        } catch (Exception e) {
+                            log.error("解析营业执照到期时间失败,门店ID:{},expiryDate:{}", storeId, expiryDateStr, e);
+                        }
+                    }
+
                     // 审核通过后,先逻辑删除旧的营业执照记录
                     LambdaUpdateWrapper<StoreImg> deleteOldImgWrapper = new LambdaUpdateWrapper<>();
                     deleteOldImgWrapper.eq(StoreImg::getStoreId, storeId)

+ 2 - 2
alien-store/src/main/java/shop/alien/store/service/impl/LifeUserLearningVideoServiceImpl.java

@@ -24,8 +24,8 @@ public class LifeUserLearningVideoServiceImpl extends ServiceImpl<LifeUserLearni
     @Override
     public R<String> add(LifeUserLearningVideo lifeUserLearningVideo) throws IOException, InterruptedException {
         log.info("LifeUserLearningVideoServiceImpl.add, param={}", lifeUserLearningVideo);
-        long videoDuration = VideoDurationFFmpeg.getVideoDuration(lifeUserLearningVideo.getVideoUrl());
-        lifeUserLearningVideo.setVideoDuration(String.valueOf(videoDuration));
+//        long videoDuration = VideoDurationFFmpeg.getVideoDuration(lifeUserLearningVideo.getVideoUrl());
+        lifeUserLearningVideo.setVideoDuration(String.valueOf(lifeUserLearningVideo.getVideoDuration()));
         boolean result = this.save(lifeUserLearningVideo);
         if (result) {
             return R.success("新增成功");