导出放开限制,测量阶段通知

This commit is contained in:
shuo.wang
2025-04-30 15:15:07 +08:00
parent 921447d672
commit bbd03472d9
14 changed files with 112 additions and 13 deletions

View File

@@ -31,7 +31,7 @@ public class CommonConstants {
public static final int TEN_SECONDS = 10000;
public static final int ONE_SECONDS = 1000;
public static final int TOW_SECONDS = 2000;
public static final int FIVE_SECONDS = 5000;
public static final int MAX_EXPORT_SIZE = 10000;
/**

View File

@@ -255,7 +255,7 @@ public enum ErrorCodeEnum {
GET_YLS_CODE_FAIL(151006,"系统无云流水编码无法获取TOKEN请先维护该编码",null),
BANK_EXIST(151007,"当前银行已存在,请直接选择!",null),
EXPORT_LIMIT_1000(151008,"导出数据不能超过1000条请增加筛选条件减少导出数量",null),
EXPORT_LIMIT_5000(151008,"导出数据不能超过5000条请增加筛选条件减少导出数量",null),
;

View File

@@ -82,6 +82,8 @@ public enum MessageEnum {
MESSAGE_54("您有一个门店建店资料待审核,请查收","门店名称:${storeName}\n加盟商姓名${partnerUsername}\n加盟商手机号码${partnerMobile}\n"),
MESSAGE_55("您有一个门店设计阶段待提交,请查收","门店名称:${storeName}\n加盟商姓名${partnerUsername}\n加盟商手机号码${partnerMobile}\n"),
MESSAGE_56("您有一个门店测量阶段待提交,请查收","门店名称:${storeName}\n加盟商姓名${partnerUsername}\n加盟商手机号码${partnerMobile}\n"),
MESSAGE_57("您有一个门店测量阶段待分配测量员和设计组,请查收","门店名称:${storeName}\n加盟商姓名${partnerUsername}\n加盟商手机号码${partnerMobile}\n"),
MESSAGE_58("您有一个门店设计阶段待分配设计师,请查收","门店名称:${storeName}\n加盟商姓名${partnerUsername}\n加盟商手机号码${partnerMobile}\n"),
;
private String title;

View File

@@ -46,4 +46,7 @@ public class OrderSysInfoDAO {
}
return orderSysInfoMapper.getSpecificByShopIdList(shopIdList);
}
public Integer updateAddresseeAddress(OrderSysInfoDO orderSysInfoDO){
return orderSysInfoMapper.updateAddresseeAddress(orderSysInfoDO);
}
}

View File

@@ -157,5 +157,9 @@ public class ShopAccountDAO {
return shopAccountMapper.getSpecificByShopIds(shopIds);
}
//数据处理用
public List<Long> getPasswordIsNull(){
return shopAccountMapper.getPasswordIsNull();
}
}

View File

@@ -16,4 +16,7 @@ import java.util.List;
public interface OrderSysInfoMapper extends Mapper<OrderSysInfoDO> {
List<OrderSysInfoDO> getSpecificByShopIdList(@Param("list") List<Long> shopIdList);
Integer updateAddresseeAddress(@Param("update") OrderSysInfoDO orderSysInfoDO);
}

View File

@@ -96,6 +96,9 @@ public interface ShopAccountMapper extends Mapper<ShopAccountDO> {
*/
List<ShopAccountDO> getSpecificByShopIds(@Param("shopIds") List<Long> shopIds);
//数据处理用
List<Long> getPasswordIsNull();
}

View File

@@ -41,6 +41,14 @@
receiving_create_time, receiving_update_time, receiving_create_user, receiving_update_user,
declare_goods_type
</sql>
<update id="updateAddresseeAddress">
update xfsg_order_sys_info
<if test="update.addresseeAddress != null and update.addresseeAddress != ''">
set addressee_address = #{update.addresseeAddress}
</if>
where shop_id = #{update.shopId}
</update>
<select id="getSpecificByShopIdList" resultType="com.cool.store.entity.OrderSysInfoDO">
select
shop_id as shopId,

View File

@@ -190,4 +190,9 @@
#{shopId}
</foreach>
</select>
<select id="getPasswordIsNull" resultType="java.lang.Long">
SELECT shop_id as shopId FROM xfsg_shop_account
WHERE `password` is null and `system_name` = '火码POS'
</select>
</mapper>

