|
|
@@ -2,6 +2,7 @@ package com.fs.hisStore.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.fs.common.exception.CustomException;
|
|
|
+import com.fs.common.exception.ServiceException;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.his.param.FsStoreAuditParam;
|
|
|
@@ -28,6 +29,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.beans.PropertyDescriptor;
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.ZoneId;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -200,7 +203,21 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService
|
|
|
@Transactional
|
|
|
public int updateFsStoreAudit(FsStoreAuditParam fsStore) {
|
|
|
|
|
|
- fsStoreMapper.updateFsStoreAudit(fsStore.getStoreId(),fsStore.getIsAudit());
|
|
|
+ FsStoreScrm fsStoreScrm=fsStoreMapper.selectFsStoreByStoreId(fsStore.getStoreId());
|
|
|
+ if(fsStoreScrm == null){
|
|
|
+ throw new ServiceException("操作失败,审核店铺数据不存在!");
|
|
|
+ }
|
|
|
+ FsStoreScrm updateStore=new FsStoreScrm();
|
|
|
+ updateStore.setStoreId(fsStore.getStoreId());
|
|
|
+ updateStore.setIsAudit(fsStore.getIsAudit());
|
|
|
+ if(fsStoreScrm.getStatus() == 0){
|
|
|
+ LocalDate today = LocalDate.now(ZoneId.of("Asia/Shanghai"));
|
|
|
+ if(fsStoreScrm.getBusinessLicenseExpireEnd().isAfter(today) && fsStoreScrm.getDrugLicenseExpiryEnd().isAfter(today)
|
|
|
+ && fsStoreScrm.getMedicalDevice2ExpiryEnd().isAfter(today) && fsStoreScrm.getMedicalLicenseExpiryEnd().isAfter(today)) {
|
|
|
+ updateStore.setStatus(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fsStoreMapper.updateFsStore(updateStore);
|
|
|
//更新日志
|
|
|
storeAuditLogUtil.addAudit(fsStore.getStoreId(),fsStore.getReason(),fsStore.getAttachImage());
|
|
|
return 1;
|
|
|
@@ -339,6 +356,18 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService
|
|
|
return fsStoreMapper.updateFsStore(updateStore);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void merchantQualificationExpiryCheck() {
|
|
|
+ log.info("定时任务店铺资质过期更新状态--------------------------start{}");
|
|
|
+ //获取资质过期商铺
|
|
|
+ List<Long> storeIds = fsStoreMapper.getStoreQualificationExpiredInfo();
|
|
|
+ if(!storeIds.isEmpty()){
|
|
|
+ //更新商铺状态】
|
|
|
+ fsStoreMapper.batchUpdateStoreStatusById(storeIds);
|
|
|
+ }
|
|
|
+ log.info("定时任务店铺资质过期更新状态--------------------------end{}");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取两个对象的所有差异字段(基于旧对象的所有字段,以新对象字段值为准进行对比)
|
|
|
* 只要新旧值不同就视为差异
|