建店资料收集
This commit is contained in:
@@ -30,6 +30,8 @@ public enum UserRoleEnum {
|
||||
ENGINEER_DEP_SUPERVISOR(250000000L, "工程部监理"),
|
||||
ENGINEER_DEP_MANAGER(260000000L, "工程部高级经理"),
|
||||
STRONG_INVESTMENT_COMMISSIONER(270000000L, "强加盟招商专员"),
|
||||
HUO_MA_EMPLOYEE(280000000L,"火码"),
|
||||
IT_EMPLOYEE(290000000L,"IT")
|
||||
;
|
||||
|
||||
private Long code;
|
||||
|
||||
@@ -29,8 +29,10 @@ public class PosAndOrderInfoDAO {
|
||||
if (posAndOrderInfoDO == null) {
|
||||
return 0;
|
||||
}
|
||||
Example example = new Example(BuildInformationDO.class);
|
||||
example.createCriteria().andEqualTo("shopId", posAndOrderInfoDO.getShopId());
|
||||
Example example = new Example(PosAndOrderInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("shopId", posAndOrderInfoDO.getShopId())
|
||||
.andEqualTo("type",posAndOrderInfoDO.getType());
|
||||
return posAndOrderInfoMapper.updateByExampleSelective(posAndOrderInfoDO,example);
|
||||
}
|
||||
public PosAndOrderInfoDO selectOneByShopId(Long shopId,Integer type) {
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.cool.store.entity.PosAndOrderInfoDO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2024/10/09/下午5:19
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class PostAndOrderRequest {
|
||||
|
||||
@NotNull
|
||||
private Long shopId;
|
||||
@ApiModelProperty(value = "1-pos 2-订货系统",hidden = true)
|
||||
private Integer type;
|
||||
@NotBlank
|
||||
@ApiModelProperty("账号")
|
||||
private String account;
|
||||
@NotBlank
|
||||
@ApiModelProperty("密码")
|
||||
private String password;
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
public PosAndOrderInfoDO toDO(){
|
||||
PosAndOrderInfoDO posAndOrderInfoDO = new PosAndOrderInfoDO();
|
||||
posAndOrderInfoDO.setShopId(this.shopId);
|
||||
posAndOrderInfoDO.setType(this.type);
|
||||
posAndOrderInfoDO.setAccount(this.account);
|
||||
posAndOrderInfoDO.setPassword(this.password);
|
||||
posAndOrderInfoDO.setRemark(this.remark);
|
||||
return posAndOrderInfoDO;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import com.cool.store.entity.PosAndOrderInfoDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2024/10/09/下午5:36
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class PosAndOrderResponse {
|
||||
|
||||
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("1-pos 2-订货系统',")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("账号")
|
||||
private String account;
|
||||
|
||||
@ApiModelProperty("密码")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createUser;
|
||||
|
||||
}
|
||||
@@ -13,8 +13,8 @@ public interface BuildInformationService {
|
||||
|
||||
BuildInformationResponse getBuildInformation(Long shopId);
|
||||
|
||||
Integer submit(BuildInformationRequest request);
|
||||
Integer submitOrUpdate(BuildInformationRequest request);
|
||||
|
||||
|
||||
Integer update(BuildInformationRequest request);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
|
||||
import com.cool.store.request.PostAndOrderRequest;
|
||||
import com.cool.store.response.PosAndOrderResponse;
|
||||
|
||||
/**
|
||||
* @author EDY
|
||||
* @description 针对表【xfsg_pos_and_order_info(pos/订货系统表)】的数据库操作Service
|
||||
@@ -8,4 +11,9 @@ package com.cool.store.service;
|
||||
*/
|
||||
public interface PosAndOrderInfoService {
|
||||
|
||||
Integer submitOrUpdate(PostAndOrderRequest request ,String user);
|
||||
|
||||
|
||||
PosAndOrderResponse get(Long shopId, Integer type);
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.cool.store.service.BuildInformationService;
|
||||
import com.cool.store.mapper.BuildInformationMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
@@ -80,28 +81,22 @@ public class BuildInformationServiceImpl implements BuildInformationService{
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer submit(BuildInformationRequest request) {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer submitOrUpdate(BuildInformationRequest request) {
|
||||
BuildInformationDO informationDO = buildInformationDAO.selectOneByShopId(request.getShopId());
|
||||
if (Objects.nonNull(informationDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||
}
|
||||
BuildInformationDO buildInformationDO = request.toDO();
|
||||
buildInformationDO.setCreateTime(new Date());
|
||||
buildInformationDO.setUpdateTime(new Date());
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_153);
|
||||
return buildInformationDAO.insertSelective(buildInformationDO);
|
||||
if (Objects.isNull(informationDO)) {
|
||||
buildInformationDO.setCreateTime(new Date());
|
||||
buildInformationDO.setUpdateTime(new Date());
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_153);
|
||||
return buildInformationDAO.insertSelective(buildInformationDO);
|
||||
}else {
|
||||
buildInformationDO.setUpdateTime(new Date());
|
||||
return buildInformationDAO.updateByShopIdSelective(buildInformationDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer update(BuildInformationRequest request) {
|
||||
BuildInformationDO informationDO = buildInformationDAO.selectOneByShopId(request.getShopId());
|
||||
if (Objects.isNull(informationDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.UPDATE_FAIL);
|
||||
}
|
||||
BuildInformationDO buildInformationDO = request.toDO();
|
||||
buildInformationDO.setUpdateTime(new Date());
|
||||
return buildInformationDAO.updateByShopIdSelective(buildInformationDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,73 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.PosAndOrderInfoDAO;
|
||||
import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.entity.PosAndOrderInfoDO;
|
||||
import com.cool.store.enums.PosAndOrderEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author EDY
|
||||
* @description 针对表【xfsg_pos_and_order_info(pos/订货系统表)】的数据库操作Service实现
|
||||
* @createDate 2024-10-09 14:39:11
|
||||
*/
|
||||
* @author EDY
|
||||
* @description 针对表【xfsg_pos_and_order_info(pos/订货系统表)】的数据库操作Service实现
|
||||
* @createDate 2024-10-09 14:39:11
|
||||
*/
|
||||
@Service
|
||||
public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService{
|
||||
public class PosAndOrderInfoServiceImpl implements PosAndOrderInfoService {
|
||||
|
||||
@Resource
|
||||
private PosAndOrderInfoDAO posAndOrderInfoDAO;
|
||||
@Autowired
|
||||
private ShopStageInfoDAO shopStageInfoDAO;
|
||||
@Autowired
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer submitOrUpdate(PostAndOrderRequest request, String user) {
|
||||
PosAndOrderInfoDO posAndOrderInfoDO = posAndOrderInfoDAO.selectOneByShopId(request.getShopId(), request.getType());
|
||||
PosAndOrderInfoDO posAndOrderInfo = request.toDO();
|
||||
posAndOrderInfo.setCreateUser(user);
|
||||
posAndOrderInfo.setCreateTime(new Date());
|
||||
if (Objects.isNull(posAndOrderInfoDO)) {
|
||||
if (request.getType().equals(PosAndOrderEnum.POS.getCode())) {
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_163);
|
||||
}else if (request.getType().equals(PosAndOrderEnum.ORDER.getCode())) {
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_173);
|
||||
}
|
||||
return posAndOrderInfoDAO.insertSelective(posAndOrderInfo);
|
||||
}else{
|
||||
return posAndOrderInfoDAO.updateByShopIdSelective(posAndOrderInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PosAndOrderResponse get(Long shopId, Integer type) {
|
||||
PosAndOrderResponse response = new PosAndOrderResponse();
|
||||
PosAndOrderInfoDO posAndOrderInfoDO = posAndOrderInfoDAO.selectOneByShopId(shopId,type);
|
||||
if (Objects.nonNull(posAndOrderInfoDO)) {
|
||||
response.setShopId(posAndOrderInfoDO.getShopId());
|
||||
response.setAccount(posAndOrderInfoDO.getAccount());
|
||||
response.setType(posAndOrderInfoDO.getType());
|
||||
response.setPassword(posAndOrderInfoDO.getPassword());
|
||||
response.setRemark(posAndOrderInfoDO.getRemark());
|
||||
response.setCreateTime(posAndOrderInfoDO.getCreateTime());
|
||||
response.setCreateUser(enterpriseUserDAO.getUserName(posAndOrderInfoDO.getCreateUser()));
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.enums.PosAndOrderEnum;
|
||||
import com.cool.store.request.PostAndOrderRequest;
|
||||
import com.cool.store.response.PosAndOrderResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.PosAndOrderInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2024/10/09/下午5:44
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Api("pc订货系统")
|
||||
@RestController
|
||||
@RequestMapping("/pc/orderSys")
|
||||
public class PCOrderSysController {
|
||||
|
||||
@Resource
|
||||
private PosAndOrderInfoService posAndOrderInfoService;
|
||||
|
||||
@ApiOperation("提交或修改")
|
||||
@PostMapping("/submitOrUpdate")
|
||||
public ResponseResult<Integer> submitOrUpdate(@RequestBody @Validated PostAndOrderRequest request){
|
||||
request.setType(PosAndOrderEnum.ORDER.getCode());
|
||||
return ResponseResult.success(posAndOrderInfoService.submitOrUpdate(request, CurrentUserHolder.getUserId()));
|
||||
}
|
||||
|
||||
@ApiOperation("获取")
|
||||
@GetMapping("/get")
|
||||
public ResponseResult<PosAndOrderResponse> get(@RequestParam("shopId") Long shopId){
|
||||
return ResponseResult.success(posAndOrderInfoService.get(shopId,PosAndOrderEnum.ORDER.getCode()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.enums.PosAndOrderEnum;
|
||||
import com.cool.store.request.PostAndOrderRequest;
|
||||
import com.cool.store.response.PosAndOrderResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.PosAndOrderInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2024/10/09/下午5:44
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Api("pcPos")
|
||||
@RestController
|
||||
@RequestMapping("/pc/pos")
|
||||
public class PCPosController {
|
||||
|
||||
@Resource
|
||||
private PosAndOrderInfoService posAndOrderInfoService;
|
||||
|
||||
@ApiOperation("提交或修改")
|
||||
@PostMapping("/submitOrUpdate")
|
||||
public ResponseResult<Integer> submitOrUpdate(@RequestBody @Validated PostAndOrderRequest request){
|
||||
request.setType(PosAndOrderEnum.POS.getCode());
|
||||
return ResponseResult.success(posAndOrderInfoService.submitOrUpdate(request, CurrentUserHolder.getUserId()));
|
||||
}
|
||||
|
||||
@ApiOperation("获取")
|
||||
@GetMapping("/get")
|
||||
public ResponseResult<PosAndOrderResponse> get(@RequestParam("shopId") Long shopId){
|
||||
return ResponseResult.success(posAndOrderInfoService.get(shopId,PosAndOrderEnum.POS.getCode()));
|
||||
}
|
||||
}
|
||||
@@ -30,16 +30,12 @@ public class MiniBuildInformationController {
|
||||
return ResponseResult.success(buildInformationService.getBuildInformation(shopId));
|
||||
}
|
||||
|
||||
@ApiOperation("提交")
|
||||
@PostMapping("/submit")
|
||||
@ApiOperation("提交/修改")
|
||||
@PostMapping("/submitOrUpdate")
|
||||
public ResponseResult<Integer> submitBuildInformation(@RequestBody @Validated BuildInformationRequest request) {
|
||||
return ResponseResult.success(buildInformationService.submit(request));
|
||||
}
|
||||
@ApiOperation("修改")
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Integer> update(@RequestBody @Validated BuildInformationRequest request) {
|
||||
return ResponseResult.success(buildInformationService.update(request));
|
||||
return ResponseResult.success(buildInformationService.submitOrUpdate(request));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.enums.PosAndOrderEnum;
|
||||
import com.cool.store.response.PosAndOrderResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.PosAndOrderInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2024/10/09/下午5:44
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Api("mini订货系统")
|
||||
@RestController
|
||||
@RequestMapping("/mini/OrderSys")
|
||||
public class miniOrderSysController {
|
||||
|
||||
@Resource
|
||||
private PosAndOrderInfoService posAndOrderInfoService;
|
||||
|
||||
|
||||
@ApiOperation("获取")
|
||||
@GetMapping("/get")
|
||||
public ResponseResult<PosAndOrderResponse> get(@RequestParam("shopId") Long shopId){
|
||||
return ResponseResult.success(posAndOrderInfoService.get(shopId,PosAndOrderEnum.ORDER.getCode()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.enums.PosAndOrderEnum;
|
||||
import com.cool.store.request.PostAndOrderRequest;
|
||||
import com.cool.store.response.PosAndOrderResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.PosAndOrderInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2024/10/09/下午5:44
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Api("miniPos")
|
||||
@RestController
|
||||
@RequestMapping("/mini/pos")
|
||||
public class miniPosController {
|
||||
|
||||
@Resource
|
||||
private PosAndOrderInfoService posAndOrderInfoService;
|
||||
|
||||
|
||||
@ApiOperation("获取")
|
||||
@GetMapping("/get")
|
||||
public ResponseResult<PosAndOrderResponse> get(@RequestParam("shopId") Long shopId){
|
||||
return ResponseResult.success(posAndOrderInfoService.get(shopId,PosAndOrderEnum.POS.getCode()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user