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

This commit is contained in:
zhangchenbiao
2024-05-08 11:50:39 +08:00
53 changed files with 1285 additions and 237 deletions

View File

@@ -173,5 +173,12 @@ public class CommonConstants {
public static final String SEVEN_DAY="第七天-道具安装、室外招牌安装";
public static final String EIGHT_DAY="第八天-卫生保洁、网络及收银设备安装、撤场交接";
public static final String WITHDRAWAL="撤场";
public static final String TRANSCODE_VIDEO = "mp4";
public static final String PRODUCT_REMIND = "product_remind";
/**
* 返回成功描述
*/
public static final String SUCCESS_STR = "success";
}

View File

@@ -174,6 +174,8 @@ public enum ErrorCodeEnum {
SIGN_FRANCHISE_NOT_FOUND(109009, "加盟合同签约信息为空", null),
UNISSUED_STATEMENT(109010, "该门店未发布账单,无法付款", null),
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),

View File

@@ -0,0 +1,40 @@
package com.cool.store.enums.video;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
public enum AlarmTypeEnum {
/**
* 区域入侵
*/
REGION_INTRUSION("region_intrusion","区域入侵"),
/**
* 排队告警
*/
WAITING_ALARM("waiting_alarm","排队告警");
private String code;
private String msg;
protected static final Map<String, AlarmTypeEnum> map = Arrays.stream(values()).collect(
Collectors.toMap(AlarmTypeEnum::getCode, Function.identity()));
AlarmTypeEnum(String code, String msg){
this.code=code;
this.msg=msg;
}
public String getCode() {
return code;
}
public String getMsg() {
return msg;
}
public static AlarmTypeEnum getByCode(String code) {
return map.get(code);
}
}

View File

@@ -0,0 +1,29 @@
package com.cool.store.enums.video;
/**
* video status
*/
public enum ResourceStatusEnum {
UPLOADING(0),// 上传中
TRANSCODING(1),// 转码中
SCREENSHOT_FINISHED(2),//截图完成
TRANSCODE_FINISH(3),//完成
TRANSCODE_FAILED(4);//失败
private final Integer value;
ResourceStatusEnum(Integer value) {
this.value = value;
}
public Integer getValue() {
return value;
}
}

View File

@@ -0,0 +1,82 @@
package com.cool.store.enums.video;
/**
* video status
*/
public enum UploadTypeEnum {
/**
* 检查项提交
*/
TB_DATA_STA_TABLE_COLUMN(1),
/**
* 巡店记录总结
*/
TB_PATROL_STORE_RECORD(2),
/**
* 工单创建
*/
QUESTION_CREATE(3),
/**
*工单处理审核提交
*/
QUESTION_SUMMIT(4),
/**
* 父工单创建
*/
QUESTION_PARENT_CREATE(5),
/**
* 店务提交
*/
STORE_WORK_SUBMIT(6),
/**
* 运营手册
*/
TASK_SOP_ADD(7),
DEVICE_CAPTURE(8),
/**
* 巡店自定义检查项提交
*/
TB_DATA_DEF_TABLE_COLUMN(9),
/**
* 督导自定义检查项提交
*/
SUPERVISION_DATA_DEF_TABLE_COLUMN(10),
ACTIVITY_COMMENT(11),
WEEKLY_NEWSPAPER_LIST(12),
/**
* 陈列检查项提交
*/
TB_DISPLAY_TABLE_DATA_COLUMN(13),
/**
* 陈列检查内容提交
*/
TB_DISPLAY_TABLE_DATA_CONTENT(14),
;
private final Integer value;
UploadTypeEnum(Integer value) {
this.value = value;
}
public Integer getValue() {
return value;
}
}

View File

@@ -0,0 +1,49 @@
package com.cool.store.utils.vod;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Joshua on 2017/9/28 15:50
*/
public class AliResponseUtil {
public static String GetPostBody(InputStream is, int contentLen) {
if (contentLen > 0) {
int readLen = 0;
int readLengthThisTime = 0;
byte[] message = new byte[contentLen];
try {
while (readLen != contentLen) {
readLengthThisTime = is.read(message, readLen, contentLen - readLen);
if (readLengthThisTime == -1) {// Should not happen.
break;
}
readLen += readLengthThisTime;
}
return new String(message);
} catch (IOException e) {
}
}
return "";
}
public static Map<String, String> convert(Map<String, String[]> requestParams) throws UnsupportedEncodingException {
Map<String, String> params = new HashMap<>();
for (String name : requestParams.keySet()) {
String[] values = (String[]) requestParams.get(name);
String valueStr = "";
for (int i = 0; i < values.length; i++) {
valueStr = (i == values.length - 1) ? valueStr + values[i]
: valueStr + values[i] + ",";
}
//乱码解决,这段代码在出现乱码时使用
valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
params.put(name, valueStr);
}
return params;
}
}

View File

@@ -0,0 +1,209 @@
package com.cool.store.utils.vod;
import java.util.List;
/**
* Created by Joshua on 2017/9/28 13:06
*/
public class CallbackRequest {
private String EventType;
private String VideoId;
private String MediaId;
private String Status;
private String Bitrate;//视频流码率单位Kbps
private String Definition;//视频流清晰度定义, 取值FD(流畅)LD(标清)SD(高清)HD(超清)OD(原画)2K(2K)4K(4K)
private Float Duration;//视频流长度,单位秒
private Boolean Encrypt;//视频流是否加密流
private String ErrorCode;//视频流转码出错的时候,会有该字段表示出错代码
private String ErrorMessage;// 视频流转码出错的时候,会有该字段表示出错信息
private String FileUrl;//视频流的播放地址不带鉴权的auth_key如果开启了URL鉴权则需要自己生成auth_key才能访问
private String Format;//视频流格式取值mp4, m3u8
private String Fps;//视频流帧率,每秒多少帧
private Long Height;// 视频流高度单位px
private Long Size;// 视频流大小单位Byte
private Long Width;// 视频流宽度单位px
private List<CallbackStreamInfo> StreamInfos;
private String CoverUrl;//封面图片地址,若未设置封面,则取第一张截图为封面
private String[] Snapshots;// 截图地址列表
private String Data;
private String CreationTime; //人工审核时间
private String AuditStatus; //人工审核的结果
public String getEventType() {
return EventType;
}
public void setEventType(String eventType) {
EventType = eventType;
}
public String getVideoId() {
return VideoId;
}
public void setVideoId(String videoId) {
VideoId = videoId;
}
public String getStatus() {
return Status;
}
public void setStatus(String status) {
Status = status;
}
public String getBitrate() {
return Bitrate;
}
public void setBitrate(String bitrate) {
Bitrate = bitrate;
}
public String getDefinition() {
return Definition;
}
public void setDefinition(String definition) {
Definition = definition;
}
public Float getDuration() {
return Duration;
}
public void setDuration(Float duration) {
Duration = duration;
}
public Boolean getEncrypt() {
return Encrypt;
}
public void setEncrypt(Boolean encrypt) {
Encrypt = encrypt;
}
public String getErrorCode() {
return ErrorCode;
}
public void setErrorCode(String errorCode) {
ErrorCode = errorCode;
}
public String getErrorMessage() {
return ErrorMessage;
}
public void setErrorMessage(String errorMessage) {
ErrorMessage = errorMessage;
}
public String getFileUrl() {
return FileUrl;
}
public void setFileUrl(String fileUrl) {
FileUrl = fileUrl;
}
public String getFormat() {
return Format;
}
public void setFormat(String format) {
Format = format;
}
public String getFps() {
return Fps;
}
public void setFps(String fps) {
Fps = fps;
}
public Long getHeight() {
return Height;
}
public void setHeight(Long height) {
Height = height;
}
public Long getSize() {
return Size;
}
public void setSize(Long size) {
Size = size;
}
public Long getWidth() {
return Width;
}
public void setWidth(Long width) {
Width = width;
}
public List<CallbackStreamInfo> getStreamInfos() {
return StreamInfos;
}
public void setStreamInfos(List<CallbackStreamInfo> streamInfos) {
StreamInfos = streamInfos;
}
public String getCoverUrl() {
return CoverUrl;
}
public void setCoverUrl(String coverUrl) {
CoverUrl = coverUrl;
}
public String[] getSnapshots() {
return Snapshots;
}
public void setSnapshots(String[] snapshots) {
Snapshots = snapshots;
}
public String getData() {
return Data;
}
public void setData(String data) {
Data = data;
}
public String getCreationTime() {
return CreationTime;
}
public void setCreationTime(String creationTime) {
CreationTime = creationTime;
}
public String getAuditStatus() {
return AuditStatus;
}
public void setAuditStatus(String auditStatus) {
AuditStatus = auditStatus;
}
public String getMediaId() {
return MediaId;
}
public void setMediaId(String mediaId) {
MediaId = mediaId;
}
}

View File

@@ -0,0 +1,124 @@
package com.cool.store.utils.vod;
/**
* Created by Joshua on 2017/9/28 13:09
*/
public class CallbackStreamInfo {
private String Status;// 视频流转码状态取值success(成功)fail(失败)
private Float Bitrate;// 视频流码率单位Kbps
private String Definition;// 视频流清晰度定义, 取值FD(流畅)LD(标清)SD(高清)HD(超清)OD(原画)2K(2K)4K(4K)
private Float Duration;// 视频流长度,单位秒
private Boolean Encrypt;// 视频流是否加密流
private String ErrorCode;// 视频流转码出错的时候,会有该字段表示出错代码
private String ErrorMessage;// 视频流转码出错的时候,会有该字段表示出错信息
private String FileUrl;// 视频流的播放地址不带鉴权的auth_key如果开启了播放鉴权此地址会无法访问
private String Format;// 视频流格式取值mp4, m3u8
private Float Fps;// 视频流帧率,每秒多少帧
private Long Height;// 视频流高度单位px
private Long Size;// 视频流大小单位Byte
private Long Width;// 视频流宽度单位px
public String getStatus() {
return Status;
}
public void setStatus(String status) {
Status = status;
}
public Float getBitrate() {
return Bitrate;
}
public void setBitrate(Float bitrate) {
Bitrate = bitrate;
}
public String getDefinition() {
return Definition;
}
public void setDefinition(String definition) {
Definition = definition;
}
public Float getDuration() {
return Duration;
}
public void setDuration(Float duration) {
Duration = duration;
}
public Boolean getEncrypt() {
return Encrypt;
}
public void setEncrypt(Boolean encrypt) {
Encrypt = encrypt;
}
public String getErrorCode() {
return ErrorCode;
}
public void setErrorCode(String errorCode) {
ErrorCode = errorCode;
}
public String getErrorMessage() {
return ErrorMessage;
}
public void setErrorMessage(String errorMessage) {
ErrorMessage = errorMessage;
}
public String getFileUrl() {
return FileUrl;
}
public void setFileUrl(String fileUrl) {
FileUrl = fileUrl;
}
public String getFormat() {
return Format;
}
public void setFormat(String format) {
Format = format;
}
public Float getFps() {
return Fps;
}
public void setFps(Float fps) {
Fps = fps;
}
public Long getHeight() {
return Height;
}
public void setHeight(Long height) {
Height = height;
}
public Long getSize() {
return Size;
}
public void setSize(Long size) {
Size = size;
}
public Long getWidth() {
return Width;
}
public void setWidth(Long width) {
Width = width;
}
}