View File

@@ -86,4 +86,7 @@ public interface ShopAccountService {
*/
Boolean handleOldData();
// 处理账户表没有密码的
Boolean handleAccountPassword();
}

View File

@@ -4,16 +4,14 @@ import cn.hutool.core.bean.BeanUtil;
import com.cool.store.constants.CommonConstants;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.DecorationMeasureDAO;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.ShopInfoDAO;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.dao.*;
import com.cool.store.entity.DecorationMeasureDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.entity.ShopStageInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.MessageEnum;
import com.cool.store.enums.UserRoleEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
@@ -33,6 +31,8 @@ import java.util.*;
@RequiredArgsConstructor
public class DecorationMeasureServiceImpl implements DecorationMeasureService {
@Resource
private EnterpriseUserRoleDao enterpriseUserRoleDao;
private final DecorationMeasureDAO decorationMeasureDAO;
private final EnterpriseUserDAO enterpriseUserDAO;
private final RedisUtilPool redisUtilPool;
@@ -106,7 +106,18 @@ public class DecorationMeasureServiceImpl implements DecorationMeasureService {
shopStageInfoDAO.batchUpdateShopStageStatus(request.getShopId(),
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_862, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90));
// 给测量员发送企业微信消息
List<String> headOfDesignList = enterpriseUserRoleDao.selectUserIdsByRoleIdList(Arrays.asList(UserRoleEnum.HEAD_OF_DESIGN.getCode()));
sendMeasureUserMessage(request.getShopId(), request.getMeasureUserId());
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
LineInfoDO lineInfo = lineInfoMapper.getByLineId(shopInfo.getLineId());
HashMap<String, String> map = new HashMap<>(4);
map.put("partnerUsername", lineInfo.getUsername());
map.put("partnerMobile", lineInfo.getMobile());
map.put("storeName", shopInfo.getShopName());
commonService.sendQWMessage(headOfDesignList,
MessageEnum.MESSAGE_58,
map
);
}
return Boolean.TRUE;
}
@@ -127,7 +138,7 @@ public class DecorationMeasureServiceImpl implements DecorationMeasureService {
map.put("storeName", shopInfo.getShopName());
commonService.sendQWMessage(
Collections.singletonList(userId),
MessageEnum.MESSAGE_55,
MessageEnum.MESSAGE_56,
map
);
}

View File

