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

This commit is contained in:
bianyadong
2024-04-30 14:32:17 +08:00
9 changed files with 66 additions and 18 deletions

View File

@@ -0,0 +1,33 @@
package com.cool.store.enums;
/**
* @author zhangchenbiao
* @FileName: StorageStatusEnum
* @Description:
* @date 2024-04-30 13:47
*/
public enum StorageStatusEnum {
//入库状态1已入库 2暂未入库
IN_STORAGE(1, "已入库"),
NOT_IN_STORAGE(2, "暂未入库"),
;
private Integer code;
private String desc;
StorageStatusEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

View File

@@ -27,6 +27,7 @@
<result column="city" jdbcType="VARCHAR" property="city" />
<result column="district" jdbcType="VARCHAR" property="district" />
<result column="township" jdbcType="VARCHAR" property="township" />
<result column="storage_status" jdbcType="TINYINT" property="storageStatus" />
</resultMap>
<sql id="allColumn">
@@ -79,11 +80,8 @@
#{pointStatus}
</foreach>
</if>
<if test="request.storageStatus != null and request.storageStatus == 1">
and point_status in (4,5,6,7)
</if>
<if test="request.storageStatus != null and request.storageStatus == 2">
and point_status in (1,2,3,7)
<if test="request.storageStatus != null">
and storage_status = #{request.storageStatus}
</if>
<if test="request.operateUserId != null and request.operateUserId != ''">
and operate_user_id = #{request.operateUserId}

View File

@@ -151,5 +151,8 @@ public class PointInfoDO {
*/
@Column(name = "township")
private String township;
@Column(name = "storage_status")
private Integer storageStatus;
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.request;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.enums.StorageStatusEnum;
import com.cool.store.utils.GeoMapUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -306,6 +307,7 @@ public class AddPointDetailRequest {
}
}
}
result.setStorageStatus(StorageStatusEnum.NOT_IN_STORAGE.getCode());
return result;
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.request;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.enums.StorageStatusEnum;
import com.cool.store.utils.GeoMapUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -122,6 +123,7 @@ public class MiniAddPointRequest {
}
}
}
result.setStorageStatus(StorageStatusEnum.NOT_IN_STORAGE.getCode());
return result;
}

View File

