提交 b6c56fd0 作者: chaining

feat: 补充墙盒申请字段信息

父级 e23cffe6
...@@ -100,7 +100,7 @@ public class WallboxApplyController { ...@@ -100,7 +100,7 @@ public class WallboxApplyController {
* 查询墙盒申请列表 * 查询墙盒申请列表
*/ */
@GetMapping("/list") @GetMapping("/list")
@ApiOperation(value = "分页查询墙盒申请列表") @ApiOperation(value = "分页查询墙盒申请列表-总仓")
@ApiImplicitParams({@ApiImplicitParam(name = "page", value = "一页显示数量", dataType = "int", paramType = "query", @ApiImplicitParams({@ApiImplicitParam(name = "page", value = "一页显示数量", dataType = "int", paramType = "query",
required = true), @ApiImplicitParam(name = "pagecount", value = "页码", dataType = "int", paramType = required = true), @ApiImplicitParam(name = "pagecount", value = "页码", dataType = "int", paramType =
"query", required = true)}) "query", required = true)})
...@@ -125,6 +125,44 @@ public class WallboxApplyController { ...@@ -125,6 +125,44 @@ public class WallboxApplyController {
return new BaseResponse<>(list); return new BaseResponse<>(list);
} }
/**
* 墙盒申请安装团队分页查询
*/
@GetMapping("/supplierList")
@ApiOperation(value = "分页查询墙盒申请列表-安装团队")
@ApiImplicitParams({@ApiImplicitParam(name = "page", value = "一页显示数量", dataType = "int", paramType = "query",
required = true), @ApiImplicitParam(name = "pagecount", value = "页码", dataType = "int", paramType =
"query", required = true)})
public BaseResponse<List<WallboxApplyInstallListVO>> supplierList(WallboxApplyReqVO req) {
SessionInfo loginUser = tokenService.getUser();
String userId = loginUser.getUserId();
SupplierStaff infoByAccount = supplierStaffService.getByAccountId(Integer.valueOf(userId));
Supplier supplier = supplierService.getById(infoByAccount.getSupplierId());
if (supplier == null) {
throw new ServiceException("供应商不存在");
}
req.setSupplierId(supplier.getId());
List<WallboxApplyInstallListVO> list =
wallboxApplyService.selectWallboxApplyListFromOrder(WallboxApplyConvert.INSTANCE.convert(req));
LocalDateTime currentTime = LocalDateTime.now();
for (WallboxApplyInstallListVO apply : list) {
Date createdDate = apply.getCreatedTime();
LocalDateTime createdTime = LocalDateTime.ofInstant(createdDate.toInstant(), ZoneId.systemDefault());
LocalDateTime endTime = createdTime.plusHours(24);
long remainingHours = currentTime.until(endTime, ChronoUnit.HOURS);
remainingHours = Math.max(remainingHours, 0); // 将剩余小时数限制在0-24之间
if (remainingHours == 0) {
apply.setIfTimeout(1L);
} else {
apply.setIfTimeout(0L);
}
apply.setTimeRemaining(Long.toString(remainingHours));
}
return new BaseResponse<>(list);
}
@GetMapping("/get-import-template") @GetMapping("/get-import-template")
@ApiOperation("获得导入模板") @ApiOperation("获得导入模板")
...@@ -216,12 +254,22 @@ public class WallboxApplyController { ...@@ -216,12 +254,22 @@ public class WallboxApplyController {
return new BaseResponse<>(supplier); return new BaseResponse<>(supplier);
} }
@ApiOperation(value = "查询当前账号所属团队")
@GetMapping("/getTeamOrder")
public BaseResponse<Object> getTeamOrder(){
SessionInfo loginUser = tokenService.getUser();
String userId = loginUser.getUserId();
SupplierStaff infoByAccount = supplierStaffService.getByAccountId(Integer.valueOf(userId));
Supplier supplier = supplierService.getById(infoByAccount.getSupplierId());
return new BaseResponse<>();
}
/** /**
* 修改墙盒申请 * 修改墙盒申请
*/ */
@PutMapping @PutMapping
public BaseResponse<Object> edit(@RequestBody WallboxApply tWallboxApply) { public BaseResponse<Object> edit(@RequestBody WallboxApply tWallboxApply) {
//TODO 判断是否超时
return new BaseResponse<>(wallboxApplyService.updateWallboxApply(tWallboxApply)); return new BaseResponse<>(wallboxApplyService.updateWallboxApply(tWallboxApply));
} }
......
...@@ -27,6 +27,9 @@ public class WallboxApplyCheckVO { ...@@ -27,6 +27,9 @@ public class WallboxApplyCheckVO {
@NotNull(message = "审核意见不能为空") @NotNull(message = "审核意见不能为空")
private Long checkStatus; private Long checkStatus;
@ApiModelProperty(value = "墙盒类型", notes = "1:品牌墙盒,2:三方墙盒", example = "1", required = true)
private String materialType;
@ApiModelProperty(value = "审核备注", notes = "", example = "同意", required = true) @ApiModelProperty(value = "审核备注", notes = "", example = "同意", required = true)
private String checkRemarks; private String checkRemarks;
} }
...@@ -14,11 +14,14 @@ import lombok.Data; ...@@ -14,11 +14,14 @@ import lombok.Data;
public class WallboxApplyReqVO { public class WallboxApplyReqVO {
/** 申请团队名称 */ /** 申请团队名称 */
@ApiModelProperty(value = "申请团队名称", required = true) @ApiModelProperty(value = "申请团队名称")
private String supplierTeam; private String supplierTeam;
@ApiModelProperty(value = "申请团队id")
private String supplierId;
/** 区域id */ /** 区域id */
@ApiModelProperty(value = "区域id", required = true) @ApiModelProperty(value = "区域id")
private String regionId; private String regionId;
/** 申请状态:0:已申请,1:已通过,2:已驳回,3:已关闭 */ /** 申请状态:0:已申请,1:已通过,2:已驳回,3:已关闭 */
......
...@@ -19,6 +19,8 @@ import com.ihidea.core.support.session.SessionInfo; ...@@ -19,6 +19,8 @@ import com.ihidea.core.support.session.SessionInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -48,7 +50,7 @@ public class WallboxApplyService { ...@@ -48,7 +50,7 @@ public class WallboxApplyService {
@Autowired @Autowired
private SupplierStaffDao supplierStaffDao; private SupplierStaffDao supplierStaffDao;
private final Integer CHECK_STATUS_REJECT = 2; private final Integer CHECK_STATUS_REJECT = 3;
/** /**
* 查询墙盒申请 * 查询墙盒申请
...@@ -100,19 +102,10 @@ public class WallboxApplyService { ...@@ -100,19 +102,10 @@ public class WallboxApplyService {
public List<WallboxApplyInstallListVO> selectWallboxApplyListFromOrder(WallboxApply WallboxApply) { public List<WallboxApplyInstallListVO> selectWallboxApplyListFromOrder(WallboxApply WallboxApply) {
List<WallboxApplyInstallListVO> list = List<WallboxApplyInstallListVO> list =
wallboxApplyMapper.selectWallboxApplyListFromOrder(WallboxApply); wallboxApplyMapper.selectWallboxApplyListFromOrder(WallboxApply);
list.stream().map(l->{
return l;
});
return list; return list;
} }
public WallboxApply calculateTimeRemaining(WallboxApply wallboxApply) {
return wallboxApply;
}
/** /**
* 新增墙盒申请 * 新增墙盒申请
* *
...@@ -156,19 +149,6 @@ public class WallboxApplyService { ...@@ -156,19 +149,6 @@ public class WallboxApplyService {
} }
/** /**
* 新增墙盒申请
*
* @param orderId 订单号
* @return 结果
*/
public int insertWallboxApply(int orderId) {
//判断订单状态
// orderInstallDao.selectByOrderId()
return 0;
}
/**
* 修改墙盒申请 * 修改墙盒申请
* *
* @return 结果 * @return 结果
...@@ -176,11 +156,11 @@ public class WallboxApplyService { ...@@ -176,11 +156,11 @@ public class WallboxApplyService {
public int updateWallboxApply(WallboxApply wallboxApply) { public int updateWallboxApply(WallboxApply wallboxApply) {
WallboxApply record = wallboxApplyMapper.selectWallboxApplyByOrderId(wallboxApply.getOutOrderId()); WallboxApply record = wallboxApplyMapper.selectWallboxApplyByOrderId(wallboxApply.getOutOrderId());
// if (!CHECK_STATUS_REJECT.equals(record.getCheckStatus())) { if (!CHECK_STATUS_REJECT.equals(record.getCheckStatus())) {
// throw new ServiceException("非驳回状态订单无法修改信息!"); throw new ServiceException("非驳回状态订单无法修改信息!");
// } }
validateApplyExists(wallboxApply.getOrderId()); validateApplyExists(wallboxApply.getOrderId());
wallboxApply.setCheckTime(new Date()); wallboxApply.setModifyTime(new Date());
wallboxApply.setCheckStatus(1L); wallboxApply.setCheckStatus(1L);
return wallboxApplyMapper.updateWallboxApply(wallboxApply); return wallboxApplyMapper.updateWallboxApply(wallboxApply);
} }
...@@ -214,6 +194,7 @@ public class WallboxApplyService { ...@@ -214,6 +194,7 @@ public class WallboxApplyService {
/** /**
* 批量审核 * 批量审核
*/ */
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = Exception.class)
public WallboxApplyBatchCheckDTO checkBatch(WallboxApplyBatchCheckDTO req) { public WallboxApplyBatchCheckDTO checkBatch(WallboxApplyBatchCheckDTO req) {
List<WallboxApplyCheckDTO> checkList = req.getCheckList(); List<WallboxApplyCheckDTO> checkList = req.getCheckList();
List<WallboxApply> toUpdateList = new ArrayList<>(); List<WallboxApply> toUpdateList = new ArrayList<>();
......
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
'%') '%')
</if> </if>
<if test="checkStatus != null ">and t_wallbox_apply.check_status = #{checkStatus}</if> <if test="checkStatus != null ">and t_wallbox_apply.check_status = #{checkStatus}</if>
<if test="supplierId != null regionId != ''">and t_wallbox_apply.supplier_id = #{supplierId}</if>
<if test="trackingStatus != null ">and t_wallbox_apply.tracking_status = #{trackingStatus}</if> <if test="trackingStatus != null ">and t_wallbox_apply.tracking_status = #{trackingStatus}</if>
<if test="regionId != null and regionId != ''">and t_wallbox_apply.region_id = #{regionId}</if> <if test="regionId != null and regionId != ''">and t_wallbox_apply.region_id = #{regionId}</if>
<if test="wallboxItemId != null and wallboxItemId != ''">and t_wallbox_apply.wallbox_item_id like <if test="wallboxItemId != null and wallboxItemId != ''">and t_wallbox_apply.wallbox_item_id like
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论