Merge remote-tracking branch 'xfsg/cc_partner_init' into cc_partner_init

This commit is contained in:
苏竹红
2024-05-29 16:44:12 +08:00
2 changed files with 22 additions and 6 deletions

View File

@@ -33,6 +33,7 @@ public enum SMSMsgEnum {
FRANCHISE_FEE_NOT_PASS("缴纳加盟费缴纳失败", "", "SMS_465896262"),
DECORATION_MODEL_PAY("装修款待缴费", "","SMS_465961253"),
THREE_ACCEPTANCE_WAIT("三方验收待验收","","SMS_465961257"),
FIRST_ORDER("首批订货金代缴费","","SMS_467585281"),
TRAINING_REGISTER_SUCCESS("培训登记中", "", "SMS_466035101"),
TRAINING_ASSESSMENT_SUCCESS("员工培训已完成", "", "SMS_465901266"),

View File

@@ -6,12 +6,15 @@ import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.FirstOrderDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.dto.openPreparation.FirstOrderDTO;
import com.cool.store.entity.FirstOrderDO;
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.SMSMsgEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
@@ -29,6 +32,8 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -46,6 +51,8 @@ public class FirstOrderServiceImp implements FirstOrderService {
@Resource
private PreparationService preparationService;
@Resource
private CommonService commonService;
@Resource
private ShopService shopService;
@Resource
private ShopStageInfoDAO shopStageInfoDAO;
@@ -53,6 +60,9 @@ public class FirstOrderServiceImp implements FirstOrderService {
private CoolStoreStartFlowService coolStoreStartFlowService;
@Resource
private EnterpriseUserDAO enterpriseUserDAO;
@Resource
private LineInfoDAO lineInfoDAO;
@Override
public Integer saveOrder(FirstOrderRequest request, LoginUserInfo user) {
log.info("save order:{}", JSONObject.toJSONString(request));
@@ -84,10 +94,15 @@ public class FirstOrderServiceImp implements FirstOrderService {
}
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152);
//发送消息至加盟商
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
Map<String,String> messageMap =new HashMap<>();
messageMap.put("totalOrderDeposit",request.getTotalOrderDeposit());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.FIRST_ORDER, messageMap);
//云立方同步
if (num > 0) {
try {
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
String storeNum = shopInfo.getStoreNum();
Boolean flag = coolStoreStartFlowService.getFirstOrder(storeNum);
log.info("saveOrder,flag:{}", flag);
@@ -106,6 +121,7 @@ public class FirstOrderServiceImp implements FirstOrderService {
}
return num;
}
@Transactional(rollbackFor = Exception.class)
@Override
public FirstOrderDTO getOrder(Long shopId) {
@@ -116,12 +132,11 @@ public class FirstOrderServiceImp implements FirstOrderService {
}
FirstOrderDTO order = firstOrderDAO.selectFirstOrderByShopId(shopId);
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus()))
{
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())) {
String userName = enterpriseUserDAO.getUserName(order.getCreateUserId());
order.setPartnerName(userName);
order.setFirstOrderSubStage( ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());
order.setFirstOrderSubStage(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());
return order;
}
if (Objects.nonNull(order)) {
@@ -140,9 +155,9 @@ public class FirstOrderServiceImp implements FirstOrderService {
//更改子阶段状态
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151);
order.setFirstOrderSubStage( ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());
order.setFirstOrderSubStage(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());
preparationService.whetherToOpenForAcceptance(order.getShopId());
}else {
} else {
order.setFirstOrderSubStage(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus());
}
} catch (Exception e) {