|
|
@@ -6,7 +6,9 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
+import shop.alien.entity.second.vo.StoreImgDTO;
|
|
|
import shop.alien.entity.store.*;
|
|
|
+import shop.alien.entity.store.vo.StoreImgVo;
|
|
|
import shop.alien.entity.storePlatform.vo.StoreLicenseHistoryDto;
|
|
|
import shop.alien.entity.storePlatform.vo.StoreLicenseHistoryVO;
|
|
|
import shop.alien.entity.storePlatform.StoreLicenseHistory;
|
|
|
@@ -95,11 +97,29 @@ public class LicenseServiceImpl implements LicenseService {
|
|
|
* @return 合同图片列表
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<StoreImg> getContractList (Integer id) {
|
|
|
- // 查询图片类型为15(合同)的图片列表
|
|
|
- return storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
|
|
|
+ public List<StoreImgDTO> getContractList (Integer id) {
|
|
|
+
|
|
|
+
|
|
|
+ StoreInfo storeInfo = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo::getId, id));
|
|
|
+
|
|
|
+
|
|
|
+ log.info("getEntertainmentLicenseList - 查询商户ID为 {} 的娱乐经营许可证图片列表", id);
|
|
|
+ List<StoreImg> storeImgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
|
|
|
.eq(StoreImg::getImgType, 15)
|
|
|
.eq(StoreImg::getStoreId, id));
|
|
|
+
|
|
|
+ List<StoreImgDTO> storeImgVoList = new ArrayList<>();
|
|
|
+ for (StoreImg storeImg : storeImgList) {
|
|
|
+ StoreImgDTO storeImgVo = new StoreImgDTO();
|
|
|
+ BeanUtils.copyProperties(storeImg, storeImgVo);
|
|
|
+ if (storeInfo != null) {
|
|
|
+ storeImgVo.setExpirationTime(storeInfo.getExpirationTime());
|
|
|
+ }
|
|
|
+ storeImgVoList.add(storeImgVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询图片类型为15(合同)的图片列表
|
|
|
+ return storeImgVoList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -112,11 +132,28 @@ public class LicenseServiceImpl implements LicenseService {
|
|
|
* @return 食品经营许可证图片列表
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<StoreImg> getFoodLicenceList (Integer id) {
|
|
|
+ public List<StoreImgDTO> getFoodLicenceList (Integer id) {
|
|
|
+ log.info("getEntertainmentLicenseList - 查询商户ID为 {} 的娱乐经营许可证图片列表", id);
|
|
|
+
|
|
|
+ StoreInfo storeInfo = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo::getId, id));
|
|
|
+
|
|
|
// 查询图片类型为25(食品经营许可证)的图片列表
|
|
|
- return storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
|
|
|
+ List<StoreImg> storeImgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
|
|
|
.eq(StoreImg::getImgType, 25)
|
|
|
.eq(StoreImg::getStoreId, id));
|
|
|
+
|
|
|
+ List<StoreImgDTO> storeImgVoList = new ArrayList<>();
|
|
|
+ for (StoreImg storeImg : storeImgList) {
|
|
|
+ StoreImgDTO storeImgVo = new StoreImgDTO();
|
|
|
+ BeanUtils.copyProperties(storeImg, storeImgVo);
|
|
|
+ if (storeInfo != null) {
|
|
|
+ storeImgVo.setExpirationTime(storeInfo.getFoodLicenceExpirationTime());
|
|
|
+ }
|
|
|
+ storeImgVoList.add(storeImgVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询图片类型为15(合同)的图片列表
|
|
|
+ return storeImgVoList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -383,5 +420,133 @@ public class LicenseServiceImpl implements LicenseService {
|
|
|
|
|
|
return resultList;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取营业执照图片列表
|
|
|
+ * <p>
|
|
|
+ * 查询指定商户的营业执照图片信息(图片类型为14)
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @param id 商户ID
|
|
|
+ * @return 营业执照图片列表
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<StoreImgDTO> getEntertainmentLicenseList (Integer id) {
|
|
|
+
|
|
|
+ StoreInfo storeInfo = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo::getId, id));
|
|
|
+
|
|
|
+ log.info("getEntertainmentLicenseList - 查询商户ID为 {} 的娱乐经营许可证图片列表", id);
|
|
|
+ List<StoreImg> storeImgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>()
|
|
|
+ .eq(StoreImg::getImgType, 31)
|
|
|
+ .eq(StoreImg::getStoreId, id));
|
|
|
+
|
|
|
+ List<StoreImgDTO> storeImgVoList = new ArrayList<>();
|
|
|
+ for (StoreImg storeImg : storeImgList) {
|
|
|
+ StoreImgDTO storeImgVo = new StoreImgDTO();
|
|
|
+ BeanUtils.copyProperties(storeImg, storeImgVo);
|
|
|
+ if (storeInfo != null) {
|
|
|
+ storeImgVo.setExpirationTime(storeInfo.getEntertainmentLicenceExpirationTime());
|
|
|
+ }
|
|
|
+ storeImgVoList.add(storeImgVo);
|
|
|
+ }
|
|
|
+ return storeImgVoList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int uploadEntertainmentLicence(StoreImg storeImg) {
|
|
|
+ storeImgMapper.delete(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getImgType,32).eq(StoreImg::getStoreId,storeImg.getStoreId()));
|
|
|
+ storeImg.setImgType(32);
|
|
|
+ storeImg.setImgDescription("经营许可证审核通过前图片");
|
|
|
+ storeImgMapper.insert(storeImg);
|
|
|
+
|
|
|
+
|
|
|
+ // 经营许可证历史表插入
|
|
|
+ StoreLicenseHistory licenseHistory = new StoreLicenseHistory();
|
|
|
+ licenseHistory.setStoreId(storeImg.getStoreId());
|
|
|
+ licenseHistory.setLicenseStatus(3);
|
|
|
+ licenseHistory.setLicenseExecuteStatus(2);
|
|
|
+ licenseHistory.setImgUrl(storeImg.getImgUrl());
|
|
|
+ licenseHistory.setDeleteFlag(0);
|
|
|
+ licenseHistoryMapper.insert(licenseHistory);
|
|
|
+
|
|
|
+ //更新店铺
|
|
|
+ StoreInfo storeInfo = new StoreInfo();
|
|
|
+ storeInfo.setEntertainmentLicenceStatus(2);
|
|
|
+ storeInfo.setId(storeImg.getStoreId());
|
|
|
+ storeInfo.setUpdateEntertainmentLicenceTime(new Date());
|
|
|
+ return storeInfoMapper.updateById(storeInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据商户ID查询证照历史记录列表(带格式化日期)
|
|
|
+ * <p>
|
|
|
+ * 查询指定商户的证照历史记录,将创建时间格式化为 yyyy-MM-dd 格式,
|
|
|
+ * 并转换为 VO 对象返回
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @param storeId 商户ID
|
|
|
+ * @return 证照历史记录VO列表
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<StoreLicenseHistoryDto> queryEntertainmentByStatusList (Integer storeId) {
|
|
|
+
|
|
|
+ List<StoreLicenseHistory> licenseList = licenseHistoryMapper.queryLicenceByStatusList(storeId, 3, 1);
|
|
|
+
|
|
|
+ // 创建日期格式化对象,格式为 yyyy-MM-dd
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
|
+
|
|
|
+ // 创建返回的 VO 列表
|
|
|
+ List<StoreLicenseHistoryDto> voList = new java.util.ArrayList<>();
|
|
|
+
|
|
|
+ for (StoreLicenseHistory license : licenseList) {
|
|
|
+ // 创建 VO 对象
|
|
|
+ StoreLicenseHistoryDto vo = new StoreLicenseHistoryDto();
|
|
|
+
|
|
|
+ // 将实体对象属性复制到 VO 对象
|
|
|
+ BeanUtils.copyProperties(license, vo);
|
|
|
+
|
|
|
+ // 将创建时间格式化为 yyyy-MM-dd 格式,去除时分秒
|
|
|
+ if (license.getCreatedTime() != null) {
|
|
|
+ String dateStr = sdf.format(license.getCreatedTime());
|
|
|
+ vo.setCreatedDateFormat(dateStr);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 设置审核状态名称
|
|
|
+ if (license.getLicenseExecuteStatus() != null) {
|
|
|
+ switch (license.getLicenseExecuteStatus()) {
|
|
|
+ case 1:
|
|
|
+ vo.setLicenseExecuteName("审核通过");
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ vo.setLicenseExecuteName("审核中");
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ vo.setLicenseExecuteName("审核失败");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ vo.setLicenseExecuteName("未知");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ voList.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ return voList;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> getStoreEntertainmentStatus(int id) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ StoreInfo storeInfo = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo::getId, id));
|
|
|
+ //审核通过给前台反显未提交
|
|
|
+ if (storeInfo.getEntertainmentLicenceStatus() != null && storeInfo.getEntertainmentLicenceStatus() == 1) {
|
|
|
+ map.put("entertainmentStatus", 0);
|
|
|
+ } else {
|
|
|
+ map.put("entertainmentStatus", storeInfo.getEntertainmentLicenceStatus());
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|
|
|
|