|
@@ -8,6 +8,7 @@ import javax.validation.Valid;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.yiqi.common.exception.ServiceException;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -19,10 +20,7 @@ import com.yiqi.common.core.domain.BaseEntity;
|
|
|
import com.yiqi.common.core.domain.R;
|
|
|
import com.yiqi.common.enums.ClothOrderFlowStatus;
|
|
|
import com.yiqi.common.enums.SourceType;
|
|
|
-import com.yiqi.common.utils.DateUtils;
|
|
|
-import com.yiqi.common.utils.EnumUtils;
|
|
|
-import com.yiqi.common.utils.SecurityUtils;
|
|
|
-import com.yiqi.common.utils.StringUtils;
|
|
|
+import com.yiqi.common.utils.*;
|
|
|
import com.yiqi.core.domain.ClothHanger;
|
|
|
import com.yiqi.core.domain.ClothHangerOrderRelation;
|
|
|
import com.yiqi.core.service.IClothHangerOrderRelationService;
|
|
@@ -87,7 +85,7 @@ public class OrderClothItemController extends BaseController {
|
|
|
@PostMapping(value = "saveOrderClothPics")
|
|
|
@ApiOperation("保存衣服图片")
|
|
|
public R saveOrderClothPics(@RequestParam @ApiParam("衣服图片集合,『,』分割")
|
|
|
- String pics, @RequestParam @ApiParam("订单衣服ID") Long id) throws Exception {
|
|
|
+ String pics, @RequestParam @ApiParam("订单衣服ID") Long id) throws Exception {
|
|
|
OrderClothItem orderClothItem = orderClothItemService.getOne(new QueryWrapper<OrderClothItem>().lambda()
|
|
|
.eq(OrderClothItem::getId, id)
|
|
|
.eq(OrderClothItem::getOrgId, SecurityUtils.getLoginUser().getOrgId())
|
|
@@ -123,9 +121,11 @@ public class OrderClothItemController extends BaseController {
|
|
|
@ApiOperation("出厂")
|
|
|
@PostMapping(value = "outFactory")
|
|
|
public R outFactory(@RequestBody @Valid OrderClothItemOutFactoryDTO orderClothItemOutFactoryDTO) throws Exception {
|
|
|
- orderClothItemService.outFactory(orderClothItemOutFactoryDTO);
|
|
|
- orderClothItemFlowRecordService.addRecordBatch(orderClothItemService.list(new QueryWrapper<OrderClothItem>().lambda()
|
|
|
- .in(OrderClothItem::getId, orderClothItemOutFactoryDTO.getIds())), ClothOrderFlowStatus.outFactory.getCode());
|
|
|
+ if (orderClothItemOutFactoryDTO.getClothType().equals("1")) {
|
|
|
+ orderClothItemService.outFactory(orderClothItemOutFactoryDTO);
|
|
|
+ } else {
|
|
|
+ orderClothAdjunctService.outFactory(orderClothItemOutFactoryDTO);
|
|
|
+ }
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
@@ -142,24 +142,41 @@ public class OrderClothItemController extends BaseController {
|
|
|
@ApiOperation("工厂重洗衣服")
|
|
|
@GetMapping(value = "rewashCloth")
|
|
|
public R rewashCloth(@RequestParam @ApiParam("水洗唛") String washCode) throws Exception {
|
|
|
- LambdaQueryWrapper<OrderClothItem> lambdaQueryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
- .eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId()).eq(OrderClothItem::getWashCode, washCode);
|
|
|
-// lambdaQueryWrapper.ge(OrderClothItem::getFlowStatus, (flowStatus + 1));
|
|
|
- OrderClothItem orderClothItem = orderClothItemService.getOne(lambdaQueryWrapper);
|
|
|
- if (orderClothItem == null) {
|
|
|
- throw new ServiceException("未查询到数据");
|
|
|
+ if (washCode.contains(OrderNoUtils.cloth_wash_code_header)) {
|
|
|
+ LambdaQueryWrapper<OrderClothItem> lambdaQueryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
+ .eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId()).eq(OrderClothItem::getWashCode, washCode);
|
|
|
+ OrderClothItem orderClothItem = orderClothItemService.getOne(lambdaQueryWrapper);
|
|
|
+ if (orderClothItem == null) {
|
|
|
+ throw new ServiceException("未查询到数据");
|
|
|
+ }
|
|
|
+ if (!ClothOrderFlowStatus.checkCloth.getCode().equals(orderClothItem.getFlowStatus())) {
|
|
|
+ throw new ServiceException("当前状态不可进行重洗删除,当前状态【"
|
|
|
+ + EnumUtils.getEnumByType(orderClothItem.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
+ }
|
|
|
+
|
|
|
+ orderClothItemService.update(new UpdateWrapper<OrderClothItem>().lambda()
|
|
|
+ .set(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.reWash.getCode())
|
|
|
+ .eq(OrderClothItem::getWashCode, washCode));
|
|
|
+
|
|
|
+ //记录日志
|
|
|
+ orderClothItemFlowRecordService.addRecord(orderClothItem, ClothOrderFlowStatus.reWash.getCode());
|
|
|
}
|
|
|
- if (!ClothOrderFlowStatus.checkCloth.getCode().equals(orderClothItem.getFlowStatus())) {
|
|
|
- throw new ServiceException("当前状态不可进行重洗删除,当前状态【"
|
|
|
- + EnumUtils.getEnumByType(orderClothItem.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
+ if (washCode.contains(OrderNoUtils.cloth_wash_adjust_code_header)) {
|
|
|
+ OrderClothAdjunct orderClothAdjunct = orderClothAdjunctService.selectOrderClothAdjunctByAdjunctNo(washCode);
|
|
|
+ if (orderClothAdjunct == null) {
|
|
|
+ throw new ServiceException("未查询到衣物");
|
|
|
+ }
|
|
|
+ if (!ClothOrderFlowStatus.checkCloth.getCode().equals(orderClothAdjunct.getFlowStatus())) {
|
|
|
+ throw new ServiceException("当前状态不可进行重洗删除,当前状态【"
|
|
|
+ + EnumUtils.getEnumByType(orderClothAdjunct.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
+ }
|
|
|
+ orderClothAdjunctService.update(new UpdateWrapper<OrderClothAdjunct>().lambda()
|
|
|
+ .set(OrderClothAdjunct::getFlowStatus, ClothOrderFlowStatus.reWash.getCode())
|
|
|
+ .eq(OrderClothAdjunct::getAdjunctNo, washCode));
|
|
|
+ orderClothItemFlowRecordService.addAdjunctRecord(orderClothAdjunct, ClothOrderFlowStatus.reWash.getCode());
|
|
|
}
|
|
|
|
|
|
- orderClothItemService.update(new UpdateWrapper<OrderClothItem>().lambda()
|
|
|
- .set(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.reWash.getCode())
|
|
|
- .eq(OrderClothItem::getWashCode, washCode));
|
|
|
|
|
|
- //记录日志
|
|
|
- orderClothItemFlowRecordService.addRecord(orderClothItem, ClothOrderFlowStatus.reWash.getCode());
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
@@ -167,23 +184,41 @@ public class OrderClothItemController extends BaseController {
|
|
|
@ApiOperation("工厂删除入厂")
|
|
|
@GetMapping(value = "deleteInFactory")
|
|
|
public R deleteInFactory(@RequestParam @ApiParam("水洗唛") String washCode) throws Exception {
|
|
|
- LambdaQueryWrapper<OrderClothItem> lambdaQueryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
- .eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId()).eq(OrderClothItem::getWashCode, washCode);
|
|
|
-// lambdaQueryWrapper.ge(OrderClothItem::getFlowStatus, (flowStatus + 1));
|
|
|
- OrderClothItem orderClothItem = orderClothItemService.getOne(lambdaQueryWrapper);
|
|
|
- if (orderClothItem == null) {
|
|
|
- throw new ServiceException("未查询到数据");
|
|
|
+
|
|
|
+ if (washCode.contains(OrderNoUtils.cloth_wash_code_header)) {
|
|
|
+ LambdaQueryWrapper<OrderClothItem> lambdaQueryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
+ .eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId()).eq(OrderClothItem::getWashCode, washCode);
|
|
|
+ OrderClothItem orderClothItem = orderClothItemService.getOne(lambdaQueryWrapper);
|
|
|
+ if (orderClothItem == null) {
|
|
|
+ throw new ServiceException("未查询到数据");
|
|
|
+ }
|
|
|
+ if (!ClothOrderFlowStatus.inFactory.getCode().equals(orderClothItem.getFlowStatus())) {
|
|
|
+ throw new ServiceException("当前状态不可进行入厂删除,当前状态【"
|
|
|
+ + EnumUtils.getEnumByType(orderClothItem.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
+ }
|
|
|
+
|
|
|
+ orderClothItemService.update(new UpdateWrapper<OrderClothItem>().lambda()
|
|
|
+ .set(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.waitingForWash.getCode())
|
|
|
+ .eq(OrderClothItem::getWashCode, washCode));
|
|
|
+
|
|
|
+ orderClothItemFlowRecordService.addRecord(orderClothItem, ClothOrderFlowStatus.deleteInFactory.getCode());
|
|
|
}
|
|
|
- if (!ClothOrderFlowStatus.inFactory.getCode().equals(orderClothItem.getFlowStatus())) {
|
|
|
- throw new ServiceException("当前状态不可进行入厂删除,当前状态【"
|
|
|
- + EnumUtils.getEnumByType(orderClothItem.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
+ if (washCode.contains(OrderNoUtils.cloth_wash_adjust_code_header)) {
|
|
|
+ OrderClothAdjunct orderClothAdjunct = orderClothAdjunctService.selectOrderClothAdjunctByAdjunctNo(washCode);
|
|
|
+ if (orderClothAdjunct == null) {
|
|
|
+ throw new ServiceException("未查询到衣物");
|
|
|
+ }
|
|
|
+ if (!ClothOrderFlowStatus.inFactory.getCode().equals(orderClothAdjunct.getFlowStatus())) {
|
|
|
+ throw new ServiceException("当前状态不可进行入厂删除,当前状态【"
|
|
|
+ + EnumUtils.getEnumByType(orderClothAdjunct.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
+ }
|
|
|
+ orderClothAdjunctService.update(new UpdateWrapper<OrderClothAdjunct>().lambda()
|
|
|
+ .set(OrderClothAdjunct::getFlowStatus, ClothOrderFlowStatus.waitingForWash.getCode())
|
|
|
+ .eq(OrderClothAdjunct::getAdjunctNo, washCode));
|
|
|
+ orderClothItemFlowRecordService.addAdjunctRecord(orderClothAdjunct, ClothOrderFlowStatus.deleteInFactory.getCode());
|
|
|
}
|
|
|
|
|
|
- orderClothItemService.update(new UpdateWrapper<OrderClothItem>().lambda()
|
|
|
- .set(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.waitingForWash.getCode())
|
|
|
- .eq(OrderClothItem::getWashCode, washCode));
|
|
|
|
|
|
- orderClothItemFlowRecordService.addRecord(orderClothItem, ClothOrderFlowStatus.deleteInFactory.getCode());
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
@@ -191,44 +226,71 @@ public class OrderClothItemController extends BaseController {
|
|
|
@ApiOperation("工厂衣服入厂")
|
|
|
@GetMapping(value = "inFactory")
|
|
|
public R<OrderClothItemVO> inFactory(@RequestParam @ApiParam("水洗唛") String washCode) throws Exception {
|
|
|
-
|
|
|
- LambdaQueryWrapper<OrderClothItem> lambdaQueryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
- .eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId()).eq(OrderClothItem::getWashCode, washCode);
|
|
|
-// lambdaQueryWrapper.ge(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.waitingForWash);
|
|
|
- OrderClothItem orderClothItem = orderClothItemService.getOne(lambdaQueryWrapper);
|
|
|
- if (orderClothItem == null) {
|
|
|
- throw new ServiceException("未查询到数据");
|
|
|
- }
|
|
|
- if (!ClothOrderFlowStatus.waitingForWash.getCode().equals(orderClothItem.getFlowStatus())) {
|
|
|
- throw new ServiceException("该衣服已入厂,无法重复添加,当前状态【"
|
|
|
- + EnumUtils.getEnumByType(orderClothItem.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
- }
|
|
|
-
|
|
|
OrderClothItemVO orderClothItemVO = new OrderClothItemVO();
|
|
|
- BeanUtils.copyProperties(orderClothItem, orderClothItemVO);
|
|
|
- orderClothItemVO.setOrderClothAdjuncts(orderClothAdjunctService.list(new QueryWrapper<OrderClothAdjunct>()
|
|
|
- .lambda().eq(OrderClothAdjunct::getOrderClothId, orderClothItem.getId())));
|
|
|
- orderClothItemVO.setOrderClothColors(orderClothColorService.list(new QueryWrapper<OrderClothColor>()
|
|
|
- .lambda().eq(OrderClothColor::getOrderClothId, orderClothItem.getId())));
|
|
|
- orderClothItemVO.setOrderClothCrafts(orderClothCraftService.list(new QueryWrapper<OrderClothCraft>()
|
|
|
- .lambda().eq(OrderClothCraft::getOrderClothId, orderClothItem.getId())));
|
|
|
- orderClothItemVO.setOrderClothFlaws(orderClothFlawService.list(new QueryWrapper<OrderClothFlaw>()
|
|
|
- .lambda().eq(OrderClothFlaw::getOrderClothId, orderClothItem.getId())));
|
|
|
- orderClothItemVO.setOrderClothTypes(orderClothTypeService.list(new QueryWrapper<OrderClothType>()
|
|
|
- .lambda().eq(OrderClothType::getOrderClothId, orderClothItem.getId())));
|
|
|
+ OrderClothItem orderClothItem = null;
|
|
|
+ if (washCode.contains(OrderNoUtils.cloth_wash_code_header)) {
|
|
|
+ LambdaQueryWrapper<OrderClothItem> lambdaQueryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
+ .eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId()).eq(OrderClothItem::getWashCode, washCode);
|
|
|
+ orderClothItem = orderClothItemService.getOne(lambdaQueryWrapper);
|
|
|
+ if (orderClothItem == null) {
|
|
|
+ throw new ServiceException("未查询到衣物");
|
|
|
+ }
|
|
|
+ if (!ClothOrderFlowStatus.waitingForWash.getCode().equals(orderClothItem.getFlowStatus())) {
|
|
|
+ throw new ServiceException("该衣服已入厂,无法重复添加,当前状态【"
|
|
|
+ + EnumUtils.getEnumByType(orderClothItem.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
+ }
|
|
|
+ BeanUtils.copyProperties(orderClothItem, orderClothItemVO);
|
|
|
+ orderClothItemVO.setIsAdjunct("N");
|
|
|
+ orderClothItemVO.setOrderClothAdjuncts(orderClothAdjunctService.list(new QueryWrapper<OrderClothAdjunct>()
|
|
|
+ .lambda().eq(OrderClothAdjunct::getOrderClothId, orderClothItem.getId())));
|
|
|
+ orderClothItemVO.setOrderClothColors(orderClothColorService.list(new QueryWrapper<OrderClothColor>()
|
|
|
+ .lambda().eq(OrderClothColor::getOrderClothId, orderClothItem.getId())));
|
|
|
+ orderClothItemVO.setOrderClothCrafts(orderClothCraftService.list(new QueryWrapper<OrderClothCraft>()
|
|
|
+ .lambda().eq(OrderClothCraft::getOrderClothId, orderClothItem.getId())));
|
|
|
+ orderClothItemVO.setOrderClothFlaws(orderClothFlawService.list(new QueryWrapper<OrderClothFlaw>()
|
|
|
+ .lambda().eq(OrderClothFlaw::getOrderClothId, orderClothItem.getId())));
|
|
|
+ orderClothItemVO.setOrderClothTypes(orderClothTypeService.list(new QueryWrapper<OrderClothType>()
|
|
|
+ .lambda().eq(OrderClothType::getOrderClothId, orderClothItem.getId())));
|
|
|
+ orderClothItemService.update(new UpdateWrapper<OrderClothItem>().lambda()
|
|
|
+ .set(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.inFactory.getCode())
|
|
|
+ .set(OrderClothItem::getInFactoryTime, DateUtils.getNowDate())
|
|
|
+ .set(OrderClothItem::getInFactoryById, AuthHolder.userId())
|
|
|
+ .set(OrderClothItem::getInFactoryBy, AuthHolder.nickName())
|
|
|
+ .eq(OrderClothItem::getWashCode, washCode)
|
|
|
+ .eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.waitingForWash.getCode()));
|
|
|
+ //添加记录
|
|
|
+ orderClothItemFlowRecordService.addRecord(orderClothItem, ClothOrderFlowStatus.inFactory.getCode());
|
|
|
+ }
|
|
|
+ if (washCode.contains(OrderNoUtils.cloth_wash_adjust_code_header)) {
|
|
|
+ OrderClothAdjunct orderClothAdjunct = orderClothAdjunctService.selectOrderClothAdjunctByAdjunctNo(washCode);
|
|
|
+ if (orderClothAdjunct == null) {
|
|
|
+ throw new ServiceException("未查询到衣物");
|
|
|
+ }
|
|
|
+ if (!ClothOrderFlowStatus.waitingForWash.getCode().equals(orderClothAdjunct.getFlowStatus())) {
|
|
|
+ throw new ServiceException("该衣服附件已入厂,无法重复添加,当前状态【"
|
|
|
+ + EnumUtils.getEnumByType(orderClothAdjunct.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
+ }
|
|
|
+ orderClothItem = orderClothItemService.selectOrderClothItemById(orderClothAdjunct.getOrderClothId());
|
|
|
+ BeanUtils.copyProperties(orderClothItem, orderClothItemVO);
|
|
|
+ orderClothItemVO.setIsAdjunct("Y");
|
|
|
+ orderClothItemVO.setWashCode(orderClothAdjunct.getAdjunctNo());
|
|
|
+ orderClothItemVO.setClothItemName("【附件】" + orderClothItemVO.getClothItemName() + " * " + orderClothAdjunct.getAdjunctName());
|
|
|
+ orderClothItemVO.setOrderClothAdjuncts(Arrays.asList(orderClothAdjunct));
|
|
|
+
|
|
|
+ orderClothAdjunctService.update(new UpdateWrapper<OrderClothAdjunct>().lambda()
|
|
|
+ .set(OrderClothAdjunct::getFlowStatus, ClothOrderFlowStatus.inFactory.getCode())
|
|
|
+ .set(OrderClothAdjunct::getInFactoryTime, DateUtils.getNowDate())
|
|
|
+ .set(OrderClothAdjunct::getInFactoryById, AuthHolder.userId())
|
|
|
+ .set(OrderClothAdjunct::getInFactoryBy, AuthHolder.nickName())
|
|
|
+ .eq(OrderClothAdjunct::getAdjunctNo, washCode)
|
|
|
+ .eq(OrderClothAdjunct::getFlowStatus, ClothOrderFlowStatus.waitingForWash.getCode()));
|
|
|
+ //添加记录
|
|
|
+ orderClothItemFlowRecordService.addAdjunctRecord(orderClothAdjunct, ClothOrderFlowStatus.inFactory.getCode());
|
|
|
+ }
|
|
|
orderClothItemVO.setOrgName(sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda()
|
|
|
.eq(SysOrg::getId, orderClothItemVO.getOrgId())
|
|
|
.eq(SysOrg::getSourceType, orderClothItemVO.getSourceType()), false).getName());
|
|
|
orderClothItemVO.setFlowStatus(ClothOrderFlowStatus.inFactory.getCode());
|
|
|
- orderClothItemService.update(new UpdateWrapper<OrderClothItem>().lambda()
|
|
|
- .set(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.inFactory.getCode())
|
|
|
- .set(OrderClothItem::getInFactoryTime, DateUtils.getNowDate())
|
|
|
- .set(OrderClothItem::getInFactoryById, AuthHolder.userId())
|
|
|
- .set(OrderClothItem::getInFactoryBy, AuthHolder.nickName())
|
|
|
- .eq(OrderClothItem::getWashCode, washCode)
|
|
|
- .eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.waitingForWash.getCode()));
|
|
|
-
|
|
|
- orderClothItemFlowRecordService.addRecord(orderClothItem, ClothOrderFlowStatus.inFactory.getCode());
|
|
|
return R.ok(orderClothItemVO);
|
|
|
}
|
|
|
|
|
@@ -237,48 +299,110 @@ public class OrderClothItemController extends BaseController {
|
|
|
@GetMapping(value = "checkCloth")
|
|
|
public R<OrderClothItemVO> checkCloth(@RequestParam @ApiParam("水洗唛") String washCode) throws Exception {
|
|
|
|
|
|
- LambdaQueryWrapper<OrderClothItem> lambdaQueryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
- .eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId()).eq(OrderClothItem::getWashCode, washCode);
|
|
|
- lambdaQueryWrapper.ge(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.inFactory.getCode());
|
|
|
- OrderClothItem orderClothItem = orderClothItemService.getOne(lambdaQueryWrapper);
|
|
|
- if (orderClothItem == null) {
|
|
|
- throw new ServiceException("未查询到数据");
|
|
|
- }
|
|
|
- if (!ClothOrderFlowStatus.inFactory.getCode().equals(orderClothItem.getFlowStatus()) && !ClothOrderFlowStatus.reWash.getCode().equals(orderClothItem.getFlowStatus())) {
|
|
|
- throw new ServiceException("该衣服已检查,无法再次操作,当前状态【"
|
|
|
- + EnumUtils.getEnumByType(orderClothItem.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
- }
|
|
|
-
|
|
|
OrderClothItemVO orderClothItemVO = new OrderClothItemVO();
|
|
|
- BeanUtils.copyProperties(orderClothItem, orderClothItemVO);
|
|
|
- orderClothItemVO.setOrderClothAdjuncts(orderClothAdjunctService.list(new QueryWrapper<OrderClothAdjunct>()
|
|
|
- .lambda().eq(OrderClothAdjunct::getOrderClothId, orderClothItem.getId())));
|
|
|
- orderClothItemVO.setOrderClothColors(orderClothColorService.list(new QueryWrapper<OrderClothColor>()
|
|
|
- .lambda().eq(OrderClothColor::getOrderClothId, orderClothItem.getId())));
|
|
|
- orderClothItemVO.setOrderClothCrafts(orderClothCraftService.list(new QueryWrapper<OrderClothCraft>()
|
|
|
- .lambda().eq(OrderClothCraft::getOrderClothId, orderClothItem.getId())));
|
|
|
- orderClothItemVO.setOrderClothFlaws(orderClothFlawService.list(new QueryWrapper<OrderClothFlaw>()
|
|
|
- .lambda().eq(OrderClothFlaw::getOrderClothId, orderClothItem.getId())));
|
|
|
- orderClothItemVO.setOrderClothTypes(orderClothTypeService.list(new QueryWrapper<OrderClothType>()
|
|
|
- .lambda().eq(OrderClothType::getOrderClothId, orderClothItem.getId())));
|
|
|
+ OrderClothItem orderClothItem = null;
|
|
|
+ if (washCode.contains(OrderNoUtils.cloth_wash_code_header)) {
|
|
|
+ LambdaQueryWrapper<OrderClothItem> lambdaQueryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
+ .eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId()).eq(OrderClothItem::getWashCode, washCode);
|
|
|
+ orderClothItem = orderClothItemService.getOne(lambdaQueryWrapper);
|
|
|
+ if (orderClothItem == null) {
|
|
|
+ throw new ServiceException("未查询到衣物");
|
|
|
+ }
|
|
|
+ if (!ClothOrderFlowStatus.inFactory.getCode().equals(orderClothItem.getFlowStatus())) {
|
|
|
+ throw new ServiceException("该衣服已检查,无法再次操作,当前状态【"
|
|
|
+ + EnumUtils.getEnumByType(orderClothItem.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
+ }
|
|
|
+ BeanUtils.copyProperties(orderClothItem, orderClothItemVO);
|
|
|
+ orderClothItemVO.setIsAdjunct("N");
|
|
|
+ orderClothItemVO.setOrderClothAdjuncts(orderClothAdjunctService.list(new QueryWrapper<OrderClothAdjunct>()
|
|
|
+ .lambda().eq(OrderClothAdjunct::getOrderClothId, orderClothItem.getId())));
|
|
|
+ orderClothItemVO.setOrderClothColors(orderClothColorService.list(new QueryWrapper<OrderClothColor>()
|
|
|
+ .lambda().eq(OrderClothColor::getOrderClothId, orderClothItem.getId())));
|
|
|
+ orderClothItemVO.setOrderClothCrafts(orderClothCraftService.list(new QueryWrapper<OrderClothCraft>()
|
|
|
+ .lambda().eq(OrderClothCraft::getOrderClothId, orderClothItem.getId())));
|
|
|
+ orderClothItemVO.setOrderClothFlaws(orderClothFlawService.list(new QueryWrapper<OrderClothFlaw>()
|
|
|
+ .lambda().eq(OrderClothFlaw::getOrderClothId, orderClothItem.getId())));
|
|
|
+ orderClothItemVO.setOrderClothTypes(orderClothTypeService.list(new QueryWrapper<OrderClothType>()
|
|
|
+ .lambda().eq(OrderClothType::getOrderClothId, orderClothItem.getId())));
|
|
|
+ orderClothItemService.update(new UpdateWrapper<OrderClothItem>().lambda()
|
|
|
+ .set(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.checkCloth.getCode())
|
|
|
+ .set(OrderClothItem::getCheckClothTime, DateUtils.getNowDate())
|
|
|
+ .set(OrderClothItem::getCheckClothById, AuthHolder.userId())
|
|
|
+ .set(OrderClothItem::getCheckClothBy, AuthHolder.nickName())
|
|
|
+ .eq(OrderClothItem::getWashCode, washCode));
|
|
|
+ //添加记录
|
|
|
+ orderClothItemFlowRecordService.addRecord(orderClothItem, ClothOrderFlowStatus.checkCloth.getCode());
|
|
|
+ }
|
|
|
+ if (washCode.contains(OrderNoUtils.cloth_wash_adjust_code_header)) {
|
|
|
+ OrderClothAdjunct orderClothAdjunct = orderClothAdjunctService.selectOrderClothAdjunctByAdjunctNo(washCode);
|
|
|
+ if (orderClothAdjunct == null) {
|
|
|
+ throw new ServiceException("未查询到衣物");
|
|
|
+ }
|
|
|
+ if (!ClothOrderFlowStatus.inFactory.getCode().equals(orderClothAdjunct.getFlowStatus())) {
|
|
|
+ throw new ServiceException("该衣服附件已检查,无法再次操作,当前状态【"
|
|
|
+ + EnumUtils.getEnumByType(orderClothAdjunct.getFlowStatus(), ClothOrderFlowStatus.class).getInfo() + "】");
|
|
|
+ }
|
|
|
+ orderClothItem = orderClothItemService.selectOrderClothItemById(orderClothAdjunct.getOrderClothId());
|
|
|
+ BeanUtils.copyProperties(orderClothItem, orderClothItemVO);
|
|
|
+ orderClothItemVO.setIsAdjunct("Y");
|
|
|
+ orderClothItemVO.setWashCode(orderClothAdjunct.getAdjunctNo());
|
|
|
+ orderClothItemVO.setClothItemName("【附件】" + orderClothItemVO.getClothItemName() + " * " + orderClothAdjunct.getAdjunctName());
|
|
|
+ orderClothItemVO.setOrderClothAdjuncts(Arrays.asList(orderClothAdjunct));
|
|
|
+
|
|
|
+ orderClothAdjunctService.update(new UpdateWrapper<OrderClothAdjunct>().lambda()
|
|
|
+ .set(OrderClothAdjunct::getFlowStatus, ClothOrderFlowStatus.checkCloth.getCode())
|
|
|
+ .set(OrderClothAdjunct::getCheckClothTime, DateUtils.getNowDate())
|
|
|
+ .set(OrderClothAdjunct::getCheckClothById, AuthHolder.userId())
|
|
|
+ .set(OrderClothAdjunct::getCheckClothBy, AuthHolder.nickName())
|
|
|
+ .eq(OrderClothAdjunct::getAdjunctNo, washCode));
|
|
|
+ //添加记录
|
|
|
+ orderClothItemFlowRecordService.addAdjunctRecord(orderClothAdjunct, ClothOrderFlowStatus.checkCloth.getCode());
|
|
|
+ }
|
|
|
orderClothItemVO.setOrgName(sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda()
|
|
|
.eq(SysOrg::getId, orderClothItemVO.getOrgId())
|
|
|
.eq(SysOrg::getSourceType, orderClothItemVO.getSourceType()), false).getName());
|
|
|
orderClothItemVO.setFlowStatus(ClothOrderFlowStatus.checkCloth.getCode());
|
|
|
- orderClothItemService.update(new UpdateWrapper<OrderClothItem>().lambda()
|
|
|
- .set(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.checkCloth.getCode())
|
|
|
- .set(OrderClothItem::getCheckClothTime, DateUtils.getNowDate())
|
|
|
- .set(OrderClothItem::getCheckClothById, AuthHolder.userId())
|
|
|
- .set(OrderClothItem::getCheckClothBy, AuthHolder.nickName())
|
|
|
- .eq(OrderClothItem::getWashCode, washCode));
|
|
|
-
|
|
|
- orderClothItemFlowRecordService.addRecord(orderClothItem, ClothOrderFlowStatus.checkCloth.getCode());
|
|
|
return R.ok(orderClothItemVO);
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = "findOutFactoryPageByFlowStatus")
|
|
|
@ApiOperation("根据洗衣状态查询出厂衣服列表")
|
|
|
public R<Page<OrderClothItemVO>> findOutFactoryPageByFlowStatus(@RequestBody @Valid OrderClothItemOutFactoryQueryDTO orderClothItemOutFactoryQueryDTO) throws Exception {
|
|
|
+ if (orderClothItemOutFactoryQueryDTO.getClothType().equals("2")) {
|
|
|
+ LambdaQueryWrapper<OrderClothAdjunct> queryWrapper = new QueryWrapper<OrderClothAdjunct>().lambda()
|
|
|
+ .eq(OrderClothAdjunct::getFlowStatus, ClothOrderFlowStatus.checkCloth.getCode());
|
|
|
+ queryWrapper.eq(OrderClothAdjunct::getFactoryId, SecurityUtils.getLoginUser().getOrgId());
|
|
|
+ if (orderClothItemOutFactoryQueryDTO.getOrgId() != null) {
|
|
|
+ queryWrapper.eq(OrderClothAdjunct::getStoreId, orderClothItemOutFactoryQueryDTO.getOrgId());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(orderClothItemOutFactoryQueryDTO.getWashCode())) {
|
|
|
+ queryWrapper.like(OrderClothAdjunct::getAdjunctNo, orderClothItemOutFactoryQueryDTO.getWashCode());
|
|
|
+ }
|
|
|
+ Page<OrderClothAdjunct> page = orderClothAdjunctService.page(
|
|
|
+ new Page<>(orderClothItemOutFactoryQueryDTO.getPageNum()
|
|
|
+ , orderClothItemOutFactoryQueryDTO.getPageSize())
|
|
|
+ , queryWrapper);
|
|
|
+ //查询附件
|
|
|
+ List<OrderClothItemVO> orderClothItemVOS = new ArrayList<>();
|
|
|
+ for (OrderClothAdjunct orderClothAdjunct : page.getRecords()) {
|
|
|
+ OrderClothItemVO orderClothItemVO = new OrderClothItemVO();
|
|
|
+ OrderClothItem orderClothItem = orderClothItemService.selectOrderClothItemById(orderClothAdjunct.getOrderClothId());
|
|
|
+ BeanUtils.copyProperties(orderClothItem, orderClothItemVO);
|
|
|
+ orderClothItemVO.setIsAdjunct("Y");
|
|
|
+ orderClothItemVO.setId(orderClothAdjunct.getId());
|
|
|
+ orderClothItemVO.setWashCode(orderClothAdjunct.getAdjunctNo());
|
|
|
+ orderClothItemVO.setClothItemName("【附件】" + orderClothItemVO.getClothItemName() + " * " + orderClothAdjunct.getAdjunctName());
|
|
|
+ orderClothItemVO.setOrgName(sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda()
|
|
|
+ .eq(SysOrg::getId, orderClothItemVO.getOrgId())
|
|
|
+ .eq(SysOrg::getSourceType, orderClothItemVO.getSourceType()), false).getName());
|
|
|
+ orderClothItemVO.setFlowStatus(orderClothAdjunct.getFlowStatus());
|
|
|
+ orderClothItemVOS.add(orderClothItemVO);
|
|
|
+ }
|
|
|
+ Page<OrderClothItemVO> orderClothItemVOPage = new Page<>();
|
|
|
+ orderClothItemVOPage.setRecords(orderClothItemVOS);
|
|
|
+ orderClothItemVOPage.setTotal(page.getTotal());
|
|
|
+ return R.ok(orderClothItemVOPage);
|
|
|
+ }
|
|
|
LambdaQueryWrapper<OrderClothItem> queryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
.eq(OrderClothItem::getFlowStatus, ClothOrderFlowStatus.checkCloth.getCode());
|
|
|
queryWrapper.eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId());
|
|
@@ -300,9 +424,9 @@ public class OrderClothItemController extends BaseController {
|
|
|
return R.ok(orderClothItemVOPage);
|
|
|
}
|
|
|
Set<Long> orderClothItemIds = page.getRecords().stream().map(OrderClothItem::getId).collect(Collectors.toSet());
|
|
|
- Map<Long, List<OrderClothAdjunct>> orderClothAdjunctMap = orderClothAdjunctService.list(
|
|
|
- new QueryWrapper<OrderClothAdjunct>().lambda().in(OrderClothAdjunct::getOrderClothId, orderClothItemIds))
|
|
|
- .stream().collect(Collectors.groupingBy(OrderClothAdjunct::getOrderClothId));
|
|
|
+// Map<Long, List<OrderClothAdjunct>> orderClothAdjunctMap = orderClothAdjunctService.list(
|
|
|
+// new QueryWrapper<OrderClothAdjunct>().lambda().in(OrderClothAdjunct::getOrderClothId, orderClothItemIds))
|
|
|
+// .stream().collect(Collectors.groupingBy(OrderClothAdjunct::getOrderClothId));
|
|
|
Map<Long, List<OrderClothColor>> orderClothColorMap = orderClothColorService.list(
|
|
|
new QueryWrapper<OrderClothColor>().lambda().in(OrderClothColor::getOrderClothId, orderClothItemIds))
|
|
|
.stream().collect(Collectors.groupingBy(OrderClothColor::getOrderClothId));
|
|
@@ -320,11 +444,14 @@ public class OrderClothItemController extends BaseController {
|
|
|
for (OrderClothItem record : page.getRecords()) {
|
|
|
OrderClothItemVO orderClothItemVO = new OrderClothItemVO();
|
|
|
BeanUtils.copyProperties(record, orderClothItemVO);
|
|
|
- orderClothItemVO.setOrderClothAdjuncts(orderClothAdjunctMap.get(record.getId()));
|
|
|
+// orderClothItemVO.setOrderClothAdjuncts(orderClothAdjunctMap.get(record.getId()));
|
|
|
orderClothItemVO.setOrderClothColors(orderClothColorMap.get(record.getId()));
|
|
|
orderClothItemVO.setOrderClothCrafts(orderClothCraftMap.get(record.getId()));
|
|
|
orderClothItemVO.setOrderClothFlaws(orderClothFlawMap.get(record.getId()));
|
|
|
orderClothItemVO.setOrderClothTypes(orderClothTypeMap.get(record.getId()));
|
|
|
+ orderClothItemVO.setOrgName(sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda()
|
|
|
+ .eq(SysOrg::getId, orderClothItemVO.getOrgId())
|
|
|
+ .eq(SysOrg::getSourceType, orderClothItemVO.getSourceType()), false).getName());
|
|
|
orderClothItemVOS.add(orderClothItemVO);
|
|
|
}
|
|
|
|
|
@@ -338,6 +465,93 @@ public class OrderClothItemController extends BaseController {
|
|
|
@ApiOperation("查询工厂衣服记录")
|
|
|
public TableDataInfo findFactoryClothPage(OrderClothItemFactoryQueryDTO orderClothItemFactoryQueryDTO) throws Exception {
|
|
|
startPage();
|
|
|
+ if (orderClothItemFactoryQueryDTO.getClothType()!=null && orderClothItemFactoryQueryDTO.getClothType().equals("2")) {
|
|
|
+ LambdaQueryWrapper<OrderClothAdjunct> queryWrapper = new QueryWrapper<OrderClothAdjunct>().lambda()
|
|
|
+ .eq(OrderClothAdjunct::getFactoryId, SecurityUtils.getLoginUser().getOrgId());
|
|
|
+ if (StringUtils.isNotEmpty(orderClothItemFactoryQueryDTO.getFlowStatus())) {
|
|
|
+ switch (EnumUtils.getEnumByType(orderClothItemFactoryQueryDTO.getFlowStatus(), ClothOrderFlowStatus.class)) {
|
|
|
+ case inFactory: {
|
|
|
+ queryWrapper.isNotNull(OrderClothAdjunct::getInFactoryById);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case outFactory: {
|
|
|
+ queryWrapper.isNotNull(OrderClothAdjunct::getOutFactoryById);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case checkCloth: {
|
|
|
+ queryWrapper.isNotNull(OrderClothAdjunct::getCheckClothById);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default: {
|
|
|
+ throw new ServiceException("流程状态查询不正确");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(orderClothItemFactoryQueryDTO.getClothName())) {
|
|
|
+ queryWrapper.like(OrderClothAdjunct::getAdjunctName, orderClothItemFactoryQueryDTO.getClothName());
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getBeginTime() != null) {
|
|
|
+ queryWrapper.ge(OrderClothAdjunct::getCreateTime, orderClothItemFactoryQueryDTO.getBeginTime());
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getEndTime() != null) {
|
|
|
+ queryWrapper.lt(OrderClothAdjunct::getCreateTime, DateUtils.addDays(orderClothItemFactoryQueryDTO.getEndTime(), 1));
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getBeginInFactoryTime() != null) {
|
|
|
+ queryWrapper.ge(OrderClothAdjunct::getInFactoryTime, orderClothItemFactoryQueryDTO.getBeginInFactoryTime());
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getEndInFactoryTime() != null) {
|
|
|
+ queryWrapper.lt(OrderClothAdjunct::getInFactoryTime, DateUtils.addDays(orderClothItemFactoryQueryDTO.getEndInFactoryTime(), 1));
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getBeginOutFactoryTime() != null) {
|
|
|
+ queryWrapper.ge(OrderClothAdjunct::getOutFactoryTime, orderClothItemFactoryQueryDTO.getBeginOutFactoryTime());
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getEndOutFactoryTime() != null) {
|
|
|
+ queryWrapper.lt(OrderClothAdjunct::getOutFactoryTime, DateUtils.addDays(orderClothItemFactoryQueryDTO.getEndOutFactoryTime(), 1));
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getBeginCheckClothTime() != null) {
|
|
|
+ queryWrapper.ge(OrderClothAdjunct::getCheckClothTime, orderClothItemFactoryQueryDTO.getBeginCheckClothTime());
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getEndCheckClothTime() != null) {
|
|
|
+ queryWrapper.lt(OrderClothAdjunct::getCheckClothTime, DateUtils.addDays(orderClothItemFactoryQueryDTO.getEndCheckClothTime(), 1));
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getInFactoryById() != null) {
|
|
|
+ queryWrapper.eq(OrderClothAdjunct::getInFactoryById, orderClothItemFactoryQueryDTO.getInFactoryById());
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getOutFactoryById() != null) {
|
|
|
+ queryWrapper.eq(OrderClothAdjunct::getOutFactoryById, orderClothItemFactoryQueryDTO.getOutFactoryById());
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getCheckClothById() != null) {
|
|
|
+ queryWrapper.eq(OrderClothAdjunct::getCheckClothById, orderClothItemFactoryQueryDTO.getCheckClothById());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(orderClothItemFactoryQueryDTO.getWashCode())) {
|
|
|
+ queryWrapper.eq(OrderClothAdjunct::getAdjunctNo, orderClothItemFactoryQueryDTO.getWashCode());
|
|
|
+ }
|
|
|
+ if (orderClothItemFactoryQueryDTO.getOrgId() != null) {
|
|
|
+ queryWrapper.eq(OrderClothAdjunct::getStoreId, orderClothItemFactoryQueryDTO.getOrgId());
|
|
|
+ }
|
|
|
+ queryWrapper.orderByDesc(BaseEntity::getCreateTime);
|
|
|
+
|
|
|
+ List<OrderClothAdjunct> itemList = orderClothAdjunctService.list(queryWrapper);
|
|
|
+
|
|
|
+ //查询附件
|
|
|
+ List<OrderClothItemVO> orderClothItemVOS = new ArrayList<>();
|
|
|
+ for (OrderClothAdjunct orderClothAdjunct : itemList) {
|
|
|
+ OrderClothItemVO orderClothItemVO = new OrderClothItemVO();
|
|
|
+ OrderClothItem orderClothItem = orderClothItemService.selectOrderClothItemById(orderClothAdjunct.getOrderClothId());
|
|
|
+ BeanUtils.copyProperties(orderClothItem, orderClothItemVO);
|
|
|
+ orderClothItemVO.setIsAdjunct("Y");
|
|
|
+ orderClothItemVO.setId(orderClothAdjunct.getId());
|
|
|
+ orderClothItemVO.setWashCode(orderClothAdjunct.getAdjunctNo());
|
|
|
+ orderClothItemVO.setClothItemName("【附件】" + orderClothItemVO.getClothItemName() + " * " + orderClothAdjunct.getAdjunctName());
|
|
|
+ orderClothItemVO.setOrgName(sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda()
|
|
|
+ .eq(SysOrg::getId, orderClothItemVO.getOrgId())
|
|
|
+ .eq(SysOrg::getSourceType, orderClothItemVO.getSourceType()), false).getName());
|
|
|
+ orderClothItemVO.setFlowStatus(orderClothAdjunct.getFlowStatus());
|
|
|
+ orderClothItemVOS.add(orderClothItemVO);
|
|
|
+ }
|
|
|
+ return getDataTable(orderClothItemVOS, new PageInfo(itemList).getTotal());
|
|
|
+ }
|
|
|
+
|
|
|
LambdaQueryWrapper<OrderClothItem> queryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
.eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId());
|
|
|
if (StringUtils.isNotEmpty(orderClothItemFactoryQueryDTO.getFlowStatus())) {
|
|
@@ -405,8 +619,6 @@ public class OrderClothItemController extends BaseController {
|
|
|
queryWrapper.orderByDesc(BaseEntity::getCreateTime);
|
|
|
|
|
|
List<OrderClothItem> itemList = orderClothItemService.list(queryWrapper);
|
|
|
-
|
|
|
-
|
|
|
LambdaQueryWrapper<SysOrg> sysOrgLambdaQueryWrapper = new QueryWrapper<SysOrg>().lambda();
|
|
|
if (itemList.stream().filter(orderClothItemVO -> SourceType.FACTORY.getCode()
|
|
|
.equals(orderClothItemVO.getSourceType())).collect(Collectors.toSet()).size() > 0) {
|
|
@@ -423,18 +635,16 @@ public class OrderClothItemController extends BaseController {
|
|
|
.map(OrderClothItem::getOrgId).collect(Collectors.toSet())));
|
|
|
}
|
|
|
List<SysOrg> sysOrgs = sysOrgService.list(sysOrgLambdaQueryWrapper);
|
|
|
- Map<Long, SysOrg> factoryOrgMap = sysOrgs.stream().filter(sysOrg -> SourceType.FACTORY.getCode()
|
|
|
- .equals(sysOrg.getSourceType())).collect(Collectors.toMap(SysOrg::getId, SysOrg -> SysOrg));
|
|
|
Map<Long, SysOrg> storeOrgMap = sysOrgs.stream().filter(sysOrg -> SourceType.STORE.getCode()
|
|
|
.equals(sysOrg.getSourceType())).collect(Collectors.toMap(SysOrg::getId, SysOrg -> SysOrg));
|
|
|
List<OrderClothItemVO> itemVOList = new ArrayList<>();
|
|
|
for (OrderClothItem record : itemList) {
|
|
|
OrderClothItemVO orderClothItemVO = new OrderClothItemVO();
|
|
|
BeanUtils.copyProperties(record, orderClothItemVO);
|
|
|
- if (SourceType.FACTORY.getCode().equals(record.getSourceType())) {
|
|
|
- orderClothItemVO.setOrgName(factoryOrgMap.get(record.getOrgId()).getName());
|
|
|
- } else {
|
|
|
+ if(storeOrgMap.get(record.getOrgId())!=null){
|
|
|
orderClothItemVO.setOrgName(storeOrgMap.get(record.getOrgId()).getName());
|
|
|
+ }else{
|
|
|
+ orderClothItemVO.setOrgName("--");
|
|
|
}
|
|
|
itemVOList.add(orderClothItemVO);
|
|
|
|
|
@@ -669,9 +879,11 @@ public class OrderClothItemController extends BaseController {
|
|
|
public R<OrderClothItemVO> getInfo(@PathVariable("id") Long id) {
|
|
|
LambdaQueryWrapper<OrderClothItem> queryWrapper = new QueryWrapper<OrderClothItem>().lambda()
|
|
|
.eq(OrderClothItem::getId, id);
|
|
|
- if (!SourceType.MANAGER.getCode().equals(SecurityUtils.getLoginUser().getSourceType())) {
|
|
|
- queryWrapper.eq(OrderClothItem::getSourceType, SecurityUtils.getLoginUser().getSourceType())
|
|
|
- .eq(OrderClothItem::getOrgId, SecurityUtils.getLoginUser().getOrgId());
|
|
|
+ if(SourceType.FACTORY.getCode().equals(SecurityUtils.getLoginUser().getSourceType())){
|
|
|
+ queryWrapper.eq(OrderClothItem::getFactoryId, SecurityUtils.getLoginUser().getOrgId());
|
|
|
+ }
|
|
|
+ if(SourceType.STORE.getCode().equals(SecurityUtils.getLoginUser().getSourceType())){
|
|
|
+ queryWrapper.eq(OrderClothItem::getOrgId, SecurityUtils.getLoginUser().getOrgId());
|
|
|
}
|
|
|
OrderClothItem orderClothItem = orderClothItemService.getOne(queryWrapper
|
|
|
);
|
|
@@ -756,7 +968,6 @@ public class OrderClothItemController extends BaseController {
|
|
|
@ApiOperation(value = "重洗衣服")
|
|
|
public AjaxResult reFlowCloth(@RequestParam Long orderClothItemId) {
|
|
|
orderClothItemService.reFlowCloth(orderClothItemId);
|
|
|
-
|
|
|
clothHangerOrderRelationService.remove(new QueryWrapper<ClothHangerOrderRelation>().lambda()
|
|
|
.eq(ClothHangerOrderRelation::getOrderClothItemId, orderClothItemId));
|
|
|
return toAjax(true);
|