新店开业
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.NewStoreOpeningDO;
|
||||
import com.cool.store.mapper.NewStoreOpeningMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-24 14:33
|
||||
*/
|
||||
@Repository
|
||||
public class NewStoreOpeningDAO {
|
||||
|
||||
@Resource
|
||||
private NewStoreOpeningMapper newStoreOpeningMapper;
|
||||
|
||||
public List<NewStoreOpeningDO> storeTodoList(Long shopId) {
|
||||
return newStoreOpeningMapper.select(NewStoreOpeningDO.builder().shopId(shopId).build());
|
||||
}
|
||||
|
||||
public int insertSelective(NewStoreOpeningDO newStoreOpeningDO) {
|
||||
return newStoreOpeningMapper.insertSelective(newStoreOpeningDO);
|
||||
}
|
||||
|
||||
public int deleteByPrimaryKey(Long id) {
|
||||
return newStoreOpeningMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,7 +33,7 @@
|
||||
o.id AS openAcceptanceInfoId,
|
||||
s.id AS shopId,
|
||||
s.shop_name AS shopName,
|
||||
s.shop_code AS shopCode,
|
||||
s.store_num AS storeNum,
|
||||
s.shop_manager_user_id AS shopManagerUserId,
|
||||
s.supervisor_user_id AS supervisorUserId,
|
||||
l.username AS partnerName,
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.persistence.*;
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "xfsg_new_store_opening")
|
||||
public class NewStoreOpeningDO {
|
||||
@Id
|
||||
@@ -38,108 +47,4 @@ public class NewStoreOpeningDO {
|
||||
*/
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取line_info.id
|
||||
*
|
||||
* @return shop_id - line_info.id
|
||||
*/
|
||||
public Long getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置line_info.id
|
||||
*
|
||||
* @param shopId line_info.id
|
||||
*/
|
||||
public void setShopId(Long shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待办事项
|
||||
*
|
||||
* @return todo_item - 待办事项
|
||||
*/
|
||||
public String getTodoItem() {
|
||||
return todoItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置待办事项
|
||||
*
|
||||
* @param todoItem 待办事项
|
||||
*/
|
||||
public void setTodoItem(String todoItem) {
|
||||
this.todoItem = todoItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取完成时间
|
||||
*
|
||||
* @return completion_time - 完成时间
|
||||
*/
|
||||
public Date getCompletionTime() {
|
||||
return completionTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置完成时间
|
||||
*
|
||||
* @param completionTime 完成时间
|
||||
*/
|
||||
public void setCompletionTime(Date completionTime) {
|
||||
this.completionTime = completionTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取创建时间
|
||||
*
|
||||
* @return create_time - 创建时间
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置创建时间
|
||||
*
|
||||
* @param createTime 创建时间
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取更新时间
|
||||
*
|
||||
* @return update_time - 更新时间
|
||||
*/
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置更新时间
|
||||
*
|
||||
* @param updateTime 更新时间
|
||||
*/
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-24 16:40
|
||||
*/
|
||||
@Data
|
||||
public class IdRequest {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
*/
|
||||
@Data
|
||||
public class NewStoreOpeningRequest {
|
||||
/**
|
||||
* line_info.id
|
||||
*/
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 待办事项
|
||||
*/
|
||||
@ApiModelProperty("待办事项")
|
||||
private String todoItem;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
@ApiModelProperty("完成时间")
|
||||
private Date completionTime;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
*/
|
||||
@Data
|
||||
public class NewStoreOpeningVO {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* line_info.id
|
||||
*/
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 待办事项
|
||||
*/
|
||||
@ApiModelProperty("待办事项")
|
||||
private String todoItem;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
@ApiModelProperty("完成时间")
|
||||
private Date completionTime;
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class OpenAcceptanceInfoListVO {
|
||||
@ApiModelProperty("门店名称")
|
||||
private String shopName;
|
||||
@ApiModelProperty("门店代码")
|
||||
private String shopCode;
|
||||
private String storeNum;
|
||||
@ApiModelProperty("开店负责人id")
|
||||
private String shopManagerUserId;
|
||||
@ApiModelProperty("开店负责人名称")
|
||||
@@ -46,6 +46,8 @@ public class OpenAcceptanceInfoListVO {
|
||||
private String largeRegionName;
|
||||
@ApiModelProperty("计划开业时间")
|
||||
private Date planOpenTime;
|
||||
@ApiModelProperty("新店开业结束时间")
|
||||
private Date planOpenEndTime;
|
||||
@ApiModelProperty("验收状态 0:未验收 1:已验收")
|
||||
private String acceptanceStatus;
|
||||
@ApiModelProperty("招商经理id")
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
*/
|
||||
@Data
|
||||
public class ShopAcceptanceVO {
|
||||
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("开业时间")
|
||||
private Date planOpenTime;
|
||||
|
||||
/**
|
||||
* 验收状态
|
||||
*/
|
||||
@ApiModelProperty("验收状态 0:验收中 1:已验收")
|
||||
private Integer acceptanceStatus;
|
||||
|
||||
@ApiModelProperty("店铺子阶段验收结果")
|
||||
private List<ShopStageAcceptanceVO> shopStageAcceptanceList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.NewStoreOpeningRequest;
|
||||
import com.cool.store.vo.NewStoreOpeningVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-24 14:32
|
||||
*/
|
||||
public interface NewStoreOpeningService {
|
||||
|
||||
List<NewStoreOpeningVO> storeTodoList(Long shopId);
|
||||
|
||||
void addStoreTodo(NewStoreOpeningRequest newStoreOpeningRequest);
|
||||
|
||||
void removeStoreTodo(Long id);
|
||||
}
|
||||
@@ -3,11 +3,9 @@ package com.cool.store.service;
|
||||
import com.cool.store.request.OpenAcceptanceRequest;
|
||||
import com.cool.store.request.ShopAcceptanceRequest;
|
||||
import com.cool.store.vo.OpenAcceptanceInfoListVO;
|
||||
import com.cool.store.vo.ShopStageAcceptanceVO;
|
||||
import com.cool.store.vo.ShopAcceptanceVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-22 14:41
|
||||
@@ -26,7 +24,7 @@ public interface OpenAcceptanceInfoService {
|
||||
* @param shopId 店铺id
|
||||
* @return
|
||||
*/
|
||||
List<ShopStageAcceptanceVO> acceptanceStageList(Long shopId);
|
||||
ShopAcceptanceVO acceptanceStageList(Long shopId);
|
||||
|
||||
/**
|
||||
* 验收
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.NewStoreOpeningDAO;
|
||||
import com.cool.store.entity.NewStoreOpeningDO;
|
||||
import com.cool.store.request.NewStoreOpeningRequest;
|
||||
import com.cool.store.service.NewStoreOpeningService;
|
||||
import com.cool.store.vo.NewStoreOpeningVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author byd
|
||||
* @date 2024-04-24 14:32
|
||||
*/
|
||||
@Service
|
||||
public class NewStoreOpeningServiceImpl implements NewStoreOpeningService {
|
||||
|
||||
@Resource
|
||||
private NewStoreOpeningDAO newStoreOpeningDAO;
|
||||
|
||||
@Override
|
||||
public List<NewStoreOpeningVO> storeTodoList(Long shopId) {
|
||||
List<NewStoreOpeningDO> storeOpeningDOList = newStoreOpeningDAO.storeTodoList(shopId);
|
||||
List<NewStoreOpeningVO> resultList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(storeOpeningDOList)){
|
||||
storeOpeningDOList.forEach(storeOpeningDO -> {
|
||||
NewStoreOpeningVO newStoreOpeningVO = new NewStoreOpeningVO();
|
||||
newStoreOpeningVO.setId(storeOpeningDO.getId());
|
||||
newStoreOpeningVO.setShopId(storeOpeningDO.getShopId());
|
||||
newStoreOpeningVO.setCompletionTime(storeOpeningDO.getCompletionTime());
|
||||
newStoreOpeningVO.setTodoItem(storeOpeningDO.getTodoItem());
|
||||
resultList.add(newStoreOpeningVO);
|
||||
});
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStoreTodo(NewStoreOpeningRequest newStoreOpeningRequest) {
|
||||
NewStoreOpeningDO newStoreOpeningDO = new NewStoreOpeningDO();
|
||||
newStoreOpeningDO.setShopId(newStoreOpeningRequest.getShopId());
|
||||
newStoreOpeningDO.setTodoItem(newStoreOpeningRequest.getTodoItem());
|
||||
newStoreOpeningDO.setCompletionTime(newStoreOpeningRequest.getCompletionTime());
|
||||
newStoreOpeningDAO.insertSelective(newStoreOpeningDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeStoreTodo(Long id) {
|
||||
newStoreOpeningDAO.deleteByPrimaryKey(id);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.OpenAcceptanceInfoDAO;
|
||||
import com.cool.store.dao.RegionDao;
|
||||
@@ -15,7 +17,10 @@ import com.cool.store.request.OpenAcceptanceRequest;
|
||||
import com.cool.store.request.ShopAcceptanceRequest;
|
||||
import com.cool.store.service.OpenAcceptanceInfoService;
|
||||
import com.cool.store.service.RegionService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.vo.OpenAcceptanceInfoListVO;
|
||||
import com.cool.store.vo.ShopAcceptanceVO;
|
||||
import com.cool.store.vo.ShopStageAcceptanceVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
@@ -65,6 +70,9 @@ public class OpenAcceptanceInfoServiceImpl implements OpenAcceptanceInfoService
|
||||
vo.setShopManagerUserName(userNameMap.get(vo.getShopManagerUserId()));
|
||||
vo.setAcceptanceUserName(userNameMap.get(vo.getAcceptanceUserId()));
|
||||
vo.setInvestmentManagerName(userNameMap.get(vo.getInvestmentManager()));
|
||||
if(vo.getPlanOpenTime() != null){
|
||||
vo.setPlanOpenEndTime(DateUtils.addDays(vo.getPlanOpenTime(), CommonConstants.THREE));
|
||||
}
|
||||
if (vo.getRegionId() != null) {
|
||||
Long bigRegionIdByAreaId = regionService.getBigRegionIdByAreaId(vo.getRegionId());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(Arrays.asList(bigRegionIdByAreaId, vo.getRegionId()));
|
||||
@@ -79,8 +87,7 @@ public class OpenAcceptanceInfoServiceImpl implements OpenAcceptanceInfoService
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopStageAcceptanceVO> acceptanceStageList(Long shopId) {
|
||||
|
||||
public ShopAcceptanceVO acceptanceStageList(Long shopId) {
|
||||
List<ShopStageInfoDO> stageInfoDOList = shopStageInfoDAO.getShopStageInfo(shopId, ShopStageEnum.SHOP_STAGE_2.getShopStage());
|
||||
List<ShopStageAcceptanceVO> result = new ArrayList<>();
|
||||
OpenAcceptanceInfoDO openAcceptanceInfoDO = openAcceptanceInfoDAO.selectOne(OpenAcceptanceInfoDO.builder().shopId(shopId).build());
|
||||
@@ -101,7 +108,12 @@ public class OpenAcceptanceInfoServiceImpl implements OpenAcceptanceInfoService
|
||||
}
|
||||
result.add(shopStageAcceptanceVO);
|
||||
});
|
||||
return result;
|
||||
ShopAcceptanceVO shopAcceptanceVO = new ShopAcceptanceVO();
|
||||
shopAcceptanceVO.setShopStageAcceptanceList(result);
|
||||
shopAcceptanceVO.setShopId(shopId);
|
||||
shopAcceptanceVO.setPlanOpenTime(openAcceptanceInfoDO.getPlanOpenTime());
|
||||
shopAcceptanceVO.setAcceptanceStatus(openAcceptanceInfoDO.getAcceptanceStatus());
|
||||
return shopAcceptanceVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.request.IdRequest;
|
||||
import com.cool.store.request.NewStoreOpeningRequest;
|
||||
import com.cool.store.request.OpenAcceptanceRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.NewStoreOpeningService;
|
||||
import com.cool.store.service.OpenAcceptanceInfoService;
|
||||
import com.cool.store.vo.NewStoreOpeningVO;
|
||||
import com.cool.store.vo.OpenAcceptanceInfoListVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author byd
|
||||
* @Date 2023/6/15 9:49
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("pc/newStoreOpening")
|
||||
@Api(tags = "PC新店开业")
|
||||
public class NewStoreOpeningController {
|
||||
|
||||
@Resource
|
||||
OpenAcceptanceInfoService openAcceptanceInfoService;
|
||||
|
||||
@Resource
|
||||
NewStoreOpeningService newStoreOpeningService;
|
||||
|
||||
@GetMapping(path = "/newStoreOpeningList")
|
||||
@ApiOperation("新店开业列表")
|
||||
public ResponseResult<PageInfo<OpenAcceptanceInfoListVO>> newStoreOpeningList(OpenAcceptanceRequest openAcceptanceRequest) {
|
||||
//已验收
|
||||
openAcceptanceRequest.setAcceptanceStatus(1);
|
||||
return ResponseResult.success(openAcceptanceInfoService.openAcceptanceList(openAcceptanceRequest));
|
||||
}
|
||||
|
||||
@GetMapping(path = "/storeTodoList")
|
||||
@ApiOperation("新店开业待办列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "shopId", value = "店铺id", required = true)
|
||||
})
|
||||
public ResponseResult<List<NewStoreOpeningVO>> storeTodoList(@RequestParam("shopId") Long shopId) {
|
||||
return ResponseResult.success(newStoreOpeningService.storeTodoList(shopId));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path = "/addStoreTodo")
|
||||
@ApiOperation("新店开业-新建待办")
|
||||
public ResponseResult<Boolean> addStoreTodo(@RequestBody NewStoreOpeningRequest newStoreOpeningRequest) {
|
||||
newStoreOpeningService.addStoreTodo(newStoreOpeningRequest);
|
||||
return ResponseResult.success(Boolean.TRUE);
|
||||
}
|
||||
|
||||
@PostMapping(path = "/removeStoreTodo")
|
||||
@ApiOperation("新店开业-删除待办")
|
||||
public ResponseResult<Boolean> removeStoreTodo(@RequestBody IdRequest idRequest) {
|
||||
newStoreOpeningService.removeStoreTodo(idRequest.getId());
|
||||
return ResponseResult.success(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.cool.store.request.ShopAcceptanceRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.OpenAcceptanceInfoService;
|
||||
import com.cool.store.vo.OpenAcceptanceInfoListVO;
|
||||
import com.cool.store.vo.ShopAcceptanceVO;
|
||||
import com.cool.store.vo.ShopStageAcceptanceVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -41,7 +42,7 @@ public class OpenAcceptanceInfoController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "shopId", value = "店铺id", required = true)
|
||||
})
|
||||
public ResponseResult<List<ShopStageAcceptanceVO>> acceptanceStageList(@RequestParam("shopId") Long shopId) {
|
||||
public ResponseResult<ShopAcceptanceVO> acceptanceStageList(@RequestParam("shopId") Long shopId) {
|
||||
return ResponseResult.success(openAcceptanceInfoService.acceptanceStageList(shopId));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user