Commit 8a975b10 authored by Smile's avatar Smile

需求133后台-集运-包裹列表-批量修改

parent e8ec072b
...@@ -34,10 +34,15 @@ public interface ConsService extends IService<ConsDO> { ...@@ -34,10 +34,15 @@ public interface ConsService extends IService<ConsDO> {
*/ */
void deleteCons(Long id); void deleteCons(Long id);
/* /**
* 批量签收 * 批量签收
*/ */
void updateConsSign(ConsUpdateSignReqVO updateReqVO); void updateConsSign(ConsUpdateBatchReqVO updateReqVO);
/**
* 批量修改
*/
void updateConsBatch(ConsUpdateBatchReqVO updateReqVO);
/** /**
* 获得集运包裹主 * 获得集运包裹主
* @param id 编号 * @param id 编号
......
...@@ -186,7 +186,7 @@ public class ConsServiceImpl extends AbstractService<ConsMapper, ConsDO> impleme ...@@ -186,7 +186,7 @@ public class ConsServiceImpl extends AbstractService<ConsMapper, ConsDO> impleme
} }
@Override @Override
public void updateConsSign(ConsUpdateSignReqVO updateReqVO) { public void updateConsSign(ConsUpdateBatchReqVO updateReqVO) {
if (updateReqVO.getConsIds()==null|| updateReqVO.getConsIds().isEmpty()){ if (updateReqVO.getConsIds()==null|| updateReqVO.getConsIds().isEmpty()){
throw exception(30004,"未选择包裹"); throw exception(30004,"未选择包裹");
} }
...@@ -222,6 +222,34 @@ public class ConsServiceImpl extends AbstractService<ConsMapper, ConsDO> impleme ...@@ -222,6 +222,34 @@ public class ConsServiceImpl extends AbstractService<ConsMapper, ConsDO> impleme
consMapper.updateBatch(consDOS); consMapper.updateBatch(consDOS);
} }
@Override
public void updateConsBatch(ConsUpdateBatchReqVO updateReqVO) {
if (updateReqVO.getTransportId()==null){
throw exception(30004,"请选择运输方式");
}
if (updateReqVO.getWareId()==null){
throw exception(30004,"请选择仓库");
}
if (updateReqVO.getWarehouseLineId()==null){
throw exception(30004,"请选择线路");
}
if (updateReqVO.getConsigneeCityId()==null){
throw exception(30004,"请选择目的城市");
}
if (updateReqVO.getConsigneeCountryId()==null){
throw exception(30004,"请选择目的国家");
}
List<ConsDO> consDOS = consMapper.selectBatchIds(updateReqVO.getConsIds());
consDOS.forEach(consDO -> {
consDO.setTransportId(updateReqVO.getTransportId());
consDO.setWareId(updateReqVO.getWareId());
consDO.setWarehouseLineId(updateReqVO.getWarehouseLineId());
consDO.setConsigneeCityId(updateReqVO.getConsigneeCityId());
consDO.setConsigneeCountryId(updateReqVO.getConsigneeCountryId());
});
consMapper.updateBatch(consDOS);
}
private void validateConsExists(Long id) { private void validateConsExists(Long id) {
if (consMapper.selectById(id) == null) { if (consMapper.selectById(id) == null) {
throw exception(30004,"包裹不存在"); throw exception(30004,"包裹不存在");
......
...@@ -14,7 +14,7 @@ import java.util.List; ...@@ -14,7 +14,7 @@ import java.util.List;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class ConsUpdateSignReqVO extends ConsBaseVO { public class ConsUpdateBatchReqVO extends ConsBaseVO {
@ApiModelProperty(value = "", required = true) @ApiModelProperty(value = "", required = true)
private List<Long> consIds; private List<Long> consIds;
...@@ -23,6 +23,5 @@ public class ConsUpdateSignReqVO extends ConsBaseVO { ...@@ -23,6 +23,5 @@ public class ConsUpdateSignReqVO extends ConsBaseVO {
private List<ConsItemCreateReqVO> consItemVOList; private List<ConsItemCreateReqVO> consItemVOList;
@ApiModelProperty(value = "影像文件地址", required = true) @ApiModelProperty(value = "影像文件地址", required = true)
@NotNull(message = "影像文件地址不能为空")
private String mediaUrl; private String mediaUrl;
} }
...@@ -89,11 +89,19 @@ public class ConsController { ...@@ -89,11 +89,19 @@ public class ConsController {
@PutMapping("/updateConsBatchSignOff") @PutMapping("/updateConsBatchSignOff")
@ApiOperation("批量签收集运包裹") @ApiOperation("批量签收集运包裹")
@PreAuthorize("@ss.hasPermission('ecw:cons:update')") @PreAuthorize("@ss.hasPermission('ecw:cons:update')")
public CommonResult<Boolean> updateConsBatchSignOff(@Valid @RequestBody ConsUpdateSignReqVO updateReqVO) { public CommonResult<Boolean> updateConsBatchSignOff(@Valid @RequestBody ConsUpdateBatchReqVO updateReqVO) {
consService.updateConsSign(updateReqVO); consService.updateConsSign(updateReqVO);
return success(true); return success(true);
} }
@PutMapping("/updateConsBatch")
@ApiOperation("批量修改集运包裹")
@PreAuthorize("@ss.hasPermission('ecw:cons:update')")
public CommonResult<Boolean> updateConsBatch(@Valid @RequestBody ConsUpdateBatchReqVO updateReqVO) {
consService.updateConsBatch(updateReqVO);
return success(true);
}
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ApiOperation("删除集运包裹主") @ApiOperation("删除集运包裹主")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment