开店列表+导出
This commit is contained in:
@@ -14,6 +14,7 @@ public enum FileTypeEnum {
|
||||
MY_FRANCHISEES("my_franchisees","我的加盟商"),
|
||||
TEAM_FRANCHISEES("team_franchisees","团队加盟商"),
|
||||
PREPARATION("preparation","进度管理"),
|
||||
BRANCH_SHOP_LIST("branchShopList","开店列表")
|
||||
;
|
||||
private String fileType;
|
||||
private String desc;
|
||||
|
||||
@@ -23,4 +23,15 @@ public enum FranchiseBrandEnum {
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
public static String getDescByCode(Integer code) {
|
||||
if (code == null){
|
||||
return null;
|
||||
}
|
||||
for (FranchiseBrandEnum e : FranchiseBrandEnum.values()) {
|
||||
if (e.getCode() == code) {
|
||||
return e.getDesc();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/08/下午5:51
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public enum JoinModeEnum {
|
||||
FRANCHISE_DEPARTMENT(1,"社会加盟模式/加盟部加盟店"),
|
||||
FRANCHISE_COMPANIES(2,"强加盟模式/加盟公司加盟店"),
|
||||
OWN_STORE(3,"加盟公司自有店");
|
||||
private int code;
|
||||
private String desc;
|
||||
private JoinModeEnum(int code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
public static String getByCode(Integer code) {
|
||||
if (code == null){
|
||||
return null;
|
||||
}
|
||||
for (JoinModeEnum e : JoinModeEnum.values()) {
|
||||
if (e.getCode() == code) {
|
||||
return e.desc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -22,4 +22,12 @@ public enum ShopStatusEnum {
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
public static String getDesc(int code){
|
||||
for (ShopStatusEnum shopStatusEnum:ShopStatusEnum.values()){
|
||||
if (shopStatusEnum.getCode()==code){
|
||||
return shopStatusEnum.getDesc();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,6 +119,9 @@ public class EnterpriseUserDAO {
|
||||
|
||||
public Map<String, EnterpriseUserDO> getUserInfoMap(List<String> userIds){
|
||||
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
|
||||
if (CollectionUtils.isEmpty(userList)){
|
||||
return new HashMap<>();
|
||||
}
|
||||
return userList.stream().collect(Collectors.toMap(k -> k.getUserId(), Function.identity()));
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,9 @@ public class HyOpenAreaInfoDAO {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOS = hyOpenAreaInfoMapper.selectByIds(ids);
|
||||
if (CollectionUtils.isEmpty(hyOpenAreaInfoDOS)){
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return ListUtils.emptyIfNull(hyOpenAreaInfoDOS).stream().collect(Collectors.toMap(k->k.getId(), v->v.getAreaPath().replace("/"," ").trim()));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,14 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.InvoicingDO;
|
||||
import com.cool.store.mapper.InvoicingMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -41,5 +45,14 @@ public class InvoicingDAO {
|
||||
return invoicingMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<InvoicingDO> listByShopIds(List<Long> shopIds){
|
||||
if (CollectionUtils.isEmpty(shopIds)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Example example = new Example(InvoicingDO.class);
|
||||
example.createCriteria().andIn("shopId", shopIds);
|
||||
return invoicingMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ShopInfoMapper;
|
||||
import com.cool.store.request.BranchShopRequest;
|
||||
import com.cool.store.request.PlanListRequest;
|
||||
import com.cool.store.request.PreparationRequest;
|
||||
import com.cool.store.request.platformBuildListRequest;
|
||||
@@ -150,6 +151,10 @@ public class ShopInfoDAO {
|
||||
public List<PreparationDTO> ListByCondition(PreparationRequest request){
|
||||
return shopInfoMapper.ListByCondition(request);
|
||||
}
|
||||
|
||||
public List<PreparationDTO> ListByBranchShopRequest(BranchShopRequest request){
|
||||
return shopInfoMapper.ListByBranchShopRequest(request);
|
||||
}
|
||||
public Long getRegionIdByid(Long shopId){
|
||||
return shopInfoMapper.getRegionIdByid(shopId);
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ public class ShopStageInfoDAO {
|
||||
|
||||
public List<ScheduleDTO> getScheduleList(List<Long> shopIdList){
|
||||
if (CollectionUtils.isEmpty(shopIdList)){
|
||||
return Collections.emptyList();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return shopStageInfoMapper.getScheduleList(shopIdList);
|
||||
}
|
||||
@@ -245,7 +245,7 @@ public class ShopStageInfoDAO {
|
||||
|
||||
public List<ShopStageInfoDO> getOpenActivityActualCompletionTime(List<Long> shopIdList){
|
||||
if (CollectionUtils.isEmpty(shopIdList)){
|
||||
return Collections.emptyList();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return shopStageInfoMapper.getOpenActivityActualCompletionTime(shopIdList);
|
||||
}
|
||||
@@ -345,5 +345,9 @@ public class ShopStageInfoDAO {
|
||||
public List<ShopStageInfoDO> getSubStages(Integer shopSubStage){
|
||||
return shopStageInfoMapper.getSubStageList(null,shopSubStage);
|
||||
}
|
||||
//获取新店筹备总阶段总数排除发票回传,flag=0查询全部 =1 查询已完成
|
||||
public Integer allNumber(Long shopId,Integer flag){
|
||||
return shopStageInfoMapper.getAllNumber(shopId,flag);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||
import com.cool.store.dto.point.LineCountDTO;
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.request.BranchShopRequest;
|
||||
import com.cool.store.request.PlanListRequest;
|
||||
import com.cool.store.request.PreparationRequest;
|
||||
import com.cool.store.request.platformBuildListRequest;
|
||||
@@ -81,6 +82,8 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
||||
|
||||
List<PreparationDTO> ListByCondition(@Param("request") PreparationRequest request);
|
||||
|
||||
List<PreparationDTO> ListByBranchShopRequest(@Param("request") BranchShopRequest request);
|
||||
|
||||
Long getRegionIdByid(@Param("shopId") Long shopId);
|
||||
|
||||
ShopInfoDO selectByStoreNum(@Param("storeNum") String storeNum);
|
||||
|
||||
@@ -160,4 +160,6 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
||||
@Param("shopSubStage") Integer shopSubStage);
|
||||
|
||||
List<PlatformBuildStageDTO> getPlatformBuildStage( @Param("shopIds") List<Long> shopIds);
|
||||
|
||||
Integer getAllNumber(@Param("shopId") Long shopId,@Param("flag")Integer flag);
|
||||
}
|
||||
|
||||
@@ -4,10 +4,14 @@ import com.cool.store.entity.SignFranchiseDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SignFranchiseMapper extends Mapper<SignFranchiseDO> {
|
||||
|
||||
SignFranchiseDO selectByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
void updateAuditByShopId(@Param("auditId") Long auditId,
|
||||
@Param("shopId") Long shopId);
|
||||
|
||||
List<SignFranchiseDO> selectByShopIds( @Param("list")List<Long> shopIds);
|
||||
}
|
||||
|
||||
@@ -250,6 +250,65 @@
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="ListByBranchShopRequest" resultType="com.cool.store.dto.Preparation.PreparationDTO">
|
||||
select
|
||||
a.id as id,
|
||||
a.line_id as lineId,
|
||||
a.shop_name as shopName,
|
||||
a.want_shop_area_id as wantShopAreaId,
|
||||
a.shop_code as shopCode,
|
||||
a.store_num as storeNum,
|
||||
a.shop_manager_user_id as shopManagerUserId,
|
||||
a.supervisor_user_id as supervisorUserId,
|
||||
a.region_id as regionId,
|
||||
b.username as username,
|
||||
b.mobile as mobile,
|
||||
a.investment_manager as investmentManager,
|
||||
DATE_ADD(b.create_time, INTERVAL 50 DAY) as planOpenTime,
|
||||
a.create_time as createTime,
|
||||
a.join_mode as joinMode,
|
||||
a.franchise_brand as franchiseBrand,
|
||||
a.shop_status as shopStatus
|
||||
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
|
||||
where a.deleted = 0
|
||||
<if test="request.partnerKeyword != null and request.partnerKeyword != ''">
|
||||
and (b.username like concat('%', #{request.partnerKeyword}, '%') or b.mobile like concat('%', #{request.partnerKeyword}, '%'))
|
||||
</if>
|
||||
<if test="request.shopKeyword!=null and request.shopKeyword!=''">
|
||||
and (a.shop_name like concat('%',#{request.shopKeyword}, '%') or a.shop_code like concat('%', #{request.shopKeyword}, '%') )
|
||||
</if>
|
||||
<if test="request.regionIds != null and request.regionIds.size() > 0">
|
||||
and a.region_id in
|
||||
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
|
||||
and a.region_id in
|
||||
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.investmentManagerUserId != null and request.investmentManagerUserId != ''">
|
||||
and a.investment_manager = #{request.investmentManagerUserId}
|
||||
</if>
|
||||
<if test="request.openTimeStart != null ">
|
||||
and DATE_ADD(a.create_time, INTERVAL 50 DAY) >= #{request.openTimeStart}
|
||||
</if>
|
||||
<if test="request.openTimeEnd != null ">
|
||||
<![CDATA[and DATE_ADD(a.create_time, INTERVAL 50 DAY) <= #{request.openTimeEnd}]]>
|
||||
</if>
|
||||
<if test="request.joinMode!=null">
|
||||
and a.join_mode = #{request.joinMode}
|
||||
</if>
|
||||
<if test="request.franchiseBrand!=null">
|
||||
and a.franchise_brand = #{request.franchiseBrand}
|
||||
</if>
|
||||
<if test="request.shopStatus!=null">
|
||||
and a.shop_status = #{request.shopStatus}
|
||||
</if>
|
||||
order by a.update_time desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -365,4 +365,16 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getAllNumber" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from xfsg_shop_stage_info
|
||||
where shop_stage = 2
|
||||
<if test="flag !=null and flag = 1">
|
||||
and is_terminated =1
|
||||
</if>
|
||||
and shop_sub_stage != 85
|
||||
<if test="shopId !=null">
|
||||
and shop_id = #{shopId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -13,4 +13,15 @@
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
<select id="selectByShopIds" resultType="com.cool.store.entity.SignFranchiseDO">
|
||||
select contract_code,shop_id,contract_start_time,contract_end_time
|
||||
from xfsg_sign_franchise
|
||||
where 1=1
|
||||
<if test="list !=null and list.size >0">
|
||||
and shop_id in
|
||||
<foreach collection="list" open="(" separator="," close=")" item="item" index="index">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.cool.store.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/09/下午4:13
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class ExportBranchShopDTO {
|
||||
|
||||
@ExcelProperty(value = "加盟商名称",order = 1)
|
||||
@ColumnWidth(30)
|
||||
private String userName;
|
||||
|
||||
@ExcelProperty(value = "加盟商手机号",order = 2)
|
||||
@ColumnWidth(30)
|
||||
private String mobile;
|
||||
|
||||
@ExcelProperty(value = "门店名称",order = 3)
|
||||
@ColumnWidth(30)
|
||||
private String shopName;
|
||||
|
||||
@ExcelProperty(value = "门店编号",order = 4)
|
||||
@ColumnWidth(30)
|
||||
private String shopCode;
|
||||
|
||||
@ExcelProperty(value = "所属区域/分公司",order = 5)
|
||||
@ColumnWidth(30)
|
||||
private String regionName;
|
||||
|
||||
@ExcelProperty(value = "加盟模式",order = 6)
|
||||
@ColumnWidth(30)
|
||||
private String joinMode;
|
||||
|
||||
@ExcelProperty(value = "所属品牌",order = 6)
|
||||
@ColumnWidth(30)
|
||||
private String franchiseBrand;
|
||||
|
||||
@ExcelProperty(value = "督导",order = 7)
|
||||
@ColumnWidth(30)
|
||||
private String investmentManager;
|
||||
|
||||
@ExcelProperty(value = "合同编号",order = 8)
|
||||
@ColumnWidth(30)
|
||||
private String contractCode;
|
||||
|
||||
@ExcelProperty(value = "合同开始时间",order = 9)
|
||||
@ColumnWidth(30)
|
||||
private String contractStartTime;
|
||||
|
||||
@ExcelProperty(value = "合同结束时间",order = 10)
|
||||
@ColumnWidth(30)
|
||||
private String contractEndTime;
|
||||
|
||||
@ExcelProperty(value = "开票时间",order = 11)
|
||||
@ColumnWidth(30)
|
||||
private String invoicingTime;
|
||||
|
||||
@ExcelProperty(value = "管理费(含税金额)",order = 12)
|
||||
@ColumnWidth(30)
|
||||
private String managementFeeTax;
|
||||
|
||||
@ExcelProperty(value = "管理费(不含税金额)",order = 13)
|
||||
@ColumnWidth(30)
|
||||
private String managementFee;
|
||||
|
||||
@ExcelProperty(value = "品牌费(含税金额)",order = 14)
|
||||
@ColumnWidth(30)
|
||||
private String brandingFeeTax;
|
||||
|
||||
@ExcelProperty(value = "品牌费(不含税金额)",order = 15)
|
||||
@ColumnWidth(30)
|
||||
private String brandingFee;
|
||||
|
||||
@ExcelProperty(value = "加盟费(含税金额)",order = 16)
|
||||
@ColumnWidth(30)
|
||||
private String franchiseFeeTax;
|
||||
|
||||
@ExcelProperty(value = "加盟费(不含税金额)",order = 17)
|
||||
@ColumnWidth(30)
|
||||
private String franchiseFee;
|
||||
|
||||
@ExcelProperty(value = "设计费(含税金额)",order = 18)
|
||||
@ColumnWidth(30)
|
||||
private String designFeeTax;
|
||||
|
||||
@ExcelProperty(value = "设计费(不含税金额)",order = 19)
|
||||
@ColumnWidth(30)
|
||||
private String designFee;
|
||||
|
||||
@ExcelProperty(value = "当前进度",order = 20)
|
||||
@ColumnWidth(30)
|
||||
private String currentProgress;
|
||||
|
||||
@ExcelProperty(value = "状态",order = 21)
|
||||
@ColumnWidth(30)
|
||||
private String shopStatus;
|
||||
|
||||
@ExcelProperty(value = "计划开店时间",order = 22)
|
||||
@ColumnWidth(30)
|
||||
private String planOpenTime;
|
||||
|
||||
@ExcelProperty(value = "开店时长(天)",order = 23)
|
||||
@ColumnWidth(30)
|
||||
private String openDuration;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.dto.Preparation;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -14,6 +15,10 @@ public class PreparationDTO {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long wantShopAreaId;
|
||||
|
||||
private Integer shopStatus;
|
||||
|
||||
private Long lineId;
|
||||
|
||||
private String shopName;
|
||||
@@ -37,4 +42,9 @@ public class PreparationDTO {
|
||||
private String supervisorUserId;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Integer franchiseBrand;
|
||||
|
||||
private Integer joinMode;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.cool.store.common.PageBasicInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/08/下午6:00
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class BranchShopRequest {
|
||||
//页码
|
||||
private Integer pageNum=1;
|
||||
//分页大小
|
||||
private Integer pageSize=10;
|
||||
@ApiModelProperty("加盟商姓名或手机号")
|
||||
private String partnerKeyword;
|
||||
@ApiModelProperty("门店名称/编号")
|
||||
private String shopKeyword;
|
||||
@ApiModelProperty("所属大区")
|
||||
private List<String> regionIds;
|
||||
@ApiModelProperty("督导userId")
|
||||
private String investmentManagerUserId;
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private Long wantShopAreaId;
|
||||
@ApiModelProperty("加盟模式")
|
||||
private Integer joinMode;
|
||||
@ApiModelProperty("加盟品牌")
|
||||
private Integer franchiseBrand;
|
||||
@ApiModelProperty("开店状态")
|
||||
private Integer shopStatus;
|
||||
@ApiModelProperty("计划开业日期开始")
|
||||
private Date openTimeStart;
|
||||
@ApiModelProperty("计划开业日期结束")
|
||||
private Date openTimeEnd;
|
||||
@ApiModelProperty(value = "管辖区域",hidden = true)
|
||||
private List<String> authRegionIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/01/08/下午5:46
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class BranchShopResponse {
|
||||
private Long shopId;
|
||||
private Long lineId;
|
||||
@ApiModelProperty("加盟商姓名")
|
||||
private String userName;
|
||||
@ApiModelProperty("加盟商手机号")
|
||||
private String mobile;
|
||||
@ApiModelProperty("门店名称")
|
||||
private String shopName;
|
||||
@ApiModelProperty("门店编号")
|
||||
private String shopCode;
|
||||
@ApiModelProperty("所属大区")
|
||||
private String regionName;
|
||||
@ApiModelProperty("所属品牌")
|
||||
private String franchiseBrand;
|
||||
@ApiModelProperty("加盟模式")
|
||||
private String joinMode;
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private String wantRegionName;
|
||||
@ApiModelProperty("计划开业时间")
|
||||
private Date planOpenTime;
|
||||
@ApiModelProperty("总项数")
|
||||
private Integer totalColumn;
|
||||
@ApiModelProperty("完成项")
|
||||
private Integer completionColumn;
|
||||
@ApiModelProperty("开店时长")
|
||||
private String openTime;
|
||||
@ApiModelProperty("督导/招商经理")
|
||||
private String investmentManagerName;
|
||||
@ApiModelProperty("状态")
|
||||
private String shopStatus;
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
@ApiModelProperty("开业活动完成时间")
|
||||
private Date openingActivityEndTime;
|
||||
|
||||
public void setOpenTime() {
|
||||
if (this.openingActivityEndTime==null){
|
||||
long between = ChronoUnit.SECONDS.between(this.createTime.toInstant(), new Date().toInstant());
|
||||
double days = (double) between / (24*60*60);
|
||||
this.openTime=String.format("%.1f", days);
|
||||
}else{
|
||||
long between = ChronoUnit.SECONDS.between(this.createTime.toInstant(), this.openingActivityEndTime.toInstant());
|
||||
double days = (double) between / (24*60*60);
|
||||
this.openTime = String.format("%.1f", days);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.entity.ImportTaskDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,4 +17,5 @@ import java.util.List;
|
||||
public interface ExportRealizeService {
|
||||
|
||||
void preparationList( List<PreparationDTO> preparationDTOS,ImportTaskDO importTaskDO);
|
||||
void branchShopList(List<BranchShopResponse> list,ImportTaskDO importTaskDO);
|
||||
}
|
||||
|
||||
@@ -11,4 +11,6 @@ import com.cool.store.request.*;
|
||||
*/
|
||||
public interface ExportService {
|
||||
Integer preparationList(PreparationRequest request,LoginUserInfo loginUserInfo);
|
||||
|
||||
Long branchShopList(BranchShopRequest request,LoginUserInfo user);
|
||||
}
|
||||
|
||||
@@ -66,5 +66,6 @@ public interface PreparationService {
|
||||
*/
|
||||
Boolean decorationFlush(Long shopId);
|
||||
|
||||
|
||||
//阶段完成奢shop_status=1已完成
|
||||
void updateShopStatus(Long shopId);
|
||||
}
|
||||
|
||||
@@ -4,12 +4,11 @@ import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopDetailResponse;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.vo.shop.MiniShopPageVO;
|
||||
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||
import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||
import com.cool.store.vo.shop.StageShopCountVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -69,7 +68,7 @@ public interface ShopService {
|
||||
*/
|
||||
ShopInfoDO getShopInfo(Long shopId);
|
||||
|
||||
Integer updateShopCode(UpdateShopCodeRequest request);
|
||||
Integer updateShopCode(UpdateShopCodeRequest request,String userId);
|
||||
|
||||
//新建分店
|
||||
Long addBranchShop(AddBranchShopRequest request,String userId);
|
||||
@@ -79,4 +78,5 @@ public interface ShopService {
|
||||
Integer updateBranchShopDetail(BranchShopDetailRequest request,String userId);
|
||||
//修改门店招商专员/督导
|
||||
Integer updateShopInvestment(Long shopId,String updateUserId,String userId);
|
||||
PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId);
|
||||
}
|
||||
|
||||
@@ -124,6 +124,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
if (Constants.ONE_INTEGER.equals(request.getSubmitStatus()) && shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30.getShopSubStageStatus())) {
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33, null);
|
||||
preparationService.licenseCompleted(request.getShopId());
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
@@ -155,6 +156,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
if (Constants.ONE_INTEGER.equals(request.getSubmitStatus()) && shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_40.getShopSubStageStatus())) {
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_43, null);
|
||||
preparationService.licenseCompleted(request.getShopId());
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ public class AuditOpeningOperationPlanImpl implements AuditOpeningOperationPlanS
|
||||
Boolean flag = Boolean.FALSE;
|
||||
if(OpeningOperationPlanResultTypeEnum.PASS_AUDIT.getCode().equals(request.getResultType())){
|
||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_143;
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
flag = Boolean.TRUE;
|
||||
}else {
|
||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_142;
|
||||
|
||||
@@ -617,6 +617,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean confirmDesign(DecorationDesignRequest request, LoginUserInfo user) {
|
||||
//重复提交校验 3秒内不能重复提交
|
||||
String lockKey = "confirmDesign:" + request.getShopId();
|
||||
@@ -637,6 +638,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean confirmComplete(Long shopId, LoginUserInfo user) {
|
||||
//判断施工阶段是否时施工中 施工中才能施工完成
|
||||
ShopStageInfoDO shopStageInfoDO = shopStageInfoDAO.getByShopIdAndSubStage(shopId, ShopSubStageEnum.SHOP_STAGE_11.getShopSubStage());
|
||||
@@ -650,6 +652,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
acceptanceInfoDO.setCreateTime(new Date());
|
||||
acceptanceInfoDAO.insertSelectiveAcceptanceInfo(acceptanceInfoDO);
|
||||
}
|
||||
preparationService.updateShopStatus(shopId);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_112, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121));
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
LineInfoDO lineInfo = lineInfoMapper.getByLineId(shopInfo.getLineId());
|
||||
@@ -681,6 +684,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
&& CommonConstants.ONE == partner.getResult()) {
|
||||
//更新阶段状态验收完毕
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123, null);
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
} else {
|
||||
//未通过至为待验收
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121, null);
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
|
||||
import com.cool.store.dto.ExportBranchShopDTO;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.dto.PreparationScheduleDTO;
|
||||
@@ -16,7 +17,9 @@ import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ImportTaskMapper;
|
||||
import com.cool.store.mapper.IntentAgreementMapper;
|
||||
import com.cool.store.mapper.PointInfoMapper;
|
||||
import com.cool.store.mapper.SignFranchiseMapper;
|
||||
import com.cool.store.request.InitiatingRequest;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
@@ -39,8 +42,7 @@ import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD;
|
||||
import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD_HH_MM_SS;
|
||||
import static com.cool.store.utils.poi.DateUtils.*;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
@@ -52,7 +54,7 @@ import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD_HH_MM_SS;
|
||||
@Slf4j
|
||||
public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
@Resource
|
||||
private PointInfoMapper pointInfoMapper;
|
||||
private InvoicingDAO invoicingDAO;
|
||||
@Resource
|
||||
private ImportTaskMapper importTaskMapper;
|
||||
@Autowired
|
||||
@@ -62,7 +64,7 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
@Resource
|
||||
EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Resource
|
||||
SysRoleService sysRoleService;
|
||||
SignFranchiseMapper signFranchiseMapper;
|
||||
@Resource
|
||||
UserAuthMappingService userAuthMappingService;
|
||||
@Resource
|
||||
@@ -140,10 +142,10 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
}
|
||||
result.add(dto1);
|
||||
});
|
||||
url = easyExcelUtil.exportExcel(PreparationScheduleDTO.class, result, null, FileTypeEnum.PREPARATION.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()), FileTypeEnum.PREPARATION.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()));
|
||||
url = easyExcelUtil.exportExcel(PreparationScheduleDTO.class, result, null, FileTypeEnum.PREPARATION.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()), FileTypeEnum.PREPARATION.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()));
|
||||
} catch (Throwable e) {
|
||||
flag = Boolean.FALSE;
|
||||
log.error("fileUpload upload err, originFileName={}", FileTypeEnum.TEAM_LINE.getDesc(), e);
|
||||
log.error("fileUpload upload err, originFileName={}", FileTypeEnum.PREPARATION.getDesc(), e);
|
||||
throw new ServiceException(ErrorCodeEnum.INTERNAL_SERVER_ERROR);
|
||||
} finally {
|
||||
if (flag) {
|
||||
@@ -155,5 +157,74 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
importTaskMapper.update(eid, importTaskDO);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void branchShopList(List<BranchShopResponse> list, ImportTaskDO importTaskDO) {
|
||||
Boolean flag = Boolean.TRUE;
|
||||
String url = "";
|
||||
try {
|
||||
List<ExportBranchShopDTO> exportList = new ArrayList<>();
|
||||
List<Long> shopIds = list.stream().map(BranchShopResponse::getShopId).collect(Collectors.toList());
|
||||
List<SignFranchiseDO> signFranchises = signFranchiseMapper.selectByShopIds(shopIds);
|
||||
Map<Long,SignFranchiseDO> signFranchiseMap = new HashMap<>();
|
||||
if (signFranchises != null ) {
|
||||
signFranchiseMap= signFranchises.stream().collect(Collectors.toMap(SignFranchiseDO::getShopId,Function.identity()));
|
||||
}
|
||||
List<InvoicingDO> invoicingDOList = invoicingDAO.listByShopIds(shopIds);
|
||||
Map<Long,InvoicingDO> InvoicingMap = new HashMap<>();
|
||||
if (invoicingDOList != null) {
|
||||
InvoicingMap = invoicingDOList.stream().collect(Collectors.toMap(InvoicingDO::getShopId,Function.identity()));
|
||||
}
|
||||
for (BranchShopResponse response :list){
|
||||
ExportBranchShopDTO dto = new ExportBranchShopDTO();
|
||||
dto.setUserName(response.getUserName());
|
||||
dto.setMobile(response.getMobile());
|
||||
dto.setShopName(response.getShopName());
|
||||
dto.setShopCode(response.getShopCode());
|
||||
dto.setRegionName(response.getRegionName());
|
||||
dto.setJoinMode(response.getJoinMode());
|
||||
dto.setFranchiseBrand(response.getFranchiseBrand());
|
||||
dto.setInvestmentManager(response.getInvestmentManagerName());
|
||||
SignFranchiseDO signFranchiseDO = signFranchiseMap.get(response.getShopId());
|
||||
if (signFranchiseDO != null) {
|
||||
dto.setContractCode(signFranchiseDO.getContractCode());
|
||||
dto.setContractStartTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1,signFranchiseDO.getContractStartTime()));
|
||||
dto.setContractEndTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1,signFranchiseDO.getContractEndTime()));
|
||||
}
|
||||
InvoicingDO invoicingDO = InvoicingMap.get(response.getShopId());
|
||||
if (invoicingDO != null) {
|
||||
dto.setInvoicingTime(invoicingDO.getInvoiceDate());
|
||||
dto.setManagementFeeTax(invoicingDO.getManagementFeeTax().toString());
|
||||
dto.setManagementFee(invoicingDO.getManagementFee().toString());
|
||||
dto.setBrandingFeeTax(invoicingDO.getBrandUsageFeeTax().toString());
|
||||
dto.setBrandingFee(invoicingDO.getBrandUsageFee().toString());
|
||||
dto.setFranchiseFeeTax(invoicingDO.getFranchiseFeeTax().toString());
|
||||
dto.setFranchiseFee(invoicingDO.getFranchiseFee().toString());
|
||||
dto.setDesignFeeTax(invoicingDO.getDesignServiceFeeTax().toString());
|
||||
dto.setDesignFee(invoicingDO.getDesignServiceFee().toString());
|
||||
}
|
||||
dto.setCurrentProgress(response.getCompletionColumn()+"/"+response.getTotalColumn());
|
||||
dto.setShopStatus(response.getShopStatus());
|
||||
dto.setPlanOpenTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1,response.getPlanOpenTime()));
|
||||
dto.setOpenDuration(response.getOpenTime());
|
||||
exportList.add(dto);
|
||||
}
|
||||
url = easyExcelUtil.exportExcel(ExportBranchShopDTO.class, exportList, null, FileTypeEnum.BRANCH_SHOP_LIST.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()), FileTypeEnum.BRANCH_SHOP_LIST.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()));
|
||||
}catch (Throwable e) {
|
||||
flag = Boolean.FALSE;
|
||||
log.error("fileUpload upload err, originFileName={}", FileTypeEnum.BRANCH_SHOP_LIST.getDesc(), e);
|
||||
throw new ServiceException(ErrorCodeEnum.INTERNAL_SERVER_ERROR);
|
||||
} finally {
|
||||
if (flag) {
|
||||
importTaskDO.setStatus(ImportStatusEnum.success.getCode());
|
||||
importTaskDO.setFileUrl(url);
|
||||
} else {
|
||||
importTaskDO.setStatus(ImportStatusEnum.fail.getCode());
|
||||
}
|
||||
importTaskMapper.update(eid, importTaskDO);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service.impl;
|
||||
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
@@ -17,6 +18,7 @@ import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ImportTaskMapper;
|
||||
import com.cool.store.mapper.PointInfoMapper;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.easyExcel.EasyExcelUtil;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
@@ -67,10 +69,12 @@ public class ExportServiceImpl implements ExportService {
|
||||
private String eid;
|
||||
@Autowired
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Autowired
|
||||
private ShopService shopService;
|
||||
|
||||
|
||||
@Override
|
||||
public Integer preparationList(PreparationRequest request,LoginUserInfo loginUserInfo) {
|
||||
public Integer preparationList(PreparationRequest request, LoginUserInfo loginUserInfo) {
|
||||
if (!sysRoleService.checkIsAdmin(request.getCurUserId())) {
|
||||
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(request.getCurUserId()));
|
||||
}
|
||||
@@ -87,14 +91,14 @@ public class ExportServiceImpl implements ExportService {
|
||||
throw new ServiceException(ErrorCodeEnum.NO_DATA);
|
||||
}
|
||||
List<PreparationDTO> result;
|
||||
if (preparationDTOS.size()>CommonConstants.MAX_EXPORT_SIZE){
|
||||
result= preparationDTOS.subList(0,CommonConstants.MAX_EXPORT_SIZE);
|
||||
}else {
|
||||
result=preparationDTOS;
|
||||
if (preparationDTOS.size() > CommonConstants.MAX_EXPORT_SIZE) {
|
||||
result = preparationDTOS.subList(0, CommonConstants.MAX_EXPORT_SIZE);
|
||||
} else {
|
||||
result = preparationDTOS;
|
||||
}
|
||||
ImportTaskDO importTaskDO = new ImportTaskDO();
|
||||
importTaskDO.setStatus(ImportStatusEnum.Ongoing.getCode());
|
||||
importTaskDO.setFileName(FileTypeEnum.PREPARATION.getDesc()+DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1,new Date()));
|
||||
importTaskDO.setFileName(FileTypeEnum.PREPARATION.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()));
|
||||
importTaskDO.setIsImport(Boolean.FALSE);
|
||||
importTaskDO.setFileType(FileTypeEnum.PREPARATION.getFileType());
|
||||
importTaskDO.setCreateUserId(request.getCurUserId());
|
||||
@@ -105,5 +109,31 @@ public class ExportServiceImpl implements ExportService {
|
||||
return result.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long branchShopList(BranchShopRequest request, LoginUserInfo user) {
|
||||
request.setPageSize(CommonConstants.MAX_EXPORT_SIZE + 100);
|
||||
PageInfo<BranchShopResponse> branchShopList = shopService.getBranchShopList(request, user.getUserId());
|
||||
long total = branchShopList.getTotal();
|
||||
List<BranchShopResponse> exportList = new ArrayList<>();
|
||||
if (total == CommonConstants.ZERO) {
|
||||
return CommonConstants.ZERO_LONG;
|
||||
} else if (total > CommonConstants.MAX_EXPORT_SIZE) {
|
||||
exportList.addAll(branchShopList.getList().subList(0, CommonConstants.MAX_EXPORT_SIZE));
|
||||
}else {
|
||||
exportList.addAll(branchShopList.getList());
|
||||
}
|
||||
ImportTaskDO importTaskDO = new ImportTaskDO();
|
||||
importTaskDO.setStatus(ImportStatusEnum.Ongoing.getCode());
|
||||
importTaskDO.setFileName(FileTypeEnum.BRANCH_SHOP_LIST.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()));
|
||||
importTaskDO.setIsImport(Boolean.FALSE);
|
||||
importTaskDO.setFileType(FileTypeEnum.BRANCH_SHOP_LIST.getFileType());
|
||||
importTaskDO.setCreateUserId(user.getUserId());
|
||||
importTaskDO.setCreateTime(new Date().getTime());
|
||||
importTaskDO.setCreateName(user.getName());
|
||||
importTaskMapper.insert(eid, importTaskDO);
|
||||
exportRealizeService.branchShopList(branchShopList.getList(), importTaskDO);
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -143,6 +143,8 @@ public class OpenAcceptanceInfoServiceImpl implements OpenAcceptanceInfoService
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setId(shopAcceptanceRequest.getShopId());
|
||||
shopInfoDO.setPlanOpenTime(shopAcceptanceRequest.getPlanOpenTime());
|
||||
shopInfoDO.setUpdateTime(new Date());
|
||||
shopInfoDO.setUpdateUserId(userId);
|
||||
shopInfoDAO.updateShopInfo(shopInfoDO);
|
||||
//开业验收完成
|
||||
// shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_161);
|
||||
|
||||
@@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -88,6 +89,8 @@ public class PointServiceImpl implements PointService {
|
||||
|
||||
private static final String AUDIT_SETTING_KEY = "audit_setting_key:{0}";
|
||||
private static final String POINT_SELECT_KEY = "point_select_key:{0}:{1}";
|
||||
@Autowired
|
||||
private PreparationService preparationService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -885,6 +888,7 @@ public class PointServiceImpl implements PointService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer auditRentContract(AuditRentContractRequest request) {
|
||||
Long shopId = request.getShopId();
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.cool.store.request.PostAndOrderRequest;
|
||||
import com.cool.store.response.PosAndOrderResponse;
|
||||
import com.cool.store.service.PosAndOrderInfoService;
|
||||
import com.cool.store.mapper.PosAndOrderInfoMapper;
|
||||
import com.cool.store.service.PreparationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -37,7 +38,8 @@ public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService {
|
||||
private ShopStageInfoDAO shopStageInfoDAO;
|
||||
@Autowired
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
@Autowired
|
||||
private PreparationService preparationService;
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer submitOrUpdate(PostAndOrderRequest request, String user) {
|
||||
@@ -55,6 +57,7 @@ public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService {
|
||||
} else if (request.getType().equals(PosAndOrderEnum.TENT_PASS.getCode())) {
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_245);
|
||||
}
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
return posAndOrderInfoDAO.insertSelective(posAndOrderInfo);
|
||||
} else {
|
||||
return posAndOrderInfoDAO.updateByShopIdSelective(posAndOrderInfo);
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.MessageEnum;
|
||||
import com.cool.store.enums.SMSMsgEnum;
|
||||
import com.cool.store.enums.point.ShopStageEnum;
|
||||
import com.cool.store.enums.point.ShopStatusEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
@@ -280,5 +281,20 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShopStatus(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (shopInfo.getShopStage().equals(ShopStatusEnum.ING.getCode())){
|
||||
Integer all = shopStageInfoDAO.allNumber(shopId, CommonConstants.ZERO);
|
||||
Integer finish = shopStageInfoDAO.allNumber(shopId, CommonConstants.ONE);
|
||||
if (all.equals(finish)){
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setId(shopId);
|
||||
shopInfoDO.setShopStage(ShopStatusEnum.DONE.getCode());
|
||||
shopInfoDAO.updateShopInfo(shopInfoDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.dto.RegionNode;
|
||||
import com.cool.store.entity.*;
|
||||
@@ -11,14 +12,18 @@ import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopDetailResponse;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.NumberConverter;
|
||||
import com.cool.store.utils.RandomEightCharCodeUtils;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.BaseInfoVO;
|
||||
import com.cool.store.vo.shop.MiniShopPageVO;
|
||||
import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||
import com.cool.store.vo.shop.StageShopCountVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -39,7 +44,8 @@ import static com.cool.store.enums.ErrorCodeEnum.UPDATE_INVESTMENT_MANAGER_FAIL;
|
||||
*/
|
||||
@Service
|
||||
public class ShopServiceImpl implements ShopService {
|
||||
|
||||
@Resource
|
||||
private SysRoleService sysRoleService;
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
@@ -66,6 +72,9 @@ public class ShopServiceImpl implements ShopService {
|
||||
private RegionMapper regionMapper;
|
||||
@Autowired
|
||||
private TransferLogService transferLogService;
|
||||
@Resource
|
||||
private RegionService regionService;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -195,7 +204,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateShopCode(UpdateShopCodeRequest request) {
|
||||
public Integer updateShopCode(UpdateShopCodeRequest request,String userId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||
@@ -203,6 +212,7 @@ public class ShopServiceImpl implements ShopService {
|
||||
shopInfo.setShopCode(request.getShopCode());
|
||||
shopInfo.setShopName(request.getShopName());
|
||||
shopInfo.setUpdateTime(new Date());
|
||||
shopInfo.setUpdateUserId(userId);
|
||||
shopInfo.setRegionId(request.getRegionId());
|
||||
return shopInfoDAO.updateShopInfo(shopInfo);
|
||||
}
|
||||
@@ -265,22 +275,81 @@ public class ShopServiceImpl implements ShopService {
|
||||
shopInfo.setRegionId(request.getRegionId());
|
||||
shopInfo.setJoinMode(request.getJoinMode());
|
||||
shopInfo.setFranchiseBrand(request.getFranchiseBrand());
|
||||
return shopInfoDAO.updateShopInfo(shopInfo);
|
||||
return shopInfoDAO.updateShopInfo(shopInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer updateShopInvestment(Long shopId, String updateUserId, String userId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if(updateUserId.equals(shopInfo.getInvestmentManager())){
|
||||
if (updateUserId.equals(shopInfo.getInvestmentManager())) {
|
||||
throw new ServiceException(UPDATE_INVESTMENT_MANAGER_FAIL);
|
||||
}
|
||||
transferLogService.addLog(shopInfo,shopInfo.getInvestmentManager(),updateUserId,OperationLogTypeEnum.TRANSFER_INVESTMENT_MANAGER_4);
|
||||
transferLogService.addLog(shopInfo, shopInfo.getInvestmentManager(), updateUserId, OperationLogTypeEnum.TRANSFER_INVESTMENT_MANAGER_4);
|
||||
shopInfo.setUpdateTime(new Date());
|
||||
shopInfo.setUpdateUserId(userId);
|
||||
shopInfo.setInvestmentManager(updateUserId);
|
||||
shopInfo.setDevelopmentManager(updateUserId);
|
||||
shopInfo.setSupervisorUserId(updateUserId);
|
||||
return shopInfoDAO.updateShopInfo(shopInfo);
|
||||
return shopInfoDAO.updateShopInfo(shopInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<BranchShopResponse> getBranchShopList(BranchShopRequest request, String userId) {
|
||||
if (!sysRoleService.checkIsAdmin(userId)) {
|
||||
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(userId));
|
||||
if (CollectionUtils.isEmpty(request.getAuthRegionIds())){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(request.getRegionIds())) {
|
||||
if (request.getRegionIds().contains(CommonConstants.ROOT_DEPT_ID_STR)) {
|
||||
request.setRegionIds(null);
|
||||
} else {
|
||||
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
|
||||
}
|
||||
}
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<BranchShopResponse> responses = new ArrayList<>();
|
||||
List<PreparationDTO> preparations = shopInfoDAO.ListByBranchShopRequest(request);
|
||||
if (CollectionUtils.isEmpty(preparations)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
List<Long> regionIds = preparations.stream().map(PreparationDTO::getRegionId).collect(Collectors.toList());
|
||||
List<Long> wantShopAreaIds = preparations.stream().map(PreparationDTO::getWantShopAreaId).collect(Collectors.toList());
|
||||
List<String> investmentManagerIds = preparations.stream().map(PreparationDTO::getInvestmentManager).collect(Collectors.toList());
|
||||
List<Long> shopIds = preparations.stream().map(PreparationDTO::getId).collect(Collectors.toList());
|
||||
List<ScheduleDTO> scheduleList = shopStageInfoDAO.getScheduleList(shopIds);
|
||||
Map<Long, ScheduleDTO> scheduleMap = scheduleList.stream().collect(Collectors.toMap(ScheduleDTO::getShopId, x -> x));
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
Map<String, EnterpriseUserDO> userInfoMap = enterpriseUserDAO.getUserInfoMap(investmentManagerIds);
|
||||
Map<Long, String> wantRegionMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
|
||||
List<ShopStageInfoDO> openActivityActualCompletionTime = shopStageInfoDAO.getOpenActivityActualCompletionTime(shopIds);
|
||||
Map<Long, ShopStageInfoDO> openActivityStageMap = openActivityActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
|
||||
for (PreparationDTO dto : preparations) {
|
||||
BranchShopResponse response = new BranchShopResponse();
|
||||
response.setShopId(dto.getId());
|
||||
response.setLineId(dto.getLineId());
|
||||
response.setUserName(dto.getUsername());
|
||||
response.setMobile(dto.getMobile());
|
||||
response.setShopName(dto.getShopName());
|
||||
response.setShopCode(dto.getShopCode());
|
||||
response.setRegionName(regionNameMap.getOrDefault(dto.getRegionId(),""));
|
||||
response.setFranchiseBrand(FranchiseBrandEnum.getDescByCode(dto.getFranchiseBrand()));
|
||||
response.setJoinMode(JoinModeEnum.getByCode(dto.getJoinMode()));
|
||||
response.setWantRegionName(wantRegionMap.getOrDefault(dto.getWantShopAreaId(),""));
|
||||
response.setPlanOpenTime(dto.getPlanOpenTime());
|
||||
ScheduleDTO scheduleDTO = scheduleMap.getOrDefault(dto.getId(), new ScheduleDTO());
|
||||
response.setTotalColumn(scheduleDTO.getTotalColumn());
|
||||
response.setCompletionColumn(scheduleDTO.getCompletionColumn());
|
||||
response.setOpeningActivityEndTime(DateUtils.strToDate(openActivityStageMap.getOrDefault(dto.getId(),new ShopStageInfoDO()).getActualCompleteTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||
response.setInvestmentManagerName(userInfoMap.getOrDefault(dto.getInvestmentManager(), new EnterpriseUserDO()).getName());
|
||||
response.setShopStatus(ShopStatusEnum.getDesc(dto.getShopStatus()));
|
||||
response.setCreateTime(dto.getCreateTime());
|
||||
response.setOpenTime();
|
||||
responses.add(response);
|
||||
}
|
||||
|
||||
return new PageInfo<>(responses);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,6 +201,7 @@ public class TempUserDetailServiceImpl implements TempUserDetailService {
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_51);
|
||||
//状态结束
|
||||
preparationService.whetherToOpenForAcceptance(shopId);
|
||||
preparationService.updateShopStatus(shopId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -178,6 +178,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
* @return 解析后时间
|
||||
*/
|
||||
public static Date strToDate(String strDate, String pattern) {
|
||||
if (StringUtils.isBlank(strDate)){
|
||||
return null;
|
||||
}
|
||||
SimpleDateFormat formatter = new SimpleDateFormat(pattern);
|
||||
ParsePosition pos = new ParsePosition(0);
|
||||
return formatter.parse(strDate, pos);
|
||||
|
||||
@@ -34,4 +34,11 @@ public class ExportController {
|
||||
request.setCurUserId(CurrentUserHolder.getUserId());
|
||||
return ResponseResult.success(exportService.preparationList(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/branchShopList")
|
||||
@ApiOperation("进度管理")
|
||||
public ResponseResult branchShopList(@RequestBody BranchShopRequest request) {
|
||||
return ResponseResult.success(exportService.branchShopList(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.dto.TransferLogDTO;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopDetailResponse;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ShopService;
|
||||
import com.cool.store.service.TransferLogService;
|
||||
@@ -69,7 +70,7 @@ public class PCShopController {
|
||||
@ApiOperation("修改门店编号和门店名称和门店所属区域")
|
||||
@PostMapping("/updateShopCode")
|
||||
public ResponseResult<Integer> updateShopCode(@RequestBody @Validated UpdateShopCodeRequest request) {
|
||||
return ResponseResult.success(shopService.updateShopCode(request));
|
||||
return ResponseResult.success(shopService.updateShopCode(request,CurrentUserHolder.getUserId()));
|
||||
}
|
||||
@ApiOperation("新建分店")
|
||||
@PostMapping("/addBranchShop")
|
||||
@@ -110,4 +111,11 @@ public class PCShopController {
|
||||
@RequestParam(value = "lineShopType",defaultValue = "1") Integer lineShopType) {
|
||||
return ResponseResult.success(transferLogService.getTransferLogPage(pageNum,pageSize,lineId,lineShopType));
|
||||
}
|
||||
|
||||
@ApiOperation("开店管理列表")
|
||||
@PostMapping("/getBranchShopList")
|
||||
public ResponseResult<PageInfo<BranchShopResponse>> getBranchShopList(@RequestBody @Validated BranchShopRequest request) {
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
return ResponseResult.success(shopService.getBranchShopList(request,userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ rocketmq.topic=simple_message
|
||||
|
||||
#oss配置
|
||||
oss.host=https://oss-store.coolcollege.cn/
|
||||
oss.accessKeyId=LTAI5tRSXy2MrqaaBJ6gReur
|
||||
oss.accessKeySecret=FFsl8d9batprJ0vXr0k4Y8ada40Wm2
|
||||
oss.accessKeyId=LTAI5t6Zk3Y3vyrMXC87jGYB
|
||||
oss.accessKeySecret=6Gw06jtW5xNKWqbhnt1KmVZx1z9Dev
|
||||
oss.endpoint=oss-cn-hangzhou.aliyuncs.com
|
||||
oss.bucket=cool-store-hsay
|
||||
oss.file.dir=partner/171cddee76471740/
|
||||
|
||||
Reference in New Issue
Block a user