@@ -102,14 +102,14 @@ public class ExportServiceImpl implements ExportService {
@Override
public Long exportProgressBase(BranchShopRequest request, LoginUserInfo user, FileTypeEnum fileTypeEnum) {
request.setPageSize(CommonConstants.ONE_SECONDS+10);
request.setPageSize(CommonConstants.FIVE_SECONDS+10);
request.setPageNum(CommonConstants.ONE);
PageInfo<BranchShopResponse> branchShopList = shopService.getBranchShopList(request, user.getUserId());
long total = branchShopList.getTotal();
if (total == CommonConstants.ZERO) {
return CommonConstants.ZERO_LONG;
} else if (total > CommonConstants.ONE_SECONDS) {
throw new ServiceException(ErrorCodeEnum.EXPORT_LIMIT_1000);
} else if (total > CommonConstants.FIVE_SECONDS) {
throw new ServiceException(ErrorCodeEnum.EXPORT_LIMIT_5000);
}
ImportTaskDO importTaskDO = new ImportTaskDO();
importTaskDO.setStatus(ImportStatusEnum.Ongoing.getCode());

View File

@@ -312,5 +312,54 @@ public class ShopAccountServiceImpl implements ShopAccountService {
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean handleAccountPassword() {
List<Long> shopIdList = shopAccountDAO.getPasswordIsNull();
if (CollectionUtils.isEmpty(shopIdList)){
return false;
}
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByIds(shopIdList);
Map<String, List<ShopInfoDO>> shopMap = shopList.stream().collect(Collectors.groupingBy(ShopInfoDO::getPartnerId));
Set<String> partnerIds = shopList.stream().map(ShopInfoDO::getPartnerId).collect(Collectors.toSet());
Set<Long> lineIdSet = shopList.stream().map(ShopInfoDO::getLineId).collect(Collectors.toSet());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(new ArrayList<>(partnerIds));
List<QualificationsInfoDO> qualificationsInfoDOList = qualificationsInfoDAO.getByLineIds(new ArrayList<>(lineIdSet));
Map<String, QualificationsInfoDO> qualificationsInfoDOMap = qualificationsInfoDOList.stream().collect(Collectors.toMap(QualificationsInfoDO::getPartnerId, Function.identity()));
List<ShopAccountDO> updateList = new ArrayList<>();
for (HyPartnerUserInfoDO hyPartnerUserInfoDO : hyPartnerUserInfoDOS) {
QualificationsInfoDO qualificationsInfoDO = qualificationsInfoDOMap.get(hyPartnerUserInfoDO.getPartnerId());
List<ShopInfoDO> shopInfos = shopMap.get(hyPartnerUserInfoDO.getPartnerId());
List<Long> shopIds = shopInfos.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
List<ShopAccountDO> accountDOList = shopAccountDAO.getByShopIds(shopIds);
String substring = qualificationsInfoDO.getIdCardNo().substring(qualificationsInfoDO.getIdCardNo().length() - 6);
//生成密码和盐值
byte[] saltBytes = PasswordUtil.generateSalt();
String salt = PasswordUtil.bytesToHex(saltBytes);
String password = PasswordUtil.encryptPassword(substring, salt);
GetPasswordDTO getPasswordDTO = new GetPasswordDTO();
getPasswordDTO.setPassword(substring);
String downstreamSystemSecondaryPassword = thirdXinGuanJiaService.getPassword(getPasswordDTO);
// 修改用户表
hyPartnerUserInfoDO.setDownstreamSystemPassword(password);
hyPartnerUserInfoDO.setDownstreamSystemSalting(salt);
hyPartnerUserInfoDO.setDownstreamSystemSecondaryPassword(downstreamSystemSecondaryPassword);
//循环修改 门店账户表
for (ShopAccountDO shopAccountDO : accountDOList) {
if (shopAccountDO.getSystemName().equals(ShopAccountEnum.YLS.getSystemName())
|| shopAccountDO.getSystemName().equals(ShopAccountEnum.XZG.getSystemName())
|| shopAccountDO.getSystemName().equals(ShopAccountEnum.HUOMA.getSystemName())) {
shopAccountDO.setPassword(password);
shopAccountDO.setPasswordSalt(salt);
shopAccountDO.setSecondaryPassword(downstreamSystemSecondaryPassword);
updateList.add(shopAccountDO);
}
}
}
shopAccountDAO.dateHandle(updateList);
hyPartnerUserInfoDAO.dataHandle(hyPartnerUserInfoDOS);
return true;
}
}

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.EnterpriseUserRoleDao;
import com.cool.store.dao.OrderSysInfoDAO;
import com.cool.store.dao.QualificationsInfoDAO;
import com.cool.store.dao.ShopStageInfoDAO;
@@ -42,6 +43,8 @@ import java.util.stream.Collectors;
@Service
@Slf4j
public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResultService {
@Resource
private EnterpriseUserRoleDao enterpriseUserRoleDao;
@Resource
SignFranchiseMapper signFranchiseMapper;
@@ -192,9 +195,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
if (Objects.nonNull(userDOList)) {
finances.addAll(userDOList.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
}
// commonService.sendQWMessage(finances,
// MessageEnum.MESSAGE_34,
// map);
List<String> liGuiNeiQinList = enterpriseUserRoleDao.selectUserIdsByRoleIdList(Arrays.asList(UserRoleEnum.CONSTRUCTION_CUSTOMER.getCode()));
commonService.sendQWMessage(liGuiNeiQinList,
MessageEnum.MESSAGE_57,
map);
commonService.sendQWMessage(Collections.singletonList(shopInfoDO.getInvestmentManager()),
MessageEnum.MESSAGE_35,
map);
@@ -219,6 +223,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
orderSysInfoDO = new OrderSysInfoDO();
orderSysInfoDO.setShopId(request.getShopId());
orderSysInfoDAO.insertSelective(orderSysInfoDO);
}else{
//同步建店资料地址
orderSysInfoDO.setAddresseeAddress(request.getDetailAddress());
orderSysInfoDAO.updateAddresseeAddress(orderSysInfoDO);
}
return new ResponseResult(200000, "提交成功");
} else {