|
|
|
@ -15,6 +15,7 @@ import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.constant.*;
|
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
|
import com.glxp.api.controller.sync.SpsSyncWebSocket;
|
|
|
|
|
import com.glxp.api.dao.inout.IoOrderDetailBizDao;
|
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
|
import com.glxp.api.entity.auth.InvBusUserEntity;
|
|
|
|
|
import com.glxp.api.entity.auth.InvWarehouseEntity;
|
|
|
|
@ -83,7 +84,7 @@ public class IoOrderController extends BaseController {
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderInvoiceService orderInvoiceService;
|
|
|
|
|
@Resource
|
|
|
|
|
private SystemParamConfigService systemParamConfigService;
|
|
|
|
|
IoOrderDetailBizDao orderDetailBizDao;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询单据列表
|
|
|
|
@ -873,7 +874,7 @@ public class IoOrderController extends BaseController {
|
|
|
|
|
return ResultVOUtils.page(pageInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udiwms/inout/order/findByBillNo")
|
|
|
|
|
public BaseResponse findByBillNo(@RequestParam("billNo") String billNo) {
|
|
|
|
|
if (StrUtil.isBlank(billNo)) {
|
|
|
|
@ -883,5 +884,56 @@ public class IoOrderController extends BaseController {
|
|
|
|
|
return ResultVOUtils.success(orderEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 单据再次配货
|
|
|
|
|
*
|
|
|
|
|
* @param ioOrderEntity
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/inout/order/copyOrder")
|
|
|
|
|
@Log(title = "单据再次配货", businessType = BusinessType.UPDATE)
|
|
|
|
|
public BaseResponse copyOrder(@RequestBody IoOrderEntity ioOrderEntity) {
|
|
|
|
|
|
|
|
|
|
IoOrderEntity orderEntity;
|
|
|
|
|
IoOrderEntity originOrderEntity = orderService.findByBillNo(ioOrderEntity.getBillNo());
|
|
|
|
|
originOrderEntity.setRepeatSup(true);
|
|
|
|
|
orderService.update(originOrderEntity);
|
|
|
|
|
|
|
|
|
|
orderEntity = orderService.findByCorpId(ioOrderEntity.getBillNo());
|
|
|
|
|
if (orderEntity != null && orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_TEMP_SAVE) {
|
|
|
|
|
return ResultVOUtils.success(orderEntity);
|
|
|
|
|
}
|
|
|
|
|
orderEntity = new IoOrderEntity();
|
|
|
|
|
BeanUtil.copyProperties(originOrderEntity, orderEntity);
|
|
|
|
|
|
|
|
|
|
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd"));
|
|
|
|
|
orderEntity.setCreateTime(new Date());
|
|
|
|
|
orderEntity.setBillNo(orderNo);
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE);
|
|
|
|
|
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_DRAFT);
|
|
|
|
|
orderEntity.setCorpOrderId(orderEntity.getBillNo());
|
|
|
|
|
orderEntity.setFromType(ConstantStatus.FROM_WEBNEW);
|
|
|
|
|
orderEntity.setMainAction(ConstantType.TYPE_PUT);
|
|
|
|
|
orderEntity.setAction(null);
|
|
|
|
|
orderEntity.setUpdateTime(new Date());
|
|
|
|
|
orderEntity.setUpdateUser(null);
|
|
|
|
|
orderEntity.setRelKey(null);
|
|
|
|
|
orderEntity.setRepeatSup(true);
|
|
|
|
|
orderEntity.setOriginUllageSupNo(orderEntity.getBillNo());
|
|
|
|
|
orderService.insertOrder(orderEntity);
|
|
|
|
|
|
|
|
|
|
List<IoOrderDetailBizEntity> originDetailBizEntities = orderDetailBizService.findByOrderId(ioOrderEntity.getBillNo());
|
|
|
|
|
List<IoOrderDetailBizEntity> orderDetailBizEntities = BeanUtil.copyToList(originDetailBizEntities, IoOrderDetailBizEntity.class);
|
|
|
|
|
orderDetailBizEntities.forEach(item ->
|
|
|
|
|
{
|
|
|
|
|
item.setId(null);
|
|
|
|
|
item.setOrderIdFk(orderNo);
|
|
|
|
|
orderDetailBizService.insert(item);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
return ResultVOUtils.success(orderEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|