@@ -28,6 +28,7 @@ import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
@@ -108,11 +109,11 @@ public class CommonService {
}
}
public void sendSms(String poneNumber, SMSMsgEnum templateCode, JSONObject templateParam){
sendSms(Arrays.asList(poneNumber), templateCode, templateParam);
public void sendSms(String poneNumber, SMSMsgEnum templateCode, List<JSONObject> templateParamList){
sendSms(Arrays.asList(poneNumber), templateCode, templateParamList);
}
public void sendSms(List<String> poneNumbers, SMSMsgEnum templateCode, JSONObject templateParam){
public void sendSms(List<String> poneNumbers, SMSMsgEnum templateCode, List<JSONObject> templateParamList){
AsyncClient client = null;
try {
StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
@@ -131,10 +132,8 @@ public class CommonService {
.phoneNumberJson(JSONObject.toJSONString(poneNumbers))
.signNameJson(JSONObject.toJSONString(Arrays.asList(signName)))
.templateCode(templateCode.getTemplateCode())
.templateParamJson(JSONObject.toJSONString(templateParamList))
.build();
if(Objects.nonNull(templateParam)){
sendBatchSmsRequest.toBuilder().templateParamJson(templateParam.toJSONString());
}
CompletableFuture<SendBatchSmsResponse> response = client.sendBatchSms(sendBatchSmsRequest);
SendBatchSmsResponse resp = response.get();
log.info("短信发送response:{}", JSONObject.toJSONString(resp));

View File

@@ -392,11 +392,11 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
WorkflowSubStageStatusEnum workflowSubStageStatus = null;
if(WorkflowSubStageEnum.FIRST_INTERVIEWS.getCode().equals(lineInfo.getWorkflowSubStage())){
workflowSubStageStatus = WorkflowSubStageStatusEnum.FIRST_INTERVIEWS_42;
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.FIRST_INTERVIEW_REAPPOINTMENT, new JSONObject());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.FIRST_INTERVIEW_REAPPOINTMENT, null);
}
if(WorkflowSubStageEnum.SECOND_INTERVIEWS.getCode().equals(lineInfo.getWorkflowSubStage())){
workflowSubStageStatus = WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_120;
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SECOND_INTERVIEW_REAPPOINTMENT, new JSONObject());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SECOND_INTERVIEW_REAPPOINTMENT, null);
}
return lineInfoDAO.updateWorkflowStage(lineInfo.getId(), null, workflowSubStageStatus,null);
}
@@ -417,14 +417,14 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
if(WorkflowSubStageEnum.INVITING_INTERVIEWS.equals(workflowSubStageEnum)){
//更新线索阶段
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(),userId);
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.INTERVIEW_APPOINTMENT_SUCCESS, new JSONObject());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.INTERVIEW_APPOINTMENT_SUCCESS, null);
}
if(WorkflowSubStageEnum.FIRST_INTERVIEWS.equals(workflowSubStageEnum)){
//更新线索阶段
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(),userId);
//一审稽核
auditStatusService.insert(lineInfo.getId(),interviewInfo.getId(),auditId,AuditStageEnum.ONE.getCode());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.INTENTION_PAYMENT, new JSONObject());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.INTENTION_PAYMENT, null);
}
if(WorkflowSubStageEnum.SECOND_INTERVIEWS.equals(workflowSubStageEnum)){
LineInfoDO updateLine = new LineInfoDO();

View File

@@ -346,6 +346,7 @@ public class PointServiceImpl implements PointService {
//删除剩余未完成的审核记录
pointAuditRecordDAO.deletePointAuditRecord(pointId, pointInfo.getSubmitAuditCount());
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_2.getCode());
updatePoint.setStorageStatus(StorageStatusEnum.NOT_IN_STORAGE.getCode());
commonService.sendMessage(Arrays.asList(pointInfo.getDevelopmentManager()), MessageEnum.MESSAGE_12, pointInfo.getPointName(), pointInfo.getAddress(), request.getReason());
return pointInfoDAO.updatePointInfo(updatePoint);
}
@@ -365,6 +366,7 @@ public class PointServiceImpl implements PointService {
}
commonService.sendMessage(Arrays.asList(pointInfo.getDevelopmentManager()), MessageEnum.MESSAGE_11, pointInfo.getPointName(), pointInfo.getAddress());
}
updatePoint.setStorageStatus(StorageStatusEnum.IN_STORAGE.getCode());
return pointInfoDAO.updatePointInfo(updatePoint);
}
@@ -377,7 +379,7 @@ public class PointServiceImpl implements PointService {
shopStageInfoDAO.batchUpdateShopStageStatus(pointInfo.getShopId(), Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_12, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20));
JSONObject templateParam = new JSONObject();
templateParam.put("pointName", pointInfo.getAddress());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SELECT_SUCCESS, templateParam);
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SELECT_SUCCESS, Arrays.asList(templateParam));
}
@Override
@@ -754,7 +756,7 @@ public class PointServiceImpl implements PointService {
JSONObject templateParam = new JSONObject();
templateParam.put("pointName", pointInfo.getAddress());
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SELECT_SUCCESS, templateParam);
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SELECT_SUCCESS, Arrays.asList(templateParam));
}
updateStatusList.add(selectStatus);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, updateStatusList);
@@ -893,7 +895,7 @@ public class PointServiceImpl implements PointService {
ShopSubStageStatusEnum subStageStatus = AuditResultTypeEnum.PASS.getCode().equals(request.getResultType()) ? ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23 : ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22;
if(AuditResultTypeEnum.REJECT.getCode().equals(request.getResultType())){
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.RENT_CONTRACT_AUDIT_FAIL, new JSONObject());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.RENT_CONTRACT_AUDIT_FAIL, null);
}
if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23.equals(subStageStatus)){
//审核通过铺位变为已签约

View File

@@ -5,6 +5,7 @@ import com.cool.store.dao.*;
import com.cool.store.dto.OpenCityDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.MessageEnum;
import com.cool.store.enums.SMSMsgEnum;
import com.cool.store.mapper.HyOpenAreaInfoMapper;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.ShopService;
@@ -39,6 +40,14 @@ public class PCTestController {
return ResponseResult.success(Boolean.FALSE);
}
@GetMapping("/sendSms")
public ResponseResult<Boolean> sendSms(){
JSONObject templateParam = new JSONObject();
templateParam.put("pointName", "杭州市西湖区");
commonService.sendSms("17681878615", SMSMsgEnum.RENT_CONTRACT_AUDIT_FAIL, null);
return ResponseResult.success(Boolean.FALSE);
}
@GetMapping("/initShop")
public ResponseResult<Boolean> initShop(@RequestParam("lineId")Long lineId){
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);