View File

@@ -0,0 +1,29 @@
package com.cool.store.utils.vod;
/**
* Created by Joshua on 2017/9/28 13:41
*/
public class EventType {
/**
* 视频上传完成
*/
public static final String FileUploadComplete = "FileUploadComplete";
/**
* 视频截图完成
*/
public static final String SnapshotComplete = "SnapshotComplete";
/**
* 视频单个清晰度转码完成
*/
public static final String StreamTranscodeComplete = "StreamTranscodeComplete";
/**
* 视频全部清晰度转码完成
*/
public static final String TranscodeComplete = "TranscodeComplete";
/**
* 智能审核
*/
public static final String AIMediaAuditComplete = "AIMediaAuditComplete";
public static final String CreateAuditComplete = "CreateAuditComplete";
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.utils.vod;
import lombok.Data;
import java.util.Date;
/**
* @author chenyupeng
* @since 2021/10/11
*/
@Data
public class SmallVideoParam {
/**
* 企业id
*/
private String enterpriseId;
/**
* 任务id
*/
private Long businessId;
/**
* 转码视频videoId
*/
private String videoId;
/**
*
* 上传类型
*/
private Integer uploadType;
/**
* 上传时间
*/
private Date uploadTime;
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.utils.vod;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
/**
* @Title UserData
* @Description vod服务UserData参数
* @Author zhucg
*/
@Data
public class UserData {
/**
* 回调设置
*/
@JSONField(name = "MessageCallback")
private MessageCallback messageCallback;
public void setCallBack(String callBackUrl) {
this.messageCallback = new MessageCallback();
this.messageCallback.setCallbackURL(callBackUrl);
}
@Data
public class MessageCallback {
@JSONField(name = "CallbackURL")
private String callbackURL;
}
}

View File

@@ -28,4 +28,7 @@ public class FirstOrderDAO {
public FirstOrderDTO selectFirstOrderByShopId(Long shopId) {
return firstOrderMapper.selectByShopId(shopId);
}
public Integer updateByPrimaryKeySelective(FirstOrderDO firstOrderDO) {
return firstOrderMapper.updateByPrimaryKeySelective(firstOrderDO);
}
}

View File

@@ -3,6 +3,7 @@ package com.cool.store.dao;
import com.cool.store.entity.LinePayDO;
import com.cool.store.mapper.LinePayMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
@@ -22,10 +23,6 @@ public class LinePayDAO {
@Resource
private LinePayMapper linePayMapper;
public LinePayDO getLinePayByLineId(Long lineId) {
LinePayDO linePayDO = linePayMapper.getLinePayByLineId(lineId);
return linePayDO;
}
public LinePayDO getByLineIdAndPayTypeAndShopId(Long lineId,Integer payBusinessType,Long shopId) {
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId,payBusinessType,shopId);
@@ -33,11 +30,12 @@ public class LinePayDAO {
}
/**
* //todo 全部替换掉后弃用
*
* @param lineId
* @param payBusinessType
* @return
*/
@Deprecated
public LinePayDO getLinePayByLineIdAndPayType(Long lineId,Integer payBusinessType) {
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId,payBusinessType,null);
return linePayDO;
@@ -56,12 +54,19 @@ public class LinePayDAO {
}
public Map<Long,LinePayDO> getLinePayByLineIds(List<Long> lineIds) {
if(Objects.isNull(lineIds) || lineIds.size() == 0){
public Map<Long,LinePayDO> getLinePayByLineIds(List<Long> lineIds,Integer payBusinessType) {
if(CollectionUtils.isEmpty(lineIds)){
return new HashMap<>();
}
List<LinePayDO> linePayDO = linePayMapper.getLinePayByLineIds(lineIds);
List<LinePayDO> linePayDO = linePayMapper.getLinePayByLineIds(lineIds,null,payBusinessType);
return linePayDO.stream().collect(Collectors.toMap(LinePayDO::getLineId, linePayDO1 -> linePayDO1, (o, n) -> o));
}
public Map<Long,LinePayDO> getLinePayByShopIds(List<Long> shopIds,Integer payBusinessType) {
if(CollectionUtils.isEmpty(shopIds)){
return new HashMap<>();
}
List<LinePayDO> linePayDO = linePayMapper.getLinePayByLineIds(null,shopIds,payBusinessType);
return linePayDO.stream().collect(Collectors.toMap(LinePayDO::getShopId, linePayDO1 -> linePayDO1, (o, n) -> o));
}
}

View File

@@ -1,7 +1,10 @@
package com.cool.store.mapper;
import com.cool.store.entity.FranchiseFeeDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
public interface FranchiseFeeMapper extends Mapper<FranchiseFeeDO> {
FranchiseFeeDO selectByShopId(@Param("shopId") Long shopId);
}

View File

@@ -50,7 +50,7 @@ public interface LinePayMapper {
* @param lineIds
* @return
*/
List<LinePayDO> getLinePayByLineIds(@Param("lineIds") List<Long> lineIds);
List<LinePayDO> getLinePayByLineIds(@Param("lineIds") List<Long> lineIds, @Param("shopIds") List<Long> shopIds, @Param("businessType") Integer businessType);
void updateByPidAndLid(@Param("lineId") Long lineId,
@Param("partnerId") String partnerId,

View File

@@ -84,7 +84,7 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
/**
* @Auther: wangshuo
* @Date: 2024/5/3
* @description:根据区域id查询所有处于装修验收阶段的店铺
* @description:根据区域id查询所有处于的店铺
*/
List<ShopInfoDO> selectShopListByRegionId(@Param("regionIds") List<Long> regionIds,@Param("status")Integer status);
}

View File

@@ -17,7 +17,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<select id="selectByShopId" resultType="com.cool.store.dto.openPreparation.FirstOrderDTO">
select total_order_deposit as totalOrderDeposit, latest_payment_date as latestPaymentDate ,
select id, total_order_deposit as totalOrderDeposit, latest_payment_date as latestPaymentDate ,
estimated_cost as estimatedCost ,fruits_cost as fruitsCost
from xfsg_first_order
where shop_id = #{shopId}

View File

@@ -2,4 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.FranchiseFeeMapper">
<select id="selectByShopId" resultType="com.cool.store.entity.FranchiseFeeDO">
select *
from xfsg_franchise_fee
where shop_id = #{shopId}
</select>
</mapper>

View File

@@ -101,7 +101,10 @@
deleted,
</if>
<if test="payBusinessType !=null">
pay_business_type
pay_business_type,
</if>
<if test="shopId !=null">
shop_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -160,7 +163,10 @@
#{deleted,jdbcType=BIT},
</if>
<if test="payBusinessType !=null">
#{payBusinessType,jdbcType=TINYINT}
#{payBusinessType,jdbcType=TINYINT},
</if>
<if test="shopId !=null">
#{shopId},
</if>
</trim>
</insert>
@@ -303,9 +309,11 @@
select <include refid="Base_Column_List"/>
from xfsg_line_pay
<where>
line_id = #{lineId}
and deleted = '0'
deleted = '0'
and pay_business_type = #{payBusinessType}
<if test="lineId != null and lineId != ''">
and line_id = #{lineId}
</if>
<if test="shopId != null and shopId != ''">
and shop_id = #{shopId}
</if>
@@ -314,10 +322,20 @@
<select id="getLinePayByLineIds" resultMap="BaseResultMap">
select * from xfsg_line_pay where deleted = 0
<if test="lineIds !=null and lineIds.size>0">
<foreach collection="lineIds" item="lineId" open="and line_id in (" close=")" separator=",">
#{lineId}
</foreach>
</if>
<where>
<if test="businessType!=null">
and pay_business_type = #{businessType}
</if>
<if test="lineIds !=null and lineIds.size>0">
<foreach collection="lineIds" item="lineId" open="and line_id in (" close=")" separator=",">
#{lineId}
</foreach>
</if>
<if test="shopIds !=null and shopIds.size>0">
<foreach collection="shopIds" item="shopId" open="and shop_id in (" close=")" separator=",">
#{shopId}
</foreach>
</if>
</where>
</select>
</mapper>

View File

@@ -161,7 +161,7 @@
</foreach>
</if>
AND xssi.shop_sub_stage_status != -100
and xssi.shop_sub_stage in (120,130)
and xssi.shop_sub_stage = 120
<if test="status != null">
and xssi.shop_sub_stage_status = #{status}
</if>

View File

@@ -0,0 +1,60 @@
package com.cool.store.dto;
import lombok.Data;
/**
* 上传的视频
*
* @author chenyupeng
* @since 2021/10/9
*/
@Data
public class SmallVideoDTO {
/**
* 视频id
*/
private String videoId;
/**
* 视频url
*/
private String videoUrl;
/**
* 原视频url
*/
private String videoUrlBefore;
/**
* 视频截图封面
*/
private String videoSnapshot;
/**
* 视频大小
*/
private Long size;
/**
* 转码状态
* @see com.coolcollege.intelligent.common.enums.video.ResourceStatusEnum
*/
private Integer status;
/**
* 上传是否完成
*/
private boolean uploadStatus = false;
/**
* 截图是否完成
*/
private boolean snapShotStatus = false;
/**
* 转码是否完成
*/
private boolean transCodeStatus = false;
}

View File

@@ -0,0 +1,24 @@
package com.cool.store.dto;
import lombok.Data;
import java.util.List;
/**
* @author chenyupeng
* @since 2021/10/12
*/
@Data
public class SmallVideoInfoDTO {
/**
* 视频集合
*/
private List<SmallVideoDTO> videoList;
/**
* 音频合计
*/
private List<String> soundRecordingList;
}

View File

@@ -15,12 +15,12 @@ import java.util.Date;
*/
@Data
public class FirstOrderDTO {
private Long id;
@ApiModelProperty("店铺Id")
private Long shopId;
@ApiModelProperty("首批订货金总额")
private String totalOrderDeposit;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("最晚打款时间")
private Date latestPaymentDate;

View File

@@ -8,7 +8,7 @@ import lombok.Data;
import java.util.Date;
@Data
public class LicenseListRequest extends PageBasicInfo {
public class LicenseListRequest extends PageBasicInfo{
@ApiModelProperty("门店名称")
private String storeName;
@@ -21,5 +21,13 @@ public class LicenseListRequest extends PageBasicInfo {
@ApiModelProperty("审核状态 1待通过 2未通过 3已通过")
private Integer status;
public LicenseListRequest(Integer pageNum,Integer pageSize,String storeName, Long submitStartTime, Long submitEndTime, String regionId, Integer status) {
setPageNum(pageNum);
setPageSize(pageSize);
this.storeName = storeName;
this.submitStartTime = submitStartTime;
this.submitEndTime = submitEndTime;
this.regionId = regionId;
this.status = status;
}
}

View File

@@ -15,7 +15,6 @@ public class LinePaySubmitRequest {
private String partnerId;
@ApiModelProperty("line_info.id")
@NotNull(message = "线索id不能为空")
private Long lineId;
@ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败")

View File

@@ -39,7 +39,7 @@ public class OpeningOperationPlanRequest {
@ApiModelProperty("筹备人员ids")
private List<String> preparationUserIds;
@ApiModelProperty("是否完成排车路线")
@ApiModelProperty("是否完成排车路线0未完成1完成")
private Byte routeCompleted;

View File

@@ -15,7 +15,7 @@ import java.util.List;
* @注释:
*/
@Data
public class PlanListRequest extends PageBasicInfo {
public class PlanListRequest {
@ApiModelProperty("店铺名称")
private String shopName;
@ApiModelProperty("起始日期")
@@ -26,8 +26,9 @@ public class PlanListRequest extends PageBasicInfo {
private List<String> regionIds;
@ApiModelProperty("审核状态")
private Integer resultType;
@ApiModelProperty(value = "当前登录用户", hidden = true)
private String curUserId;
@ApiModelProperty(value = "管辖区域",hidden = true)
private List<String> authRegionIds;
@ApiModelProperty ("页码")
private Integer pageNumber;
@ApiModelProperty ("分页大小")
private Integer pageSize;
}

View File

@@ -28,5 +28,5 @@ public class DecorationStageVO {
@ApiModelProperty("计划结束时间")
private String planEndTime;
@ApiModelProperty("实际完成时间")
private String actualCompleteTime;
private String actualEndTime;
}

View File

@@ -32,7 +32,7 @@ public interface DecorationService {
/**
* @Auther: wangshuo
* @Date: 2024/5/3
* @description:获取新店装修阶段的数据
* @description:获取新店装修阶段的数据/flush
*/
FitmentResponse getFitmentSub(Long shopId);
@@ -53,7 +53,7 @@ public interface DecorationService {
* @Date: 2024/4/28
* @description:获取装修款和支付二维码
*/
DecorationModelDTO DecorationModel(Long shopId);
DecorationModelDTO decorationModel(Long shopId);
/**
* @Auther: wangshuo
* @Date: 2024/4/28

View File

@@ -11,7 +11,7 @@ import com.cool.store.vo.PartnerUserInfoVO;
*/
public interface LinePayService {
LinePayVO getLinePayInfo(Long lineId);
LinePayVO getLinePayInfo(Long lineId,Integer businessType,Long shopId);
Long submitPayInfo(LinePaySubmitRequest followLog, PartnerUserInfoVO partnerUser);

View File

@@ -0,0 +1,12 @@
package com.cool.store.service;
import com.cool.store.utils.vod.CallbackRequest;
/**
* @author byd
* @date 2024-05-07 19:27
*/
public interface VodService {
void callback(CallbackRequest request);
}

View File

@@ -107,6 +107,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
@Override
public SubmitLicenseResponse getDefault(Long shopId) {
//todo 业务逻辑问题 @zhy
//1.如果已经提交过证照信息,直接查询后组装数据返回
LicenseTransactDO result = applyLicenseMapper.selectByShopId(shopId);
SubmitLicenseResponse submitLicenseResponse = new SubmitLicenseResponse();

View File

@@ -10,6 +10,7 @@ import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
import com.cool.store.dto.openPreparation.UserNameDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.enums.point.ShopStageEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
@@ -34,6 +35,7 @@ import com.cool.store.vo.PartnerUserInfoVO;
import com.cool.store.vo.fitmentCheckVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,6 +47,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -103,10 +106,6 @@ public class DecorationServiceImpl implements DecorationService {
//施工阶段
this.getConstructionInfo(shopId);
stageInfoList.add(getDecorationStageVOS(shopId, ShopSubStageEnum.SHOP_STAGE_11));
//TODO 三方验收
stageInfoList.add(getDecorationStageVOS(shopId, ShopSubStageEnum.SHOP_STAGE_12));
//TODO 视觉验收
stageInfoList.add(getDecorationStageVOS(shopId, ShopSubStageEnum.SHOP_STAGE_13));
fitmentResponse.setStageInfoList(stageInfoList);
return fitmentResponse;
}
@@ -119,7 +118,7 @@ public class DecorationServiceImpl implements DecorationService {
decorationStageVO.setShopSubStageName(shopSubStageEnum.getShopSubStageName());
decorationStageVO.setCreatTime(ShopStage.getCreateTime());
decorationStageVO.setPlanEndTime(ShopStage.getPlanCompleteTime());
decorationStageVO.setActualCompleteTime(ShopStage.getActualCompleteTime());
decorationStageVO.setActualEndTime(ShopStage.getActualCompleteTime());
return decorationStageVO;
}
@@ -130,68 +129,44 @@ public class DecorationServiceImpl implements DecorationService {
log.error("拉取云立方接口获取数据为空");
return null;
}
AtomicInteger flag = new AtomicInteger(0);
Long flag ;
DesignInfoVo designInfoVo = new DesignInfoVo();
//平面图和施工
List<DesignSchemeDTO> designScheme = decoration.getDesignScheme();
if (designScheme != null && designScheme.size() > CommonConstants.ZERO) {
Map<String, DesignSchemeDTO> designSchemeMap = designScheme.stream().collect(Collectors.toMap(DesignSchemeDTO::getName, dto -> dto));
List<DesignSchemeDTO> designSchemeDTOS = new ArrayList<>();
//平面图
DesignSchemeDTO planeGraph = designSchemeMap.get(CommonConstants.FLOOR_PLAN);
if (Objects.nonNull(planeGraph)) {
designSchemeDTOS.add(planeGraph);
if (DesignPhaseEnum.DESIGN_PHASE_ACCEPTANCE_PASS.getCode().equals(planeGraph.getStatus())) {
flag.incrementAndGet();
}
}
//施工图
DesignSchemeDTO constructionDrawing = designSchemeMap.get(CommonConstants.CONSTRUCTION_DRAWING);
if (Objects.nonNull(constructionDrawing)) {
designSchemeDTOS.add(designSchemeMap.get(CommonConstants.CONSTRUCTION_DRAWING));
if (DesignPhaseEnum.DESIGN_PHASE_ACCEPTANCE_PASS.getCode().equals(constructionDrawing.getStatus())) {
flag.incrementAndGet();
}
}
designInfoVo.setDesignScheme(designSchemeDTOS);
}
long count = designScheme.stream().filter(design -> DesignPhaseEnum.DESIGN_PHASE_ACCEPTANCE_PASS.getCode().equals(design.getStatus())).count();
flag = count;
designInfoVo.setDesignScheme(designScheme);
List<ConstructionScheduleDTO> constructionSchedule = decoration.getConstructionSchedule();
if (constructionSchedule != null && constructionSchedule.size() > CommonConstants.ZERO) {
if (CollectionUtils.isNotEmpty(constructionSchedule)) {
Map<String, ConstructionScheduleDTO> constructionScheduleMap = constructionSchedule.stream().collect(Collectors.toMap(ConstructionScheduleDTO::getName,
dto -> dto));
if (constructionScheduleMap != null && constructionScheduleMap.size() > 0) {
Function.identity(), (a, b) -> b));
if (CollectionUtils.isNotEmpty(constructionSchedule)) {
//量房
ConstructionScheduleDTO measuringRoom = constructionScheduleMap.get(CommonConstants.MEASURING_THE_ROOM);
if (Objects.nonNull(measuringRoom)) {
designInfoVo.setMeasuringRoom(measuringRoom);
if (ConstructionPhaseEnum.construction_FINSH.getCode().equals(measuringRoom.getState())) {
flag.incrementAndGet();
flag++;
}
}
}
}
//预算
//预算 TODO 产品
List<BudgetDTO> proposedBookBudget = decoration.getProposedBookBudget();
Collections.sort(decoration.getProposedBookBudget(), (x1, x2) -> x2.getId().compareTo(x1.getId()));
if (!proposedBookBudget.isEmpty()) {
BudgetDTO budgetDTO = proposedBookBudget.get(CommonConstants.ZERO);
designInfoVo.setProposedBookBudget(budgetDTO);
flag.incrementAndGet();
flag++;
}
if (flag.get() == CommonConstants.FOUR) {
if (flag == CommonConstants.FOUR) {
//如果设计阶段未完成
if (!ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91.getShopSubStageStatus().
equals(shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_9).getShopSubStageStatus())) {
//更新设计阶段状态完成
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91);
//初始化装修款阶段
List<ShopStageInfoDO> list = new ArrayList<>();
List<ShopStageInfoDO> shopStageInfo = shopStageInfoDAO.getShopStageInfo(shopId, null);
Map<Integer, ShopStageInfoDO> shopStageInfoDOMap = shopStageInfo.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopSubStage, data -> data));
ShopStageInfoDO data = shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_10.getShopSubStage());
data.setShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_100.getShopSubStageStatus());
list.add(data);
shopStageInfoDAO.batchUpdate(list);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91,
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_100));
}
}
@@ -208,13 +183,13 @@ public class DecorationServiceImpl implements DecorationService {
DecorationStageVO decorationStageVO = new DecorationStageVO();
decorationStageVO.setShopSubStageStatus(shopSubStageInfo.getShopSubStageStatus());
decorationStageVO.setPlanBeginTime(shopSubStageInfo.getPlanCompleteTime());
decorationStageVO.setActualCompleteTime(shopSubStageInfo.getActualCompleteTime());
decorationStageVO.setActualEndTime(shopSubStageInfo.getActualCompleteTime());
return decorationStageVO;
}
@Override
public DecorationModelDTO DecorationModel(Long shopId) {
public DecorationModelDTO decorationModel(Long shopId) {
DecorationDTO decoration = getDecorationDTO(shopId);
if (decoration == null) {
log.error("拉取云立方接口获取数据为空");
@@ -222,11 +197,13 @@ public class DecorationServiceImpl implements DecorationService {
}
//预算
List<BudgetDTO> proposedBookBudget = decoration.getProposedBookBudget();
Collections.sort(decoration.getProposedBookBudget(), (x1, x2) -> x2.getId().compareTo(x1.getId()));
if (proposedBookBudget.isEmpty()) {
if (CollectionUtils.isEmpty(proposedBookBudget)) {
log.error("云立方获取预算 is null");
return null;
}
//TODO 抽出
Collections.sort(decoration.getProposedBookBudget(), (x1, x2) -> x2.getId().compareTo(x1.getId()));
//TODO 产品是否 最新
String totalAmount = proposedBookBudget.get(0).getTotalAmount();
//支付二维码url
Long regionId = shopInfoDAO.getRegionIdByid(shopId);
@@ -245,7 +222,7 @@ public class DecorationServiceImpl implements DecorationService {
log.error("拉取云立方接口获取数据为空");
return null;
}
if (!decoration.getPayment().isEmpty()) {
if (CollectionUtils.isNotEmpty(decoration.getPayment())) {
request.setPayStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode());
//更新阶段状态
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_102);
@@ -262,9 +239,10 @@ public class DecorationServiceImpl implements DecorationService {
@Transactional(rollbackFor = Exception.class)
public DecorationModelVO getDecorationModel(Long shopId, PartnerUserInfoVO partnerUserInfoVO) {
//获取支付信息
//Todo getLinePayInfo
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
Long lineId = shopInfo.getLineId();
LinePayVO linePayInfo = linePayService.getLinePayInfo(lineId);
LinePayVO linePayInfo = linePayService.getLinePayInfo(lineId, PayBusinessTypeEnum.DECORATION_MODEL.getCode(), shopId);
if (Objects.isNull(linePayInfo)) {
log.error("LinePayInfo is null");
return null;
@@ -299,10 +277,12 @@ public class DecorationServiceImpl implements DecorationService {
return null;
}
String totalAmount = proposedBookBudget.get(0).getTotalAmount();
//已完成 TODO 改状态是否能单独提出
if (!decoration.getPayment().isEmpty()) {
linePayInfo.setPayStatus((byte) WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode().intValue());
LinePaySubmitRequest submitRequest = new LinePaySubmitRequest();
BeanUtil.copyProperties(linePayInfo, submitRequest);
linePayService.submitPayInfo(submitRequest, partnerUserInfoVO);
//更新阶段状态
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_102);
@@ -325,6 +305,7 @@ public class DecorationServiceImpl implements DecorationService {
Map<String, ConstructionScheduleDTO> constructionScheduleMap = constructionSchedule.stream().collect(Collectors.toMap(ConstructionScheduleDTO::getName,
dto -> dto));
List<ConstructionScheduleDTO> collect = new ArrayList<>();
//TODO 把namefangjinlist 用collect.contains()
collect.add(constructionScheduleMap.get(CommonConstants.APPROACH));
collect.add(constructionScheduleMap.get(CommonConstants.ONE_DAY));
collect.add(constructionScheduleMap.get(CommonConstants.TWO_DAY));
@@ -336,20 +317,19 @@ public class DecorationServiceImpl implements DecorationService {
collect.add(constructionScheduleMap.get(CommonConstants.EIGHT_DAY));
collect.add(constructionScheduleMap.get(CommonConstants.WITHDRAWAL));
collect.sort(Comparator.comparing(ConstructionScheduleDTO::getId));
//设置进场时间xfsg_acceptance_info
//设置进场时间xfsg_acceptance_info TODO 用工具类
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId);
if (Objects.nonNull(acceptanceInfoDO) && StringUtils.isNotEmpty(constructionScheduleMap.get(CommonConstants.APPROACH).getActualBeginDate())) {
if (StringUtils.isNotEmpty(constructionScheduleMap.get(CommonConstants.APPROACH).getActualBeginDate())) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = sdf.parse(constructionScheduleMap.get(CommonConstants.APPROACH).getActualBeginDate());
acceptanceInfoDO.setActualEntryTime(date);
} catch (ParseException e) {
log.error("转化进场时间类型异常");
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = sdf.parse(constructionScheduleMap.get(CommonConstants.APPROACH).getActualBeginDate());
acceptanceInfoDO.setActualEntryTime(date);
} catch (ParseException e) {
log.error("转化进场时间类型异常");
}
}
//施工完成时间,计划开始和完成时间
//施工完成时间,计划开始和完成时间 //TODO 工具类处理为空
if (StringUtils.isNotEmpty(constructionScheduleMap.get(CommonConstants.CONSTRUCTION_PHASE).getActualEndDate())) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
@@ -407,6 +387,7 @@ public class DecorationServiceImpl implements DecorationService {
@Transactional(rollbackFor = Exception.class)
public Boolean submitThreeCheck(ThreeAcceptanceCheckRequest request) {
log.info("submitThreeCheck, request:{} ", JSONObject.toJSONString(request));
//TODO 未确定
Boolean flag = assessmentDataDAO.deleteByShopId(request.getShopId());
if (Boolean.FALSE.equals(flag)) {
log.error("三方验收插入检查项失败");
@@ -429,8 +410,9 @@ public class DecorationServiceImpl implements DecorationService {
@Override
public ThreeAcceptanceCheckRequest getThreeChecks(Long shopId) {
//sql 确定范围
List<AssessmentDataDO> assessmentDataDOS = assessmentDataDAO.selectListByShopId(shopId);
if (assessmentDataDOS.isEmpty()) {
if (CollectionUtils.isEmpty(assessmentDataDOS)) {
log.error("该用户门店三方验收检查项为空");
return null;
}
@@ -635,35 +617,17 @@ public class DecorationServiceImpl implements DecorationService {
//工程部
if (StringUtils.isNotEmpty(acceptanceInfoDO.getEngineeringAcceptanceSignatures())) {
ThreeAcceptanceDTO engineering = JSONObject.parseObject(acceptanceInfoDO.getEngineeringAcceptanceSignatures(), ThreeAcceptanceDTO.class);
ThreeAcceptanceDTO engineeringDTO = new ThreeAcceptanceDTO();
engineeringDTO.setPic(engineering.getPic());
engineeringDTO.setRemark(engineering.getRemark());
engineeringDTO.setResult(engineering.getResult());
engineeringDTO.setAcceptanceTime(engineering.getAcceptanceTime());
engineeringDTO.setStatus(engineering.getStatus());
threeSignResponse.setEngineeringAcceptance(engineeringDTO);
threeSignResponse.setEngineeringAcceptance(engineering);
}
//营运部
if (StringUtils.isNotEmpty(acceptanceInfoDO.getOperationsAcceptanceSignatures())) {
ThreeAcceptanceDTO operations = JSONObject.parseObject(acceptanceInfoDO.getOperationsAcceptanceSignatures(), ThreeAcceptanceDTO.class);
ThreeAcceptanceDTO operationsDTO = new ThreeAcceptanceDTO();
operationsDTO.setPic(operations.getPic());
operationsDTO.setRemark(operations.getRemark());
operationsDTO.setResult(operations.getResult());
operationsDTO.setAcceptanceTime(operations.getAcceptanceTime());
operationsDTO.setStatus(operations.getStatus());
threeSignResponse.setOperationsAcceptance(operationsDTO);
threeSignResponse.setOperationsAcceptance(operations);
}
//加盟商
if (StringUtils.isNotEmpty(acceptanceInfoDO.getPartnerAcceptanceSignatures())) {
ThreeAcceptanceDTO partner = JSONObject.parseObject(acceptanceInfoDO.getPartnerAcceptanceSignatures(), ThreeAcceptanceDTO.class);
ThreeAcceptanceDTO partnerDTO = new ThreeAcceptanceDTO();
partnerDTO.setPic(partner.getPic());
partnerDTO.setRemark(partner.getRemark());
partnerDTO.setResult(partner.getResult());
partnerDTO.setAcceptanceTime(partner.getAcceptanceTime());
partnerDTO.setStatus(partner.getStatus());
threeSignResponse.setPartnerAcceptance(partnerDTO);
threeSignResponse.setPartnerAcceptance(partner);
}
return threeSignResponse;
}
@@ -671,6 +635,7 @@ public class DecorationServiceImpl implements DecorationService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean bookingAcceptance(BookingAcceptanceRequest request) {
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121);
ShopStageInfoDO newShopStageInfoDO = new ShopStageInfoDO();
newShopStageInfoDO.setPlanCompleteTime(request.getBookingAcceptanceTime().toString());
@@ -681,10 +646,13 @@ public class DecorationServiceImpl implements DecorationService {
private DecorationDTO getDecorationDTO(Long shopId) {
List<Long> shopIds = new ArrayList<>();
shopIds.add(shopId);
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = shopInfoDAO.queryStoreNumeListByid(shopIds);
String storeNum = openPlanShopInfoDTOS.get(0).getStoreNum();
//TODO
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
}
String storeNum = shopInfo.getStoreNum();
if (StringUtils.isNotEmpty(storeNum)) {
ProjectDTO projectList = ylfService.getProjectList(storeNum);
String projectId = projectList.getProjectId();

View File

@@ -9,6 +9,8 @@ import com.cool.store.dto.openPreparation.PlanLineDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.InterviewTypeEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.enums.point.PayTypeEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.mapper.IntentAgreementMapper;
@@ -178,7 +180,7 @@ public class DeskServiceImpl implements DeskService {
List<Long> wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
List<Long> lineIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getId() != null).map(LineInfoDO::getId).collect(Collectors.toList());
Map<Long, LinePayDO> payMap = linePayDAO.getLinePayByLineIds(lineIds);
Map<Long, LinePayDO> payMap = linePayDAO.getLinePayByLineIds(lineIds,PayBusinessTypeEnum.INTENT_MONEY.getCode());
List<PayStagePendingVO> list = new ArrayList<>();
lineInfoDOS.forEach(x->{
BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
@@ -377,13 +379,21 @@ public class DeskServiceImpl implements DeskService {
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
Map<Long, LinePayDO> shopPayDoMap = new HashMap<>(16);
if (ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())){
shopPayDoMap = linePayDAO.getLinePayByShopIds(shopIds, PayBusinessTypeEnum.FRANCHISE_FEE.getCode());
}
List<PreparationCommonPendingVO> list = new ArrayList<>();
Map<Long, LinePayDO> finalShopPayDoMap = shopPayDoMap;
specialShopStageInfo.forEach(x->{
PreparationCommonPendingVO preparationCommonPendingVO = new PreparationCommonPendingVO();
preparationCommonPendingVO.setLineId(x.getLineId());
preparationCommonPendingVO.setShopId(x.getShopId());
preparationCommonPendingVO.setSubStageStatus(x.getShopSubStageStatus());
ShopInfoDO shopInfoDO = shopInfoMap.getOrDefault(x.getShopId(),new ShopInfoDO());
preparationCommonPendingVO.setSubmitTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START,finalShopPayDoMap.getOrDefault(x.getShopId(), new LinePayDO()).getCreateTime()));
preparationCommonPendingVO.setStoreName(shopInfoDO.getShopName());
PlanLineDTO planLineDTO = lineMap.getOrDefault(x.getLineId(), new PlanLineDTO());
preparationCommonPendingVO.setPartnerName(planLineDTO.getUsername());

View File

@@ -1,6 +1,7 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.FirstOrderDAO;
@@ -22,10 +23,12 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import java.util.Objects;
/**
@@ -64,32 +67,35 @@ public class FirstOrderServiceImp implements FirstOrderService {
throw new RuntimeException(e);
}
FirstOrderDTO firstOrderDTO = firstOrderDAO.selectFirstOrderByShopId(order.getShopId());
if (firstOrderDTO == null) {
Integer num;
if (Objects.isNull(firstOrderDTO)) {
//第一次提交
order.setCreateTime(new Date());
order.setCreateUserId(userId);
num = firstOrderDAO.insertFirstOrder(order);
} else {
//修改只更新下面2个
order.setId(firstOrderDTO.getId());
order.setUpdateTime(new Date());
order.setUpdateUserId(userId);
num = firstOrderDAO.updateByPrimaryKeySelective(order);
}
//修改只更新下面2个
order.setUpdateTime(new Date());
order.setUpdateUserId(userId);
Integer num = firstOrderDAO.insertFirstOrder(order);
shopStageInfoDAO.updateShopStageAndAuditInfo(order.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152, null);
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152);
//云立方同步
if (num > 0) {
try {
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
String storeNum = shopInfo.getStoreNum();
Boolean flag = coolStoreStartFlowService.getFirstOrder(storeNum);
Boolean flag = coolStoreStartFlowService.getFirstOrder(storeNum);
log.info("saveOrder,flag:{}", flag);
if (flag == null) {
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
}
if (flag) {
//更改子阶段状态
shopStageInfoDAO.updateShopStageAndAuditInfo(order.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151, null);
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151);
preparationService.whetherToOpenForAcceptance(order.getShopId());
}
} catch (Exception e) {
@@ -98,7 +104,7 @@ public class FirstOrderServiceImp implements FirstOrderService {
}
return num;
}
@Transactional(rollbackFor = Exception.class)
@Override
public FirstOrderDTO getOrder(Long shopId) {
log.info("getOrder shopId:{},", shopId);
@@ -107,9 +113,29 @@ public class FirstOrderServiceImp implements FirstOrderService {
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
}
FirstOrderDTO order = firstOrderDAO.selectFirstOrderByShopId(shopId);
ShopStageInfoDO firstOrderStageInfo = shopStageInfoDAO.
getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
order.setFirstOrderSubStage(firstOrderStageInfo.getShopSubStageStatus());
if (Objects.nonNull(order)) {
try {
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
String storeNum = shopInfo.getStoreNum();
Boolean flag = coolStoreStartFlowService.getFirstOrder(storeNum);
log.info("saveOrder,flag:{}", flag);
if (flag == null) {
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
}
if (flag) {
//更改子阶段状态
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151);
order.setFirstOrderSubStage( ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());
preparationService.whetherToOpenForAcceptance(order.getShopId());
}else {
order.setFirstOrderSubStage(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus());
}
} catch (Exception e) {
log.error("获取鲜丰订货金异常", e);
}
}
return order;
}
}

View File

@@ -101,10 +101,11 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
shopAuditInfoDO.setRejectReason(request.getResult());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74;
}
//更新阶段信息
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), shopSubStageStatusEnum);
//插入audit
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
//更新阶段信息
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_80);
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), shopSubStageStatusEnum,shopAuditInfoDO.getId());
//更新auditId
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByPrimaryKey(request.getId());
franchiseFeeDO.setAuditId(shopAuditInfoDO.getId());

View File

@@ -1,6 +1,7 @@
package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.HyPartnerUserInfoDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.LinePayDAO;
@@ -23,6 +24,7 @@ import com.cool.store.service.LinePayService;
import com.cool.store.utils.poi.constant.Constants;
import com.cool.store.vo.LinePayVO;
import com.cool.store.vo.PartnerUserInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
@@ -38,6 +40,7 @@ import java.util.Objects;
* @Version 1.0
*/
@Service
@Slf4j
public class LinePayServiceImpl implements LinePayService {
@Resource
@@ -53,9 +56,9 @@ public class LinePayServiceImpl implements LinePayService {
ShopStageInfoDAO shopStageInfoDAO;
@Override
public LinePayVO getLinePayInfo(Long lineId) {
public LinePayVO getLinePayInfo(Long lineId,Integer businessType,Long shopId) {
LinePayVO result = null;
LinePayDO linePayDO = linePayDAO.getLinePayByLineId(lineId);
LinePayDO linePayDO = linePayDAO.getByLineIdAndPayTypeAndShopId(lineId,businessType,shopId);
if (linePayDO != null) {
result = new LinePayVO();
BeanUtil.copyProperties(linePayDO, result);
@@ -68,59 +71,44 @@ public class LinePayServiceImpl implements LinePayService {
@Override
@Transactional(rollbackFor = Exception.class)
public Long submitPayInfo(LinePaySubmitRequest request, PartnerUserInfoVO partnerUser) {
public Long submitPayInfo(LinePaySubmitRequest request, PartnerUserInfoVO partnerUser){
log.info("submitPayInfo request{}partnerUser{}", JSONObject.toJSONString(request),JSONObject.toJSONString(partnerUser));
LineInfoDO lineInfo = new LineInfoDO();
if (request.getLineId() != null){
lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
}
if (request.getPayBusinessType() != null
&& request.getPayBusinessType() == Constants.ONE_INTEGER
&& request.getShopId() != null) {
LinePayDO linePayDO = linePayDAO.getByLineIdAndPayTypeAndShopId(request.getLineId(), request.getPayBusinessType(),request.getShopId());
if (Objects.isNull(linePayDO)) {
fillLinePay(true, linePayDO, request, partnerUser);
Long aLong = linePayDAO.addLinePay(linePayDO);
FranchiseFeeDO franchiseFeeDO = new FranchiseFeeDO();
franchiseFeeDO.setShopId(request.getShopId());
FranchiseFeeDO result = franchiseFeeMapper.selectOneByExample(franchiseFeeDO);
result.setPayId(aLong);
franchiseFeeMapper.updateByPrimaryKeySelective(result);
} else {
fillLinePay(false, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
LinePayDO linePayDO = linePayDAO.getByLineIdAndPayTypeAndShopId(request.getLineId(), request.getPayBusinessType(),request.getShopId());
Long payId = checkAndFill(linePayDO, request, partnerUser);
if (PayBusinessTypeEnum.FRANCHISE_FEE.getCode().equals(request.getPayBusinessType()) && payId != null){
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(request.getShopId());
if (Objects.isNull(franchiseFeeDO)){
throw new ServiceException(ErrorCodeEnum.UNISSUED_STATEMENT);
}
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
} else if (request.getPayBusinessType() != null
&& request.getPayBusinessType() == PayBusinessTypeEnum.DECORATION_MODEL.getCode()
&& request.getShopId() != null) {
LinePayDO linePayDO = linePayDAO.getLinePayByLineIdAndPayType(request.getLineId(), PayBusinessTypeEnum.DECORATION_MODEL.getCode());
if (linePayDO == null) {
linePayDO = new LinePayDO();
fillLinePay(true, linePayDO, request, partnerUser);
linePayDAO.addLinePay(linePayDO);
} else {
fillLinePay(false, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
}
return linePayDO.getId();
} else {
LinePayDO linePayDO = linePayDAO.getLinePayByLineIdAndPayType(request.getLineId(), 0);
if (linePayDO == null) {
linePayDO = new LinePayDO();
fillLinePay(true, linePayDO, request, partnerUser);
linePayDAO.addLinePay(linePayDO);
} else {
fillLinePay(false, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
}
franchiseFeeDO.setPayId(payId);
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
}
if (PayBusinessTypeEnum.INTENT_MONEY.getCode().equals(request.getPayBusinessType())){
lineInfo.setWorkflowSubStage(WorkflowSubStageEnum.PAY_DEPOSIT.getCode());
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode());
lineInfoDAO.insertOrUpdate(lineInfo);
return linePayDO.getId();
}
return payId == null ? null : payId;
}
return null;
private Long checkAndFill(LinePayDO linePayDO,
LinePaySubmitRequest request,
PartnerUserInfoVO partnerUser) {
if (Objects.isNull(linePayDO)){
linePayDO = new LinePayDO();
fillLinePay(Boolean.TRUE, linePayDO, request, partnerUser);
Long aLong = linePayDAO.addLinePay(linePayDO);
return aLong;
}
else {
fillLinePay(Boolean.FALSE, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
return null;
}
}
private void fillLinePay(Boolean isAdd, LinePayDO linePayDO, LinePaySubmitRequest request, PartnerUserInfoVO partnerUser) {

View File

@@ -8,6 +8,7 @@ import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.*;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.IntentAgreementMapper;
import com.cool.store.mapper.JoinIntentionMapper;
@@ -336,7 +337,7 @@ public class LineServiceImpl implements LineService {
List<LineAuditInfoDO> lineAuditInfoList = lineAuditInfoDAO.getLineAuditInfoList(auditIds);
Map<Long, Date> dateMap = lineAuditInfoList.stream().collect(Collectors.toMap(k -> k.getId(), v -> v.getCreateTime()));
LinePayDO linePay = linePayDAO.getLinePayByLineId(lineId);
LinePayDO linePay = linePayDAO.getByLineIdAndPayTypeAndShopId(lineId,PayBusinessTypeEnum.INTENT_MONEY.getCode(),null);
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(memberQuestionDO.getPartnerId(), lineId);
LeaseBaseInfoDO trainingExperience = trainingExperienceService.getTrainingExperience(lineId);

View File

@@ -31,6 +31,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@@ -61,6 +62,8 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
private UserAuthMappingService userAuthMappingService;
@Resource
private ShopInfoDAO shopInfoDAO;
@Resource
private CoolStoreStartFlowService coolStoreStartFlowService;
@Override
@Transactional(rollbackFor = Exception.class)
@@ -94,15 +97,10 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
openingOperationPlanDO.setCreateUserId(userId);
planId = openingOperationPlanDAO.insertSelective(openingOperationPlanDO);
}
Integer Stage = shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_141, request.getShopId());
if (Objects.isNull(Stage) || Stage == CommonConstants.ZERO) {
log.error("auditPlan stage is null");
throw new ServiceException(ErrorCodeEnum.UPDATE_SHOP_SUB_STAGE_STATUS_FALSE);
}
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_141);
return planId;
} catch (Exception e) {
log.error("addNewPlan Exception:{}", e);
e.printStackTrace();
return null;
}
}
@@ -115,18 +113,19 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
throw new ServiceException(ErrorCodeEnum.SHOP_ID_IS_NULL);
}
OpeningOperationPlanDO openingOperationPlanDO = openingOperationPlanDAO.selectByShopId(shopId);
if (openingOperationPlanDO != null) {
OpeningOperationPlanVO openingOperationPlanVO = new OpeningOperationPlanVO(openingOperationPlanDO);
String preparationUserIds = openingOperationPlanDO.getPreparationUserIds();
List<String> stream = Arrays.stream(preparationUserIds.split(CommonConstants.COMMA)).collect(Collectors.toList());
List<UserNameDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(stream);
EnterpriseUserDO username = enterpriseUserDAO.getUserInfoById(openingOperationPlanDO.getSubmittedUserId());
openingOperationPlanVO.setSubmittedUserName(username.getName());
openingOperationPlanVO.setPreparationUsers(nameByUserId);
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
openingOperationPlanVO.setShopName(shopInfo.getShopName());
return openingOperationPlanVO;
}
if (Objects.nonNull(openingOperationPlanDO) ) {
OpeningOperationPlanVO openingOperationPlanVO = new OpeningOperationPlanVO(openingOperationPlanDO);
String preparationUserIds = openingOperationPlanDO.getPreparationUserIds();
List<String> stream = Arrays.stream(preparationUserIds.split(CommonConstants.COMMA)).collect(Collectors.toList());
List<UserNameDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(stream);
//TODO getname方法
EnterpriseUserDO username = enterpriseUserDAO.getUserInfoById(openingOperationPlanDO.getSubmittedUserId());
openingOperationPlanVO.setSubmittedUserName(username.getName());
openingOperationPlanVO.setPreparationUsers(nameByUserId);
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
openingOperationPlanVO.setShopName(shopInfo.getShopName());
return openingOperationPlanVO;
}
return null;
}
@@ -134,14 +133,12 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
@Override
public PageInfo<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
log.info("getPlanListPage request:{}", JSONObject.toJSONString(request));
if(!sysRoleService.checkIsAdmin(request.getCurUserId())){
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(request.getCurUserId()));
}
PageHelper.startPage(request.getPageNum(), request.getPageSize());
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
//去shop_info表查询店铺名字店铺code开店负责人id督导id区域idlineinfo 加盟商name手机号招商经理id,open_plan,提交时间,审核状态
//TODO 拆表 产品沟通限定时间
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = openingOperationPlanDAO.getOpenPlanShopListByCondition(request);
PageInfo pageInfo = new PageInfo<>(openPlanShopInfoDTOS);
//开店负责人id督导id,招商经理id
//开店负责人id督导id,招商经理id // TODO id 为null过滤
Set<String> userIdset = openPlanShopInfoDTOS.stream()
.map(OpenPlanShopInfoDTO::getShopManagerUserId)
.collect(Collectors.toSet());
@@ -153,23 +150,22 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
.collect(Collectors.toSet()));
List<String> userlist = new ArrayList<>();
userlist.addAll(userIdset);
List<UserNameDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(userlist);
Map<String, UserNameDTO> vonameMap = nameByUserId.stream()
.collect(Collectors.toMap(UserNameDTO::getUserId, vo -> vo));
Map<String, EnterpriseUserDO> vonameMap = enterpriseUserDAO.getUserMap(userlist);
log.info("getPlanListPage vonameMap:{}", JSONObject.toJSONString(vonameMap));
//region
List<Long> regionIds = openPlanShopInfoDTOS.stream().map(OpenPlanShopInfoDTO::getRegionId).collect(Collectors.toList());
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
List<OpeningOperationPlanListVO> openingOperationPlanListVOList = new ArrayList<>();
openPlanShopInfoDTOS.forEach(x->{
openPlanShopInfoDTOS.forEach(x -> {
OpeningOperationPlanListVO openingOperationPlanListVO = new OpeningOperationPlanListVO();
openingOperationPlanListVO.setShopId(x.getShopId());
openingOperationPlanListVO.setShopName(x.getShopName());
openingOperationPlanListVO.setStoreNum(x.getStoreNum());
openingOperationPlanListVO.setPartnerName(x.getPartnerName());
openingOperationPlanListVO.setMobile(x.getMobile());
//TODO
String[] split = regionNameMap.getOrDefault(x.getRegionId(), "").split("-");
if(split.length >0){
if (split.length > 0) {
openingOperationPlanListVO.setBigName(split[0]);
openingOperationPlanListVO.setFightName(split[1]);
}
@@ -181,8 +177,9 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
openingOperationPlanListVO.setShopManagerName
(vonameMap.get(x.getInvestmentManagerId()).getName());
}
if (!StringUtils.isEmpty(x.getSupervisorUserId()))
{openingOperationPlanListVO.setSupervisorName(vonameMap.get(x.getSupervisorUserId()).getName());}
if (!StringUtils.isEmpty(x.getSupervisorUserId())) {
openingOperationPlanListVO.setSupervisorName(vonameMap.get(x.getSupervisorUserId()).getName());
}
openingOperationPlanListVO.setSubmissionTime(x.getSubmissionTime());
openingOperationPlanListVO.setResultType(x.getResultType());
openingOperationPlanListVOList.add(openingOperationPlanListVO);
@@ -197,10 +194,11 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
try {
if (orderStageInfo.getShopSubStageStatus().
equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus())) {
// ShopInfoDO shopInfo = shopService.getShopInfo(shopId);
// String shopCode = shopInfo.getShopCode();
//Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopCode);
Boolean firstOrder =Boolean.TRUE;
//TODO 调试接口
// ShopInfoDO shopInfo = shopService.getShopInfo(shopId);
// String shopCode = shopInfo.getShopCode();
// Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopCode);
Boolean firstOrder = Boolean.TRUE;
log.info("saveOrder,flag:{}", firstOrder);
if (firstOrder) {
//更改子阶段状态

View File

@@ -165,8 +165,11 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
SystemBuildingShopDO systemBuildingShopDO = systemBuildingShopMapper.selectOne(SystemBuildingShopDO.builder().shopId(shopId).lineId(lineId).build());
//证照办理
LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectOne(LicenseTransactDO.builder().shopId(shopId).build());
//三方部门表
ThirdDepartmentDO thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
ThirdDepartmentDO thirdDepartmentDO = new ThirdDepartmentDO();
if (Objects.nonNull(systemBuildingShopDO)){
//三方部门表
thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
}
//找不到的url统一用这个
List<String> temp = new ArrayList<>();
temp.add("object");

View File

@@ -418,6 +418,11 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
shopAuditInfoDO.setRejectReason(request.getCause());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_32;
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
//更新门店编码
ShopInfoDO shopInfoDO = new ShopInfoDO();
shopInfoDO.setId(shopId);
shopInfoDO.setStoreNum(request.getStoreNum());
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
shopAuditInfoDO.setPassReason(request.getCause());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33;
@@ -425,16 +430,10 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
preparationService.contractAndBuildStoreCompletion(shopId);
}
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
//更新阶段状态
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum,shopAuditInfoDO.getId());
}catch (Exception e){
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
}finally {
//更新门店编码
ShopInfoDO shopInfoDO = new ShopInfoDO();
shopInfoDO.setId(shopId);
shopInfoDO.setStoreNum(request.getStoreNum());
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
//更新阶段状态
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum,null);
}
return true;
}

View File

@@ -0,0 +1,199 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.constants.RedisConstant;
import com.cool.store.dao.AssessmentDataDAO;
import com.cool.store.dto.SmallVideoDTO;
import com.cool.store.dto.SmallVideoInfoDTO;
import com.cool.store.entity.AssessmentDataDO;
import com.cool.store.enums.video.ResourceStatusEnum;
import com.cool.store.enums.video.UploadTypeEnum;
import com.cool.store.service.VodService;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.vod.CallbackRequest;
import com.cool.store.utils.vod.CallbackStreamInfo;
import com.cool.store.utils.vod.EventType;
import com.cool.store.utils.vod.SmallVideoParam;
import com.google.common.io.Files;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* @author byd
* @date 2024-05-07 19:28
*/
@Slf4j
@Service
public class VodServiceImpl implements VodService {
@Resource
private RedisUtilPool redisUtilPool;
@Resource
private AssessmentDataDAO assessmentDataDAO;
public static final Integer EXPIRE_TIME = 3600 * 72;
@Override
public void callback(CallbackRequest request) {
log.info("CallbackRequest:{}", JSONObject.toJSONString(request));
//未完成转码的视频
String videoId = request.getVideoId();
String eventType = request.getEventType();
String newVideoInfo = "";
String callbackCache = redisUtilPool.getString(RedisConstant.VIDEO_CALLBACK_CACHE + videoId);
SmallVideoDTO smallVideoDTO;
if (StringUtils.isNotBlank(callbackCache)) {
smallVideoDTO = JSONObject.parseObject(callbackCache, SmallVideoDTO.class);
} else {
smallVideoDTO = new SmallVideoDTO();
}
log.info("smallVideoDTO:{}", JSONObject.toJSONString(smallVideoDTO));
smallVideoDTO.setSize(request.getSize());
smallVideoDTO.setVideoId(videoId);
switch (eventType) {
//视频上传完成
case EventType.FileUploadComplete:
smallVideoDTO.setStatus(ResourceStatusEnum.TRANSCODING.getValue());
smallVideoDTO.setVideoUrlBefore(request.getFileUrl());
log.info("视频原始地址:{}", request.getFileUrl());
//mp4不转码处理
if (Files.getFileExtension(request.getFileUrl()).equalsIgnoreCase(CommonConstants.TRANSCODE_VIDEO)) {
if (CommonConstants.SUCCESS_STR.equalsIgnoreCase(request.getStatus())) {
smallVideoDTO.setVideoUrl(request.getFileUrl());
} else {
smallVideoDTO.setStatus(ResourceStatusEnum.TRANSCODE_FAILED.getValue());
}
}
smallVideoDTO.setUploadStatus(true);
newVideoInfo = JSONObject.toJSONString(smallVideoDTO);
//过期时间为一周
redisUtilPool.setString(RedisConstant.VIDEO_CALLBACK_CACHE + videoId, newVideoInfo, EXPIRE_TIME);
break;
//视频截图完成
case EventType.SnapshotComplete:
// 视频截图完成,且课件状态在转码完成之前时,更新状态为截图完成
if (smallVideoDTO.getStatus() == null || smallVideoDTO.getStatus() < ResourceStatusEnum.TRANSCODE_FINISH.getValue()) {
smallVideoDTO.setStatus(ResourceStatusEnum.SCREENSHOT_FINISHED.getValue());
}
//视频封面
smallVideoDTO.setVideoSnapshot(request.getCoverUrl());
//如果上传的就是mp4就不进行转码截图完成就把状态改为转码完成
if (StringUtils.isNotBlank(smallVideoDTO.getVideoUrlBefore())
&& Files.getFileExtension(smallVideoDTO.getVideoUrlBefore()).equalsIgnoreCase(CommonConstants.TRANSCODE_VIDEO)
&& !smallVideoDTO.getStatus().equals(ResourceStatusEnum.TRANSCODE_FAILED.getValue())) {
smallVideoDTO.setStatus(ResourceStatusEnum.TRANSCODE_FINISH.getValue());
smallVideoDTO.setTransCodeStatus(true);
}
smallVideoDTO.setSnapShotStatus(true);
newVideoInfo = JSONObject.toJSONString(smallVideoDTO);
//过期时间为一周
redisUtilPool.setString(RedisConstant.VIDEO_CALLBACK_CACHE + videoId, newVideoInfo, EXPIRE_TIME);
break;
//视频全部清晰度转码完成
case EventType.TranscodeComplete:
if (CommonConstants.SUCCESS_STR.equalsIgnoreCase(request.getStatus())) {
smallVideoDTO.setTransCodeStatus(true);
smallVideoDTO.setStatus(ResourceStatusEnum.TRANSCODE_FINISH.getValue());
List<CallbackStreamInfo> streamInfoList = request.getStreamInfos();
for (CallbackStreamInfo streamInfo : streamInfoList) {
log.info("VodService callback playInfo.getFormat:{}", streamInfo.getFormat());
if (Objects.nonNull(smallVideoDTO.getStatus()) && smallVideoDTO.getStatus().intValue() != ResourceStatusEnum.TRANSCODE_FAILED.getValue()) {
smallVideoDTO.setVideoUrl(streamInfo.getFileUrl());
}
}
} else {
smallVideoDTO.setStatus(ResourceStatusEnum.TRANSCODE_FAILED.getValue());
}
log.info("视频转码完成,videoId:{}", videoId);
newVideoInfo = JSONObject.toJSONString(smallVideoDTO);
//过期时间为一周
redisUtilPool.setString(RedisConstant.VIDEO_CALLBACK_CACHE + videoId, newVideoInfo, EXPIRE_TIME);
break;
default:
}
log.info("videoId:{},转码状态:{}", videoId, smallVideoDTO.getStatus());
//未完成转码处理
notCompleteCacheHandle(smallVideoDTO, videoId);
}
/**
* 如果前端提交的时候视频还没有转码成功会把videoId存入缓存回调的时候再进行处理
*
* @param smallVideoDTO
* @param videoId
* @return void
* @author chenyupeng
* @date 2021/10/14
*/
public void notCompleteCacheHandle(SmallVideoDTO smallVideoDTO, String videoId) {
log.info("videoId:{}, smallVideoDTO:{}", videoId, JSONObject.toJSONString(smallVideoDTO));
//回调事件都完成才入库
if (!(smallVideoDTO.isUploadStatus() && smallVideoDTO.isSnapShotStatus() && smallVideoDTO.isTransCodeStatus())) {
log.info("回调事件都完成才入库videoId:{}", videoId);
return;
}
String notCompleteCache = redisUtilPool.hashGet(RedisConstant.VIDEO_NOT_COMPLETE_CACHE, videoId);
log.info("notCompleteCache:{}", notCompleteCache);
if (StringUtils.isNotBlank(notCompleteCache)) {
if (StringUtils.isNotBlank(smallVideoDTO.getVideoUrl())) {
smallVideoDTO.setVideoUrl(smallVideoDTO.getVideoUrl().replace("http://", "https://"));
}
if (StringUtils.isNotBlank(smallVideoDTO.getVideoUrlBefore())) {
smallVideoDTO.setVideoUrlBefore(smallVideoDTO.getVideoUrlBefore().replace("http://", "https://"));
}
SmallVideoParam smallVideoParam = JSONObject.parseObject(notCompleteCache, SmallVideoParam.class);
if (UploadTypeEnum.TB_DATA_STA_TABLE_COLUMN.getValue().equals(smallVideoParam.getUploadType())) {
//检查项提交
dealVideo(smallVideoDTO, smallVideoParam);
//保存完删除缓存
redisUtilPool.hashDel(RedisConstant.VIDEO_NOT_COMPLETE_CACHE, videoId);
}
}
}
public void dealVideo(SmallVideoDTO smallVideoDTO, SmallVideoParam smallVideoParam) {
AssessmentDataDO assessmentDataDO = assessmentDataDAO.selectByPrimaryKey(smallVideoParam.getBusinessId());
log.info("视频信息,checkVideo:{}", assessmentDataDO.getVideo());
assessmentDataDO.setVideo(transSmallVideoDTO(assessmentDataDO.getVideo(), smallVideoDTO));
assessmentDataDAO.updateByPrimaryKeySelective(assessmentDataDO);
}
public static String transSmallVideoDTO(String videoInfo, SmallVideoDTO smallVideoDto) {
log.info("transSmallVideoDTO,videoInfo:{},smallVideoDto:{}", videoInfo, smallVideoDto.toString());
SmallVideoInfoDTO smallVideoInfoDTO = JSONObject.parseObject(videoInfo, SmallVideoInfoDTO.class);
if (smallVideoInfoDTO == null) {
smallVideoInfoDTO = new SmallVideoInfoDTO();
}
if (CollectionUtils.isEmpty(smallVideoInfoDTO.getVideoList())) {
smallVideoInfoDTO.setVideoList(Collections.singletonList(smallVideoDto));
return JSONObject.toJSONString(smallVideoInfoDTO);
}
for (SmallVideoDTO smallVideo : smallVideoInfoDTO.getVideoList()) {
if (smallVideo.getVideoId() == null || StringUtils.equals(smallVideo.getVideoId(), smallVideoDto.getVideoId())) {
BeanUtils.copyProperties(smallVideoDto, smallVideo);
}
}
return JSONObject.toJSONString(smallVideoInfoDTO);
}
}

View File

@@ -69,9 +69,11 @@ public class YlfServiceImpl implements YlfService {
log.info("CoolStoreStartFlowServiceImpl#getOrder, url:{}", url);
try {
String jsonString = httpRestTemplateService.getForObject(url, String.class, new HashMap<>());
//TODO
JSONObject jsonObject = JSONObject.parseObject(jsonString);
Object data = JSONObject.parseObject(jsonString, JSONObject.class).get("data");
log.info("CoolStoreStartFlowServiceImpl#getOrder,jsonObject:{}", jsonObject);
//TODO
if (jsonObject.get("status").equals(Constants.SUCCESS)) {
if (Objects.isNull(data)) {
return null;
@@ -79,6 +81,8 @@ public class YlfServiceImpl implements YlfService {
DesignRowsDTO designRowsDTO = JSONObject.parseObject(JSONObject.toJSONString(data), DesignRowsDTO.class);
List<ProjectDTO> rows = designRowsDTO.getRows();
if (CollectionUtils.isNotEmpty(rows)) {
//TODO 排序
return rows.get(0);
}
} else {

View File

@@ -1,5 +1,6 @@
package com.cool.store.utils.poi;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import java.lang.management.ManagementFactory;
@@ -83,6 +84,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
* @return 格式化完毕的日期
*/
public static String parseDateToStr(final String format, final Date date) {
if(StringUtils.isEmpty(format)|| ObjectUtils.isNotEmpty(date)){
return null;
}
return new SimpleDateFormat(format).format(date);
}

View File

@@ -48,6 +48,7 @@ public class TokenValidateFilter implements Filter {
"/**/swagger*/**", "/**/webjars/**",
//腾讯音视频回调,单独做验签
"/xfsg/pc/video/**",
"/xfsg/pc/vod/callback",
"/xfsg/pc/sysRole/**",
"/xfsg/**/api/audit/result",
"/xfsg/pc/video/**",

View File

@@ -35,9 +35,11 @@ public class KdzApiController {
log.info("auditResult requestBody :{}", JSONObject.toJSONString(request));
//todo 暂时去掉验签测试
// if(!verifyMD5(request,eid)){
// log.error("验签失败,request{};eid:{}",JSONObject.toJSONString(request),eid);
// return ResponseResult.fail(ErrorCodeEnum.VERIFY_MD5_FALSE);
// }
// if(eid == null || request.getBizContent() == null){
// log.error("参数校验失败,BizContent{}",JSONObject.toJSONString(request.getBizContent()));
// return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
// }
AuditResultRequest auditResultRequest = JSONObject.parseObject(request.getBizContent(), AuditResultRequest.class);
@@ -50,9 +52,11 @@ public class KdzApiController {
@RequestBody XfsgOpenApiRequest request) {
log.info("auditResult requestBody :{}", JSONObject.toJSONString(request));
if(!verifyMD5(request,eid)){
log.error("验签失败,request{};eid:{}",JSONObject.toJSONString(request),eid);
return ResponseResult.fail(ErrorCodeEnum.VERIFY_MD5_FALSE);
}
if(eid == null || request.getBizContent() == null){
log.error("参数校验失败,BizContent{}",JSONObject.toJSONString(request.getBizContent()));
return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
LicenseBizContentRequest storeNum = JSONObject.parseObject(request.getBizContent(), LicenseBizContentRequest.class);

View File

@@ -3,6 +3,7 @@ package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dto.TransferLogDTO;
import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.request.*;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.LinePayService;
@@ -127,7 +128,7 @@ public class LineInfoController {
@ApiImplicitParam(name = "lineId", value = "线索id", required = true)
})
public ResponseResult<LinePayVO> getLinePayInfo(@RequestParam("lineId")Long lineId) {
return ResponseResult.success(linePayService.getLinePayInfo(lineId));
return ResponseResult.success(linePayService.getLinePayInfo(lineId, PayBusinessTypeEnum.INTENT_MONEY.getCode(),null));
}
@ApiOperation("线索流程进度")

View File

@@ -29,7 +29,15 @@ public class PCApplyLicenseController {
@GetMapping(path = "/licenseList")
@ApiOperation("证照审批列表")
public ResponseResult<PageInfo<LicenseListResponse>> licenseList(LicenseListRequest request) {
public ResponseResult<PageInfo<LicenseListResponse>> licenseList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize,
@RequestParam(value = "storeName",required = false)String storeName,
@RequestParam(value = "submitStartTime",required = false)Long submitStartTime,
@RequestParam(value = "submitEndTime",required = false)Long submitEndTime,
@RequestParam(value = "regionId",required = false)String regionId,
@RequestParam(value = "status",required = false)Integer status) {
LicenseListRequest request =
new LicenseListRequest(pageNumber,pageSize, storeName, submitStartTime, submitEndTime, regionId, status);
return ResponseResult.success(applyLicenseService.licenseList(request));
}
@@ -46,7 +54,7 @@ public class PCApplyLicenseController {
* @return
*/
@GetMapping(path = "/examine")
@ApiOperation("证照审批列表")
@ApiOperation("证照审批")
public ResponseResult licenseExamine(@RequestParam("id") Long shopId,
@RequestParam("status") Integer status,
@RequestParam("result") String result) {

View File

@@ -47,7 +47,7 @@ public class PCOpenPreparationController {
private OpeningOperationPlanService openingOperationPlanService;
@Resource
private AuditOpeningOperationPlanService auditOpeningOperationPlanService;
@ApiOperation("刷新")
@ApiOperation("刷新订货金状态")
@GetMapping("/flush")
public ResponseResult<Boolean> flush(@RequestParam("shopId") Long shopId) {
return ResponseResult.success(openingOperationPlanService.flush(shopId));
@@ -67,6 +67,7 @@ public class PCOpenPreparationController {
@PostMapping("/openingOperationPlan/planList")
@ApiOperation("查询运营方案列表")
public ResponseResult<PageInfo<OpeningOperationPlanListVO>> planList(@RequestBody PlanListRequest request) {
return ResponseResult.success(openingOperationPlanService.getPlanListPage(request));
}
@PostMapping("/openingOperationPlan/audit")

View File

@@ -0,0 +1,46 @@
package com.cool.store.controller.webb;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.service.VodService;
import com.cool.store.utils.vod.AliResponseUtil;
import com.cool.store.utils.vod.CallbackRequest;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* @author byd
* @date 2024-05-07 19:13
*/
@RestController
@RequestMapping("pc/vod")
@Api(tags = "视频回调接口")
@Slf4j
public class VodController {
@Autowired
private VodService vodService;
@RequestMapping("callback")
public JSONObject callback(HttpServletRequest request) throws IOException {
log.info("=================================");
log.info("VOD视频回调");
String cl = request.getHeader("content-length");
log.info("content-length:" + cl);
String vodCallbackBody = AliResponseUtil.GetPostBody(request.getInputStream(), Integer.parseInt(cl));
log.info("vodCallbackBody:" + vodCallbackBody);
CallbackRequest callback = JSON.parseObject(vodCallbackBody, CallbackRequest.class);
log.info("callback" + JSON.toJSONString(callback));
vodService.callback(callback);
log.info("=================================");
JSONObject jsonObject = new JSONObject();
jsonObject.put("Status", "OK");
return jsonObject;
}
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.controller.webc;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.request.LinePaySubmitRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.LinePayService;
@@ -35,7 +36,7 @@ public class LinePayController {
@ApiImplicitParam(name = "lineId", value = "线索id", required = true)
})
public ResponseResult<LinePayVO> getLinePayInfo(@RequestParam("lineId")Long lineId) {
return ResponseResult.success(linePayService.getLinePayInfo(lineId));
return ResponseResult.success(linePayService.getLinePayInfo(lineId, PayBusinessTypeEnum.INTENT_MONEY.getCode(),null));
}
@ApiOperation("缴纳意向金/加盟费")

View File

@@ -41,7 +41,7 @@ public class MiniDecorationController {
private DecorationService decorationService;
@Resource
private AssessmentTemplateService assessmentTemplateService;
@ApiOperation("获取新店装修下阶段的数据")
@ApiOperation("获取新店装修下阶段的数据/flush")
@GetMapping("/getFitmentSub")
public ResponseResult<FitmentResponse> getFitmentSub(@RequestParam Long shopId) {
return ResponseResult.success(decorationService.getFitmentSub(shopId));
@@ -64,7 +64,7 @@ public class MiniDecorationController {
@ApiOperation("获取装修款信息,和二维码")
@GetMapping("/getDecorationModel")
public ResponseResult<DecorationModelDTO> getDecorationModel(@RequestParam Long shopId){
return ResponseResult.success(decorationService.DecorationModel(shopId)) ;
return ResponseResult.success(decorationService.decorationModel(shopId)) ;
}
@ApiOperation("获取装修款阶段信息")
@GetMapping("/getDecorationModeStage")

View File

@@ -124,6 +124,7 @@ public class XxlJobHandler {
while (hasNext) {
log.info("----查询更新订货金----");
//sql 判定传入
Page<Long> shopIdListByStageStatus = shopStageInfoDAO.getShopIdListByStageStatus(PageNum, PageSize);
if (CollectionUtils.isEmpty(shopIdListByStageStatus)) {
log.info("------今日没有待更新数据------");
@@ -135,12 +136,13 @@ public class XxlJobHandler {
for (Long shopId : map.keySet()) {
String shopCode = map.get(shopId);
try {
// TOdo 能不能一次调用
Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopCode);
if (firstOrder == null) {
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
}
if (firstOrder.equals(Boolean.TRUE)) {
if (firstOrder) {
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151, null);
preparationService.whetherToOpenForAcceptance(shopId);
}
@@ -177,6 +179,7 @@ public class XxlJobHandler {
}
List<AcceptanceInfoDO> acceptanceInfoDOS = new ArrayList<>();
for (Long shopId : shops) {
//TODO ids查
acceptanceInfoDOS.add(acceptanceInfoDAO.selectByShopId(shopId));
}
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOS) {
@@ -214,6 +217,7 @@ public class XxlJobHandler {
LocalDate localDate = instant.atZone(zone).toLocalDate();
LocalDate datePlusFiveDays = localDate.plusDays(CommonConstants.FOUR); // 添加5天
LocalDate now = LocalDate.now();
//TODO 时间问题
if (datePlusFiveDays.equals(now)) {
shopStageInfoDAO.updateShopStageInfo(shopId,ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120);
}