|
|
|
@ -18,6 +18,8 @@ import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
|
import com.glxp.api.entity.auth.InvWarehouseEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.*;
|
|
|
|
|
import com.glxp.api.entity.inout.*;
|
|
|
|
|
import com.glxp.api.entity.purchase.PurOrderDetailEntity;
|
|
|
|
|
import com.glxp.api.entity.purchase.PurOrderEntity;
|
|
|
|
|
import com.glxp.api.entity.purchase.SupProductEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SystemParamConfigEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrOrderDetailEntity;
|
|
|
|
@ -33,6 +35,8 @@ import com.glxp.api.res.inout.IoOrderInvoiceResponse;
|
|
|
|
|
import com.glxp.api.service.auth.InvWarehouseService;
|
|
|
|
|
import com.glxp.api.service.basic.*;
|
|
|
|
|
import com.glxp.api.service.inout.*;
|
|
|
|
|
import com.glxp.api.service.purchase.PurOrderDetailService;
|
|
|
|
|
import com.glxp.api.service.purchase.PurOrderService;
|
|
|
|
|
import com.glxp.api.service.purchase.SupCertService;
|
|
|
|
|
import com.glxp.api.service.purchase.SupProductService;
|
|
|
|
|
import com.glxp.api.service.system.SystemParamConfigService;
|
|
|
|
@ -399,6 +403,71 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
PurOrderService purOrderService;
|
|
|
|
|
@Resource
|
|
|
|
|
PurOrderDetailService purOrderDetailService;
|
|
|
|
|
|
|
|
|
|
//选入领用单据至业务单据
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/inout/order/addPurOrder")
|
|
|
|
|
@Log(title = "单据管理", businessType = BusinessType.INSERT)
|
|
|
|
|
public BaseResponse addPurOrder(@RequestBody PurOrderEntity purOrderEntity,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
|
purOrderEntity = purOrderService.selectById(purOrderEntity.getId());
|
|
|
|
|
List<PurOrderDetailEntity> purOrderDetailEntities = purOrderDetailService.findByOrderId(purOrderEntity.getId() + "");
|
|
|
|
|
BasicBusTypeChangeEntity basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(purOrderEntity.getBillType());
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(basicBusTypeChangeEntity.getTargetAction());
|
|
|
|
|
|
|
|
|
|
AuthAdmin authAdmin = getUser();
|
|
|
|
|
//创建单据
|
|
|
|
|
IoOrderEntity orderEntity = new IoOrderEntity();
|
|
|
|
|
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
|
|
|
|
|
orderEntity.setBillNo(orderNo);
|
|
|
|
|
orderEntity.setCreateUser(authAdmin.getId() + "");
|
|
|
|
|
orderEntity.setCreateTime(new Date());
|
|
|
|
|
orderEntity.setUpdateUser(authAdmin.getId() + "");
|
|
|
|
|
orderEntity.setUpdateTime(new Date());
|
|
|
|
|
orderEntity.setCustomerId(authAdmin.getCustomerId() + "");
|
|
|
|
|
orderEntity.setCorpOrderId(purOrderEntity.getBillNo());
|
|
|
|
|
orderEntity.setAction(bussinessTypeEntity.getAction());
|
|
|
|
|
orderEntity.setMainAction(bussinessTypeEntity.getMainAction());
|
|
|
|
|
orderEntity.setDeptCode(purOrderEntity.getDeptCode());
|
|
|
|
|
orderEntity.setInvCode(purOrderEntity.getInvCode());
|
|
|
|
|
orderEntity.setFromReceiveBillNo(purOrderEntity.getBillNo());
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE);
|
|
|
|
|
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_DRAFT);
|
|
|
|
|
orderEntity.setFromType(ConstantStatus.FROM_RECEIVE);
|
|
|
|
|
orderEntity.setOrderType(ConstantStatus.ORDER_TYPE_BIZ);
|
|
|
|
|
orderEntity.setBusType(bussinessTypeEntity.getBusType());
|
|
|
|
|
orderService.insertOrder(orderEntity);
|
|
|
|
|
for (PurOrderDetailEntity purReceiveDetailEntity : purOrderDetailEntities) {
|
|
|
|
|
IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();
|
|
|
|
|
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(purReceiveDetailEntity.getProductId().longValue());
|
|
|
|
|
ioOrderDetailBizEntity.setOrderIdFk(orderEntity.getBillNo());
|
|
|
|
|
ioOrderDetailBizEntity.setBindRlFk(udiRelevanceResponse.getId());
|
|
|
|
|
ioOrderDetailBizEntity.setUuidFk(udiRelevanceResponse.getUuid());
|
|
|
|
|
ioOrderDetailBizEntity.setNameCode(udiRelevanceResponse.getNameCode());
|
|
|
|
|
ioOrderDetailBizEntity.setCoName(udiRelevanceResponse.getCpmctymc());
|
|
|
|
|
ioOrderDetailBizEntity.setCertCode(udiRelevanceResponse.getZczbhhzbapzbh());
|
|
|
|
|
ioOrderDetailBizEntity.setYlqxzcrbarmc(udiRelevanceResponse.getYlqxzcrbarmc());
|
|
|
|
|
ioOrderDetailBizEntity.setManufacturer(udiRelevanceResponse.getManufactory());
|
|
|
|
|
ioOrderDetailBizEntity.setMeasname(udiRelevanceResponse.getMeasname());
|
|
|
|
|
ioOrderDetailBizEntity.setSpec(udiRelevanceResponse.getGgxh());
|
|
|
|
|
ioOrderDetailBizEntity.setPrice(udiRelevanceResponse.getPrice());
|
|
|
|
|
ioOrderDetailBizEntity.setSupId(purReceiveDetailEntity.getSupId());
|
|
|
|
|
ioOrderDetailBizEntity.setCount(purReceiveDetailEntity.getCount());
|
|
|
|
|
orderDetailBizService.insert(ioOrderDetailBizEntity);
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success("选入成功!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/inout/order/delBizProduct")
|
|
|
|
|
@Log(title = "单据管理", businessType = BusinessType.DELETE)
|
|
|
|
@ -483,13 +552,13 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
@Log(title = "发票管理", businessType = BusinessType.INSERT)
|
|
|
|
|
public BaseResponse insertInvoice(@RequestBody IoOrderDetailBizEntity ioOrderDetailBizEntity) {
|
|
|
|
|
|
|
|
|
|
IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity();
|
|
|
|
|
ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk());
|
|
|
|
|
ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailBizEntity.getBindRlFk() + "");
|
|
|
|
|
ioOrderInvoiceEntity.setBatchNo(ioOrderDetailBizEntity.getBatchNo());
|
|
|
|
|
ioOrderInvoiceEntity.setProductDate(ioOrderDetailBizEntity.getProductDate());
|
|
|
|
|
ioOrderInvoiceEntity.setExpireDate(ioOrderDetailBizEntity.getExpireDate());
|
|
|
|
|
boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity);
|
|
|
|
|
IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity();
|
|
|
|
|
ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk());
|
|
|
|
|
ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailBizEntity.getBindRlFk() + "");
|
|
|
|
|
ioOrderInvoiceEntity.setBatchNo(ioOrderDetailBizEntity.getBatchNo());
|
|
|
|
|
ioOrderInvoiceEntity.setProductDate(ioOrderDetailBizEntity.getProductDate());
|
|
|
|
|
ioOrderInvoiceEntity.setExpireDate(ioOrderDetailBizEntity.getExpireDate());
|
|
|
|
|
boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity);
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success("成功");
|
|
|
|
|
|
|
|
|
|