|
|
|
@ -2,6 +2,7 @@ package com.glxp.api.admin.controller.thrsys;
|
|
|
|
|
//领用单
|
|
|
|
|
|
|
|
|
|
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
|
|
|
|
|
import com.glxp.api.admin.constant.Constant;
|
|
|
|
|
import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.thrsys.ThrOrderDetailEntity;
|
|
|
|
|
import com.glxp.api.admin.entity.thrsys.ThrOrderEntity;
|
|
|
|
@ -10,6 +11,8 @@ import com.glxp.api.admin.service.auth.CustomerService;
|
|
|
|
|
import com.glxp.api.admin.service.thrsys.ThrOrderDetailService;
|
|
|
|
|
import com.glxp.api.admin.service.thrsys.ThrOrderService;
|
|
|
|
|
import com.glxp.api.admin.util.DateUtil;
|
|
|
|
|
import com.glxp.api.admin.util.GennerOrderUtils;
|
|
|
|
|
import com.glxp.api.admin.util.OrderNoTypeBean;
|
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
@ -33,6 +36,8 @@ public class ThrOrderReceiveController {
|
|
|
|
|
private ThrOrderDetailService thrOrderDetailService;
|
|
|
|
|
@Resource
|
|
|
|
|
CustomerService customerService;
|
|
|
|
|
@Resource
|
|
|
|
|
GennerOrderUtils gennerOrderUtils;
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/thrsys/order/insertWeb")
|
|
|
|
@ -43,17 +48,17 @@ public class ThrOrderReceiveController {
|
|
|
|
|
}
|
|
|
|
|
Integer userId = customerService.getUserId();
|
|
|
|
|
ThrOrderEntity stockOrderEntity = new ThrOrderEntity();
|
|
|
|
|
// Integer id = Integer.parseInt(CustomUtil.getId());
|
|
|
|
|
BeanUtils.copyProperties(stockOrderPostRequest, stockOrderEntity);
|
|
|
|
|
stockOrderEntity.setCreateUser(userId + "");
|
|
|
|
|
stockOrderEntity.setType(1);//领用单据
|
|
|
|
|
stockOrderEntity.setUpdateTime(new Date());
|
|
|
|
|
stockOrderEntity.setBilldate(DateUtil.formatDate(new Date()));
|
|
|
|
|
// stockOrderEntity.setId(id);
|
|
|
|
|
ThrOrderEntity temp = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk());
|
|
|
|
|
if (temp != null) {
|
|
|
|
|
stockOrderEntity.setId(temp.getId());
|
|
|
|
|
}
|
|
|
|
|
String orderNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.LIN_YONG, "yyyyMMdd"));
|
|
|
|
|
stockOrderEntity.setBillNo(orderNo);
|
|
|
|
|
thrOrderService.insertThrOrder(stockOrderEntity);
|
|
|
|
|
stockOrderEntity = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk());
|
|
|
|
|
|
|
|
|
|