feat:平台账号
This commit is contained in:
@@ -243,6 +243,10 @@ public enum ErrorCodeEnum {
|
|||||||
THIRD_API_ERROR(151001,"第三方服务异常->{0}",null),
|
THIRD_API_ERROR(151001,"第三方服务异常->{0}",null),
|
||||||
THIRD_API_SIGN_ERROR(151002,"签名失败->{0}",null),
|
THIRD_API_SIGN_ERROR(151002,"签名失败->{0}",null),
|
||||||
THIRD_API_TIME_IS_NULL(151003,"单据⽇期不能为空",null),
|
THIRD_API_TIME_IS_NULL(151003,"单据⽇期不能为空",null),
|
||||||
|
|
||||||
|
SYSTEM_DATA_ERROR(151004,"平台账号不能为空",null),
|
||||||
|
CURRENT_STATUS_NOT_OPERATION(151005,"平台账号当前非审核状态!不能提交审核",null),
|
||||||
|
CURRENT_ENTRY_STATUS_NOT_OPERATION(151006,"进件状态未审核!不能执行该操作",null),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ public enum OpenStatusEnum {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
public static List<Integer> getSpecialList(){
|
||||||
|
return Arrays.asList(OPENSTATUSENUM_4.getCode(),OPENSTATUSENUM_5.getCode(),OPENSTATUSENUM_6.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
OpenStatusEnum(Integer code,String name){
|
OpenStatusEnum(Integer code,String name){
|
||||||
this.code = code;
|
this.code = code;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public enum ShopAccountEnum {
|
public enum ShopAccountEnum {
|
||||||
|
|
||||||
HuoMa("火码POS",OpenStatusEnum.OPENSTATUSENUM_1),
|
HUOMA("火码POS",OpenStatusEnum.OPENSTATUSENUM_1),
|
||||||
YLS("云流水",OpenStatusEnum.OPENSTATUSENUM_1),
|
YLS("云流水",OpenStatusEnum.OPENSTATUSENUM_1),
|
||||||
XZG("新掌柜",OpenStatusEnum.OPENSTATUSENUM_1),
|
XZG("新掌柜",OpenStatusEnum.OPENSTATUSENUM_1),
|
||||||
MTTG("美团团购",OpenStatusEnum.OPENSTATUSENUM_1),
|
MTTG("美团团购",OpenStatusEnum.OPENSTATUSENUM_1),
|
||||||
@@ -23,7 +23,11 @@ public enum ShopAccountEnum {
|
|||||||
|
|
||||||
|
|
||||||
public static List<String> getSpecialList(){
|
public static List<String> getSpecialList(){
|
||||||
return Arrays.asList(HuoMa.getSystemName(),YLS.getSystemName(),XZG.getSystemName());
|
return Arrays.asList(HUOMA.getSystemName(),YLS.getSystemName(),XZG.getSystemName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<ShopAccountEnum> getSpecialEnumList(){
|
||||||
|
return Arrays.asList(HUOMA,YLS,XZG);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String systemName;
|
private String systemName;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class PasswordUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用 SHA-256 加密密码
|
* 使用 MD5 加密密码
|
||||||
*
|
*
|
||||||
* @param plainPassword 明文密码
|
* @param plainPassword 明文密码
|
||||||
* @param salt 盐值
|
* @param salt 盐值
|
||||||
@@ -52,7 +52,7 @@ public class PasswordUtil {
|
|||||||
*/
|
*/
|
||||||
public static String encryptPassword(String plainPassword, byte[] salt) {
|
public static String encryptPassword(String plainPassword, byte[] salt) {
|
||||||
try {
|
try {
|
||||||
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
|
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
|
||||||
// 将盐值和明文密码拼接后进行哈希计算
|
// 将盐值和明文密码拼接后进行哈希计算
|
||||||
messageDigest.update(salt);
|
messageDigest.update(salt);
|
||||||
byte[] hashedBytes = messageDigest.digest(plainPassword.getBytes());
|
byte[] hashedBytes = messageDigest.digest(plainPassword.getBytes());
|
||||||
|
|||||||
@@ -36,10 +36,13 @@ public class ShopAccountDAO {
|
|||||||
shopAccountDO.setShopId(shopId);
|
shopAccountDO.setShopId(shopId);
|
||||||
shopAccountDO.setSystemName(shopAccountEnum.getSystemName());
|
shopAccountDO.setSystemName(shopAccountEnum.getSystemName());
|
||||||
shopAccountDO.setBoundPhone(partnerUserInfoDO.getMobile());
|
shopAccountDO.setBoundPhone(partnerUserInfoDO.getMobile());
|
||||||
shopAccountDO.setPasswordSalt(partnerUserInfoDO.getDownstreamSystemSalting());
|
//其他账户不使用统一密码
|
||||||
shopAccountDO.setPassword(partnerUserInfoDO.getDownstreamSystemPassword());
|
if (ShopAccountEnum.getSpecialEnumList().contains(shopAccountEnum)){
|
||||||
|
shopAccountDO.setPasswordSalt(partnerUserInfoDO.getDownstreamSystemSalting());
|
||||||
|
shopAccountDO.setPassword(partnerUserInfoDO.getDownstreamSystemPassword());
|
||||||
|
}
|
||||||
shopAccountDO.setStatus(shopAccountEnum.getInitStatus().getCode());
|
shopAccountDO.setStatus(shopAccountEnum.getInitStatus().getCode());
|
||||||
if (ShopAccountEnum.HuoMa.equals(shopAccountEnum)){
|
if (ShopAccountEnum.HUOMA.equals(shopAccountEnum)){
|
||||||
shopAccountDO.setEntryStatus(CommonConstants.ONE);
|
shopAccountDO.setEntryStatus(CommonConstants.ONE);
|
||||||
}
|
}
|
||||||
shopAccountDOS.add(shopAccountDO);
|
shopAccountDOS.add(shopAccountDO);
|
||||||
@@ -116,5 +119,10 @@ public class ShopAccountDAO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<ShopAccountDO> getALlFail(){
|
||||||
|
return shopAccountMapper.getALlFail();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,12 @@ public interface ShopAccountMapper extends Mapper<ShopAccountDO> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询云流水、新掌柜 POS失败的数据 重新推数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ShopAccountDO> getALlFail();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -126,4 +126,11 @@
|
|||||||
#{shopId}
|
#{shopId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getALlFail">
|
||||||
|
select * from xfsg_shop_account WHERE
|
||||||
|
system_name in ('火码POS','云流水','新掌柜')
|
||||||
|
and status = 6
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.cool.store.dto;
|
||||||
|
|
||||||
|
import com.cool.store.enums.ShopAccountEnum;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/4/8 20:32
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AccountAuditDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty("门店ID")
|
||||||
|
@NotNull(message = "门店ID不能为空")
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
@ApiModelProperty("审核标识 1-通过 2-拒绝")
|
||||||
|
private Integer auditFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("HUOMA-火码 YLS-云流水 XZG-新掌柜")
|
||||||
|
private ShopAccountEnum shopAccountEnum;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.cool.store.dto;
|
||||||
|
|
||||||
|
import com.cool.store.enums.ShopAccountEnum;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/4/8 21:13
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AccountEntryStatusAuditDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty("门店ID")
|
||||||
|
@NotNull(message = "门店ID不能为空")
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
@ApiModelProperty("审核标识 1-通过 2-拒绝")
|
||||||
|
private Integer auditFlag;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@ package com.cool.store.dto;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author suzhuhong
|
* @Author suzhuhong
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.cool.store.dto.yun;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Max;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/4/8 21:15
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AccountEntryStatusChangeDTO {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("门店ID")
|
||||||
|
@NotNull(message = "门店ID不能为空")
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
@ApiModelProperty("进件状态 5-进件成功 6-进件失败")
|
||||||
|
@Max(6)
|
||||||
|
@Min(5)
|
||||||
|
private Integer entryStatus;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
|
||||||
|
import com.cool.store.dto.AccountAuditDTO;
|
||||||
|
import com.cool.store.dto.AccountEntryStatusAuditDTO;
|
||||||
|
import com.cool.store.dto.ModifyPasswordDTO;
|
||||||
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
||||||
|
import com.cool.store.dto.yun.AccountEntryStatusChangeDTO;
|
||||||
|
import com.cool.store.enums.DownSystemTypeEnum;
|
||||||
|
import com.cool.store.request.ZxjpApiRequest;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -19,6 +25,52 @@ public interface ShopAccountService {
|
|||||||
*/
|
*/
|
||||||
List<ShopAccountDTO> getShopAccountByShopId(Long shopId);
|
List<ShopAccountDTO> getShopAccountByShopId(Long shopId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* modifyPassword
|
||||||
|
* @param modifyPasswordDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean modifyPassword(ModifyPasswordDTO modifyPasswordDTO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getData
|
||||||
|
* @param shopId
|
||||||
|
* @param systemType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ZxjpApiRequest getData(Long shopId, DownSystemTypeEnum systemType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核平台账号
|
||||||
|
* @param accountAuditDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean auditAccount(AccountAuditDTO accountAuditDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进件审核
|
||||||
|
* @param accountEntryStatusAuditDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean accountEntryStatusAudit(AccountEntryStatusAuditDTO accountEntryStatusAuditDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进件状态修改
|
||||||
|
* @param accountEntryStatusChangeDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean accountEntryStatusChange(AccountEntryStatusChangeDTO accountEntryStatusChangeDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送数据
|
||||||
|
* @param accountAuditDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean pushData(AccountAuditDTO accountAuditDTO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.cool.store.enums.ErrorCodeEnum;
|
|||||||
import com.cool.store.enums.OpenStatusEnum;
|
import com.cool.store.enums.OpenStatusEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.service.OpenApiService;
|
import com.cool.store.service.OpenApiService;
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -40,7 +39,7 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|||||||
Integer openStatus = statusRefreshDTO.getOpenStatus()?OpenStatusEnum.OPENSTATUSENUM_5.getCode():OpenStatusEnum.OPENSTATUSENUM_6.getCode();
|
Integer openStatus = statusRefreshDTO.getOpenStatus()?OpenStatusEnum.OPENSTATUSENUM_5.getCode():OpenStatusEnum.OPENSTATUSENUM_6.getCode();
|
||||||
accountDAO.updateStatusByShopIdAndSystemName(shopInfoDO.getId(), Arrays.asList(statusRefreshDTO.getSystemSource()), openStatus);
|
accountDAO.updateStatusByShopIdAndSystemName(shopInfoDO.getId(), Arrays.asList(statusRefreshDTO.getSystemSource()), openStatus);
|
||||||
|
|
||||||
//订货系统开通完成
|
//订货系统开通完成 todo suzhuhong_
|
||||||
|
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ public class PreparationServiceImpl implements PreparationService {
|
|||||||
log.info("buildStoreAndDecorationComplete flag1->{} flag2->{} flag3->{}",flag1,flag2,flag3);
|
log.info("buildStoreAndDecorationComplete flag1->{} flag2->{} flag3->{}",flag1,flag2,flag3);
|
||||||
//都完成了 进件状态修改
|
//都完成了 进件状态修改
|
||||||
if (flag1 && flag2 && flag3) {
|
if (flag1 && flag2 && flag3) {
|
||||||
shopAccountDAO.updateEntryStatusByShopIdAndSystemName(shopId, Arrays.asList(ShopAccountEnum.HuoMa.getSystemName()), OpenStatusEnum.OPENSTATUSENUM_2.getCode());
|
shopAccountDAO.updateEntryStatusByShopIdAndSystemName(shopId, Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()), OpenStatusEnum.OPENSTATUSENUM_2.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
@@ -337,7 +337,7 @@ public class PreparationServiceImpl implements PreparationService {
|
|||||||
log.info("selectSiteAndBuildStoreComplete flag2->{} flag3->{}",flag2,flag3);
|
log.info("selectSiteAndBuildStoreComplete flag2->{} flag3->{}",flag2,flag3);
|
||||||
//都完成了 进件状态修改
|
//都完成了 进件状态修改
|
||||||
if (flag2 && flag3) {
|
if (flag2 && flag3) {
|
||||||
shopAccountDAO.updateStatusByShopIdAndSystemName(shopId, Arrays.asList(ShopAccountEnum.HuoMa.getSystemName()), OpenStatusEnum.OPENSTATUSENUM_2.getCode());
|
shopAccountDAO.updateStatusByShopIdAndSystemName(shopId, Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()), OpenStatusEnum.OPENSTATUSENUM_2.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
|
|||||||
@@ -1,26 +1,32 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.cool.store.dao.HyPartnerUserInfoDAO;
|
||||||
import com.cool.store.dao.ShopAccountDAO;
|
import com.cool.store.dao.ShopAccountDAO;
|
||||||
import com.cool.store.dao.ShopInfoDAO;
|
import com.cool.store.dao.ShopInfoDAO;
|
||||||
|
import com.cool.store.dto.AccountAuditDTO;
|
||||||
|
import com.cool.store.dto.AccountEntryStatusAuditDTO;
|
||||||
import com.cool.store.dto.ModifyPasswordDTO;
|
import com.cool.store.dto.ModifyPasswordDTO;
|
||||||
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
||||||
|
import com.cool.store.dto.yun.AccountEntryStatusChangeDTO;
|
||||||
|
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||||
import com.cool.store.entity.ShopAccountDO;
|
import com.cool.store.entity.ShopAccountDO;
|
||||||
import com.cool.store.entity.ShopInfoDO;
|
import com.cool.store.entity.ShopInfoDO;
|
||||||
|
import com.cool.store.enums.DownSystemTypeEnum;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.OpenStatusEnum;
|
||||||
import com.cool.store.enums.ShopAccountEnum;
|
import com.cool.store.enums.ShopAccountEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.mapper.ShopAccountMapper;
|
import com.cool.store.mapper.ShopAccountMapper;
|
||||||
|
import com.cool.store.request.ZxjpApiRequest;
|
||||||
import com.cool.store.response.MiniShopsResponse;
|
import com.cool.store.response.MiniShopsResponse;
|
||||||
import com.cool.store.service.ShopAccountService;
|
import com.cool.store.service.ShopAccountService;
|
||||||
import com.cool.store.service.ShopService;
|
import com.cool.store.service.ShopService;
|
||||||
|
import com.cool.store.service.SyncDataService;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,6 +43,10 @@ public class ShopAccountServiceImpl implements ShopAccountService {
|
|||||||
ShopInfoDAO shopInfoDAO;
|
ShopInfoDAO shopInfoDAO;
|
||||||
@Resource
|
@Resource
|
||||||
ShopService shopService;
|
ShopService shopService;
|
||||||
|
@Resource
|
||||||
|
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||||
|
@Resource
|
||||||
|
SyncDataService syncDataService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ShopAccountDTO> getShopAccountByShopId(Long shopId) {
|
public List<ShopAccountDTO> getShopAccountByShopId(Long shopId) {
|
||||||
@@ -73,32 +83,121 @@ public class ShopAccountServiceImpl implements ShopAccountService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Boolean modifyPasswordDTO(ModifyPasswordDTO modifyPasswordDTO){
|
@Override
|
||||||
|
public Boolean modifyPassword(ModifyPasswordDTO modifyPasswordDTO){
|
||||||
//查询
|
//查询
|
||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(modifyPasswordDTO.getShopId());
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(modifyPasswordDTO.getShopId());
|
||||||
if (Objects.isNull(shopInfo)){
|
if (Objects.isNull(shopInfo)){
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||||
}
|
}
|
||||||
|
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(shopInfo.getPartnerId());
|
||||||
|
hyPartnerUserInfoDO.setDownstreamSystemPassword(modifyPasswordDTO.getPassword());
|
||||||
|
hyPartnerUserInfoDO.setDownstreamSystemSalting(modifyPasswordDTO.getPasswordSalt());
|
||||||
|
hyPartnerUserInfoDO.setUpdateTime(new Date());
|
||||||
|
hyPartnerUserInfoDAO.updatePasswordByPartnerId(hyPartnerUserInfoDO);
|
||||||
|
|
||||||
List<MiniShopsResponse> shopListSuccessOpen = shopService.getShopListSuccessOpen(shopInfo.getLineId());
|
List<MiniShopsResponse> shopListSuccessOpen = shopService.getShopListSuccessOpen(shopInfo.getLineId());
|
||||||
//修改数据
|
//修改数据
|
||||||
List<Long> shopIdList = shopListSuccessOpen.stream().map(MiniShopsResponse::getShopId).collect(Collectors.toList());
|
List<Long> shopIdList = shopListSuccessOpen.stream().map(MiniShopsResponse::getShopId).collect(Collectors.toList());
|
||||||
shopAccountDAO.batchUpdatePasswordByShopIds(shopIdList,modifyPasswordDTO.getPassword(),modifyPasswordDTO.getPasswordSalt(),new Date());
|
|
||||||
|
|
||||||
|
//批量修改密码 密码盐
|
||||||
|
shopAccountDAO.batchUpdatePasswordByShopIds(shopIdList,modifyPasswordDTO.getPassword(),modifyPasswordDTO.getPasswordSalt(),new Date());
|
||||||
|
|
||||||
//当前加盟商所有开店成功的CODE
|
//当前加盟商所有开店成功的CODE
|
||||||
List<String> shopCodeList = shopListSuccessOpen.stream().map(MiniShopsResponse::getShopCode).collect(Collectors.toList());
|
List<String> shopCodeList = shopListSuccessOpen.stream().map(MiniShopsResponse::getShopCode).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
//推送下游系统
|
//推送下游系统
|
||||||
|
// TODO: 2025/4/8 suzhuhong_
|
||||||
|
|
||||||
//火码实时该状态
|
|
||||||
|
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ZxjpApiRequest getData(Long shopId, DownSystemTypeEnum systemType){
|
||||||
|
return syncDataService.getData(shopId,systemType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean auditAccount(AccountAuditDTO accountAuditDTO) {
|
||||||
|
if (accountAuditDTO.getShopId()==null||accountAuditDTO.getAuditFlag()==null||accountAuditDTO.getShopAccountEnum()==null){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
|
}
|
||||||
|
List<ShopAccountDO> accountDOS = shopAccountDAO.selectByShopId(accountAuditDTO.getShopId());
|
||||||
|
if (CollectionUtils.isEmpty(accountDOS)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
|
||||||
|
}
|
||||||
|
Map<String, ShopAccountDO> map = accountDOS.stream().collect(Collectors.toMap(ShopAccountDO::getSystemName, data -> data));
|
||||||
|
ShopAccountDO shopAccountDO = map.get(accountAuditDTO.getShopAccountEnum().getSystemName());
|
||||||
|
if (Objects.isNull(shopAccountDO)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
|
||||||
|
}
|
||||||
|
if (!OpenStatusEnum.OPENSTATUSENUM_2.getCode().equals(shopAccountDO.getStatus())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.CURRENT_STATUS_NOT_OPERATION);
|
||||||
|
}
|
||||||
|
OpenStatusEnum openStatusEnum = accountAuditDTO.getAuditFlag() == 1 ? OpenStatusEnum.OPENSTATUSENUM_4 : OpenStatusEnum.OPENSTATUSENUM_3;
|
||||||
|
shopAccountDAO.updateStatusByShopIdAndSystemName(accountAuditDTO.getShopId(),Arrays.asList(shopAccountDO.getSystemName()),openStatusEnum.getCode());
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean accountEntryStatusAudit(AccountEntryStatusAuditDTO dto) {
|
||||||
|
if (dto.getShopId()==null||dto.getAuditFlag()==null){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
|
}
|
||||||
|
List<ShopAccountDO> accountDOS = shopAccountDAO.selectByShopId(dto.getShopId());
|
||||||
|
if (CollectionUtils.isEmpty(accountDOS)){
|
||||||
|
return Boolean.FALSE;
|
||||||
|
}
|
||||||
|
Map<String, ShopAccountDO> map = accountDOS.stream().collect(Collectors.toMap(ShopAccountDO::getSystemName, data -> data));
|
||||||
|
ShopAccountDO shopAccountDO = map.get(ShopAccountEnum.HUOMA.getSystemName());
|
||||||
|
if (Objects.isNull(shopAccountDO)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
|
||||||
|
}
|
||||||
|
if (!OpenStatusEnum.OPENSTATUSENUM_2.getCode().equals(shopAccountDO.getEntryStatus())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.CURRENT_STATUS_NOT_OPERATION);
|
||||||
|
}
|
||||||
|
OpenStatusEnum openStatusEnum = dto.getAuditFlag() == 1 ? OpenStatusEnum.OPENSTATUSENUM_4 : OpenStatusEnum.OPENSTATUSENUM_3;
|
||||||
|
//修改进件状态
|
||||||
|
shopAccountDAO.updateEntryStatusByShopIdAndSystemName(dto.getShopId(),Arrays.asList(shopAccountDO.getSystemName()),openStatusEnum.getCode());
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean accountEntryStatusChange(AccountEntryStatusChangeDTO dto) {
|
||||||
|
if (dto.getShopId()==null||dto.getEntryStatus()==null){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
|
}
|
||||||
|
List<ShopAccountDO> accountDOS = shopAccountDAO.selectByShopId(dto.getShopId());
|
||||||
|
if (CollectionUtils.isEmpty(accountDOS)){
|
||||||
|
return Boolean.FALSE;
|
||||||
|
}
|
||||||
|
Map<String, ShopAccountDO> map = accountDOS.stream().collect(Collectors.toMap(ShopAccountDO::getSystemName, data -> data));
|
||||||
|
ShopAccountDO shopAccountDO = map.get(ShopAccountEnum.HUOMA.getSystemName());
|
||||||
|
if (Objects.isNull(shopAccountDO)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
|
||||||
|
}
|
||||||
|
//不是审核中 已进件 进件失败状态不支持修改
|
||||||
|
if (!OpenStatusEnum.getSpecialList().contains(shopAccountDO.getEntryStatus())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.CURRENT_ENTRY_STATUS_NOT_OPERATION);
|
||||||
|
}
|
||||||
|
//修改进件状态
|
||||||
|
shopAccountDAO.updateEntryStatusByShopIdAndSystemName(dto.getShopId(),Arrays.asList(shopAccountDO.getSystemName()),dto.getEntryStatus());
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean pushData(AccountAuditDTO accountAuditDTO) {
|
||||||
|
if (accountAuditDTO.getShopId()==null||accountAuditDTO.getShopAccountEnum()==null){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: 2025/4/8 suzhuhong_
|
||||||
|
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,4 +243,19 @@ public class PCTestController {
|
|||||||
return ResponseResult.success(syncDataService.getData(shopId, DownSystemTypeEnum.getByCode(type)));
|
return ResponseResult.success(syncDataService.getData(shopId, DownSystemTypeEnum.getByCode(type)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ShopAccountDAO shopAccountDAO;
|
||||||
|
@Resource
|
||||||
|
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||||
|
@GetMapping("/initShopAccount")
|
||||||
|
@ApiOperation("初始化门店账号")
|
||||||
|
public ResponseResult<Integer> initShopAccount(@RequestParam(value = "partnerId", required = true) String partnerId,
|
||||||
|
@RequestParam(value = "shopId", required = true) Long shopId) {
|
||||||
|
// 调用第三方接口
|
||||||
|
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId);
|
||||||
|
return ResponseResult.success(shopAccountDAO.initShopAccount(hyPartnerUserInfoDO,Arrays.asList(shopId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
package com.cool.store.controller.webb;
|
package com.cool.store.controller.webb;
|
||||||
|
|
||||||
|
import com.cool.store.dto.AccountAuditDTO;
|
||||||
|
import com.cool.store.dto.AccountEntryStatusAuditDTO;
|
||||||
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
||||||
|
import com.cool.store.dto.yun.AccountEntryStatusChangeDTO;
|
||||||
|
import com.cool.store.enums.DownSystemTypeEnum;
|
||||||
|
import com.cool.store.request.ZxjpApiRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.ShopAccountService;
|
import com.cool.store.service.ShopAccountService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -35,5 +38,37 @@ public class ShopAccountController {
|
|||||||
return ResponseResult.success(accountService.getShopAccountByShopId(shopId));
|
return ResponseResult.success(accountService.getShopAccountByShopId(shopId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据门店shopId与平台名称查询数据")
|
||||||
|
@GetMapping("/getData")
|
||||||
|
public ResponseResult<ZxjpApiRequest> getData(@RequestParam(value = "shopId", required = true) Long shopId,
|
||||||
|
@RequestParam(value = "shopId", required = true) DownSystemTypeEnum systemName) {
|
||||||
|
return ResponseResult.success(accountService.getData(shopId,systemName));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("开通状态审核")
|
||||||
|
@PostMapping("/auditAccount")
|
||||||
|
public ResponseResult<Boolean> getData(@RequestBody @Validated AccountAuditDTO accountAuditDTO) {
|
||||||
|
return ResponseResult.success(accountService.auditAccount(accountAuditDTO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("推送数据")
|
||||||
|
@PostMapping("/pushData")
|
||||||
|
public ResponseResult<Boolean> pushData(@RequestBody @Validated AccountAuditDTO accountAuditDTO) {
|
||||||
|
return ResponseResult.success(accountService.pushData(accountAuditDTO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("进件状态审核")
|
||||||
|
@PostMapping("/accountEntryStatusAudit")
|
||||||
|
public ResponseResult<Boolean> getDaa(@RequestBody @Validated AccountEntryStatusAuditDTO dto) {
|
||||||
|
return ResponseResult.success(accountService.accountEntryStatusAudit(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("进件状态修改")
|
||||||
|
@PostMapping("/accountEntryStatusChange")
|
||||||
|
public ResponseResult<Boolean> accountEntryStatusChange(@RequestBody @Validated AccountEntryStatusChangeDTO dto) {
|
||||||
|
return ResponseResult.success(accountService.accountEntryStatusChange(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
|
import com.cool.store.dto.ModifyPasswordDTO;
|
||||||
|
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.ShopAccountService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/4/8 16:17
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Api(tags ="小程序账号管理")
|
||||||
|
@RequestMapping({"/mini/account"})
|
||||||
|
public class MiniShopAccountController {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ShopAccountService accountService;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("根据门店shopId查询平台账号")
|
||||||
|
@GetMapping("/getShopAccountByShopId")
|
||||||
|
public ResponseResult<List<ShopAccountDTO>> getShopAccountByShopId(@RequestParam(value = "shopId", required = true) Long shopId) {
|
||||||
|
return ResponseResult.success(accountService.getShopAccountByShopId(shopId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("修改密码")
|
||||||
|
@GetMapping("/modifyPassword")
|
||||||
|
public ResponseResult<Boolean> modifyPassword(@RequestBody ModifyPasswordDTO request) {
|
||||||
|
return ResponseResult.success(accountService.modifyPassword(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -101,6 +101,8 @@ public class XxlJobHandler {
|
|||||||
ApplyLicenseMapper applyLicenseMapper;
|
ApplyLicenseMapper applyLicenseMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private TallyBookService tallyBookService;
|
private TallyBookService tallyBookService;
|
||||||
|
@Resource
|
||||||
|
ShopAccountDAO accountDAO;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -337,5 +339,45 @@ public class XxlJobHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XxlJob("rePush")
|
||||||
|
public void rePush() {
|
||||||
|
log.info("------start rePush------");
|
||||||
|
boolean hasNext = true;
|
||||||
|
int pageNum = 1;
|
||||||
|
int pageSize = 10;
|
||||||
|
List<Long> shopIdList = new ArrayList<>();
|
||||||
|
while (hasNext) {
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
//获取成功开店的门店
|
||||||
|
List<ShopAccountDO> accountDOS = accountDAO.getALlFail();
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(accountDOS)) {
|
||||||
|
log.info("------rePush is empty------");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for (ShopAccountDO accountDO : accountDOS){
|
||||||
|
try {
|
||||||
|
// TODO: 2025/4/8 suzhuhong_
|
||||||
|
//推送数据 如果云流水或者新掌柜其中一个失败了 还要不要推送数据
|
||||||
|
|
||||||
|
//如果是POS推送成功 修改状态 还要修改阶段数据
|
||||||
|
|
||||||
|
//云流水 新掌柜 等待回调
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (accountDOS.size() < pageSize){
|
||||||
|
hasNext = false;
|
||||||
|
}
|
||||||
|
pageNum++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user