送货单,退货单,到货单相关功能修改

master
anthonywj 2 years ago
parent f075e95181
commit 6feaa85616

@ -77,11 +77,13 @@ public class UdiRlSupController extends BaseController {
if (bindingResult.hasErrors()) { if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
} }
if (StrUtil.isEmpty(companyProductRelevanceRequest.getCustomerId())) {
String customerId = getCustomerId(); String customerId = getCustomerId();
if (customerId.equals("110")) { if (customerId.equals("110")) {
companyProductRelevanceRequest.setCustomerId(null); companyProductRelevanceRequest.setCustomerId(null);
}
} }
companyProductRelevanceRequest.setIsDisable(false); companyProductRelevanceRequest.setIsDisable(false);
if (StrUtil.isNotEmpty(companyProductRelevanceRequest.getUdiCode())) { if (StrUtil.isNotEmpty(companyProductRelevanceRequest.getUdiCode())) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(companyProductRelevanceRequest.getUdiCode()); UdiEntity udiEntity = FilterUdiUtils.getUdi(companyProductRelevanceRequest.getUdiCode());

@ -49,7 +49,7 @@ public class InvInnerOrderPrintController {
private InvInnerOrderPrintService invInnerOrderPrintService; private InvInnerOrderPrintService invInnerOrderPrintService;
@Resource @Resource
SystemPDFModuleService systemPDFModuleService; SystemPDFModuleService systemPDFModuleService;
@Resource @Resource
SystemPDFTemplateService systemPDFTemplateService; SystemPDFTemplateService systemPDFTemplateService;
@Value("${file_path}") @Value("${file_path}")
@ -60,8 +60,6 @@ public class InvInnerOrderPrintController {
private InvInnerOrderPdfTempService innerOrderPdfTempService; private InvInnerOrderPdfTempService innerOrderPdfTempService;
@GetMapping("/udiwms/innerOrderPrint/filter") @GetMapping("/udiwms/innerOrderPrint/filter")
public BaseResponse filterList(FilterinnerOrderprintRequest filterinnerOrderprintRequest) { public BaseResponse filterList(FilterinnerOrderprintRequest filterinnerOrderprintRequest) {
List<InvInnerOrderPrintEntity> list = invInnerOrderPrintService.filterOrderPrintList(filterinnerOrderprintRequest); List<InvInnerOrderPrintEntity> list = invInnerOrderPrintService.filterOrderPrintList(filterinnerOrderprintRequest);
@ -73,25 +71,27 @@ public class InvInnerOrderPrintController {
} }
@PostMapping("/udiwms/innerOrderPrint/addOrderPrint") @PostMapping("/udiwms/innerOrderPrint/addOrderPrint")
public BaseResponse addOrderPrint(@RequestBody invInnerOrderprintReques invInnerOrderprintReques){ public BaseResponse addOrderPrint(@RequestBody invInnerOrderprintReques invInnerOrderprintReques) {
if(invInnerOrderprintReques.getOrderIdFk()!=null){ if (invInnerOrderprintReques.getOrderIdFk() != null) {
invInnerOrderPrintService.addOrderList(invInnerOrderprintReques.getOrderIdFk()); invInnerOrderPrintService.addOrderList(invInnerOrderprintReques.getOrderIdFk());
}else{ } else {
return ResultVOUtils.error(999,"参数错误!"); return ResultVOUtils.error(999, "参数错误!");
} }
return ResultVOUtils.success(); return ResultVOUtils.success();
} }
//-----------打印码 //-----------打印码
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("/udiwms/pdf/template/inspection/stock/qrcode/text/file") @PostMapping("/udiwms/pdf/template/inspection/stock/qrcode/text/file")
public BaseResponse inspectionStockQRCodeTextPDFFromTemplateFile( public BaseResponse inspectionStockQRCodeTextPDFFromTemplateFile(
@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) throws Exception { @RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) throws Exception {
if (inspectionPDFTemplateRequest.getModuleId() == null)
inspectionPDFTemplateRequest.setModuleId(3);
SystemPDFModuleEntity systemPDFModuleEntity = systemPDFModuleService.selectById(inspectionPDFTemplateRequest.getModuleId() + "");
if (systemPDFModuleEntity == null) return ResultVOUtils.error(500, "未找到单据模板模块设置,请检查");
SystemPDFModuleEntity systemPDFModuleEntity = systemPDFModuleService.selectById(6 + "");
if (systemPDFModuleEntity == null) return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
SystemPDFTemplateEntity systemPDFTemplateEntity = SystemPDFTemplateEntity systemPDFTemplateEntity =
systemPDFTemplateService.selectById(String.valueOf(systemPDFModuleEntity.getTemplateId())); systemPDFTemplateService.selectById(String.valueOf(systemPDFModuleEntity.getTemplateId()));
if (systemPDFTemplateEntity == null) return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); if (systemPDFTemplateEntity == null) return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
@ -104,8 +104,12 @@ public class InvInnerOrderPrintController {
public BaseResponse stockQRCodeTextPDFFromTemplateFile( public BaseResponse stockQRCodeTextPDFFromTemplateFile(
@RequestBody InnerOrderQRCodeTextPDFTemplateRequest stockQRCodeTextPDFTemplateRequest, @RequestBody InnerOrderQRCodeTextPDFTemplateRequest stockQRCodeTextPDFTemplateRequest,
HttpServletRequest request, HttpServletResponse response) throws Exception { HttpServletRequest request, HttpServletResponse response) throws Exception {
SystemPDFModuleEntity systemPDFModuleEntity = systemPDFModuleService.selectById(6 + "");
if (systemPDFModuleEntity == null) return null; if (stockQRCodeTextPDFTemplateRequest.getModuleId() == null)
stockQRCodeTextPDFTemplateRequest.setModuleId(3);
SystemPDFModuleEntity systemPDFModuleEntity = systemPDFModuleService.selectById(stockQRCodeTextPDFTemplateRequest.getModuleId() + "");
if (systemPDFModuleEntity == null) return ResultVOUtils.error(500, "未找到单据模板模块设置,请检查");
SystemPDFTemplateEntity systemPDFTemplateEntity = SystemPDFTemplateEntity systemPDFTemplateEntity =
systemPDFTemplateService.selectById(String.valueOf(systemPDFModuleEntity.getTemplateId())); systemPDFTemplateService.selectById(String.valueOf(systemPDFModuleEntity.getTemplateId()));
if (systemPDFTemplateEntity == null) return null; if (systemPDFTemplateEntity == null) return null;
@ -178,7 +182,7 @@ public class InvInnerOrderPrintController {
} }
for (innerOrderPrintRequest innerOrderPrintRequest : mStockPrintEntities) { for (innerOrderPrintRequest innerOrderPrintRequest : mStockPrintEntities) {
InvInnerOrderPrintEntity innerOrderPrintEntity=new InvInnerOrderPrintEntity(); InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity();
innerOrderPrintEntity.setStatus(1); innerOrderPrintEntity.setStatus(1);
innerOrderPrintEntity.setId(innerOrderPrintRequest.getId()); innerOrderPrintEntity.setId(innerOrderPrintRequest.getId());
invInnerOrderPrintService.updateOrder(innerOrderPrintEntity); invInnerOrderPrintService.updateOrder(innerOrderPrintEntity);
@ -198,9 +202,9 @@ public class InvInnerOrderPrintController {
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("/udiwms/pdf/template/stock/qrcode/text/maxfile") @PostMapping("/udiwms/pdf/template/stock/qrcode/text/maxfile")
public BaseResponse stockQRCodeMaxTextPDFFromTemplateFile(@RequestBody InnerOrderQRCodeTextPDFTemplateRequest innerOrderQRCodeTextPDFTemplateRequest){ public BaseResponse stockQRCodeMaxTextPDFFromTemplateFile(@RequestBody InnerOrderQRCodeTextPDFTemplateRequest innerOrderQRCodeTextPDFTemplateRequest) {
PageSimpleResponse pageSimpleResponse=invInnerOrderPrintService.print(innerOrderQRCodeTextPDFTemplateRequest); PageSimpleResponse pageSimpleResponse = invInnerOrderPrintService.print(innerOrderQRCodeTextPDFTemplateRequest);
return ResultVOUtils.success(pageSimpleResponse); return ResultVOUtils.success(pageSimpleResponse);

@ -10,6 +10,8 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant; import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.ConstantType; import com.glxp.api.constant.ConstantType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.basic.BasicProductsEntity; import com.glxp.api.entity.basic.BasicProductsEntity;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inout.IoOrderEntity;
@ -22,6 +24,7 @@ import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.purchase.PurArrivalDetailResponse; import com.glxp.api.res.purchase.PurArrivalDetailResponse;
import com.glxp.api.res.purchase.PurArrivalResponse; import com.glxp.api.res.purchase.PurArrivalResponse;
import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.inout.IoOrderDetailBizService; import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderService; import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.purchase.PurArrivalDetailService; import com.glxp.api.service.purchase.PurArrivalDetailService;
@ -47,7 +50,7 @@ import java.util.stream.Collectors;
@Validated @Validated
@RequiredArgsConstructor @RequiredArgsConstructor
@RestController @RestController
public class PurArrivalController { public class PurArrivalController extends BaseController {
@Resource @Resource
@ -65,6 +68,8 @@ public class PurArrivalController {
@Resource @Resource
IoOrderDetailBizService ioOrderDetailBizService; IoOrderDetailBizService ioOrderDetailBizService;
@Resource
InvWarehouseService invWarehouseService;
/** /**
* *
@ -74,7 +79,7 @@ public class PurArrivalController {
@PostMapping("/purchase/arrival/postOrder") @PostMapping("/purchase/arrival/postOrder")
public BaseResponse postOrder(@RequestBody PostPurArrivalRequest purArrivalRequest) { public BaseResponse postOrder(@RequestBody PostPurArrivalRequest purArrivalRequest) {
Long userId = customerService.getUserId(); Long userId = getUserId();
PurArrivalEntity purArrivalEntity = purArrivalRequest.getPurArrivalEntity(); PurArrivalEntity purArrivalEntity = purArrivalRequest.getPurArrivalEntity();
purArrivalEntity.setCreateUser(userId + ""); purArrivalEntity.setCreateUser(userId + "");
@ -82,12 +87,13 @@ public class PurArrivalController {
purArrivalEntity.setUpdateTime(new Date()); purArrivalEntity.setUpdateTime(new Date());
purArrivalEntity.setUpdateUser(userId + ""); purArrivalEntity.setUpdateUser(userId + "");
purArrivalEntity.setStatus(purArrivalRequest.getEditStatus()); //草稿状态 purArrivalEntity.setStatus(purArrivalRequest.getEditStatus()); //草稿状态
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(purArrivalEntity.getInvCode());
purArrivalEntity.setDeptCode(invWarehouseEntity.getParentId());
if (purArrivalRequest.getType() != null) { if (purArrivalRequest.getType() != null) {
String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.SH_ORDER, "yyyyMMdd")); String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DH_ORDER, "yyyyMMdd"));
purArrivalEntity.setBillNo(billNo); purArrivalEntity.setBillNo(billNo);
} }
if (purArrivalEntity.getId() == null) { if (purArrivalEntity.getId() == null) {
purArrivalService.insert(purArrivalEntity); purArrivalService.insert(purArrivalEntity);
} else { } else {
@ -154,13 +160,16 @@ public class PurArrivalController {
String billNo = ""; String billNo = "";
List<PurArrivalDetailEntity> purOrderDetailEntities = purArrivalDetailService.findByOrderId(purArrivalEntity.getId() + ""); List<PurArrivalDetailEntity> purOrderDetailEntities = purArrivalDetailService.findByOrderId(purArrivalEntity.getId() + "");
//对计划单里面的供应商进行分组
Map<String, List<PurArrivalDetailEntity>> map = purOrderDetailEntities.stream().collect(Collectors.groupingBy(PurArrivalDetailEntity::getSupId));
if (postPurArrivalRequest.getEditStatus() == ConstantStatus.APPLY_AUDIT_ED) { if (postPurArrivalRequest.getEditStatus() == ConstantStatus.APPLY_AUDIT_ED) {
if (CollUtil.isNotEmpty(purOrderDetailEntities) && postPurArrivalRequest.isAutoPurchase() == true if (CollUtil.isNotEmpty(purOrderDetailEntities) && postPurArrivalRequest.isAutoPurchase() == true
&& StrUtil.isNotEmpty(postPurArrivalRequest.getTargetSubInv()) && StrUtil.isNotEmpty(postPurArrivalRequest.getTargetBillAction())) { && StrUtil.isNotEmpty(postPurArrivalRequest.getTargetSubInv()) && StrUtil.isNotEmpty(postPurArrivalRequest.getTargetBillAction())) {
//对计划单里面的供应商进行分组
Map<String, List<PurArrivalDetailEntity>> map = purOrderDetailEntities.stream().collect(Collectors.groupingBy(PurArrivalDetailEntity::getSupId));
for (Map.Entry<String, List<PurArrivalDetailEntity>> m : map.entrySet()) { for (Map.Entry<String, List<PurArrivalDetailEntity>> m : map.entrySet()) {
//生产单据表信息 //生产单据表信息

@ -11,6 +11,7 @@ import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.ConstantType; import com.glxp.api.constant.ConstantType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.basic.BasicProductsEntity; import com.glxp.api.entity.basic.BasicProductsEntity;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inout.IoOrderEntity;
@ -20,6 +21,7 @@ import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.purchase.PurDeliveryDetailResponse; import com.glxp.api.res.purchase.PurDeliveryDetailResponse;
import com.glxp.api.res.purchase.PurDeliveryResponse; import com.glxp.api.res.purchase.PurDeliveryResponse;
import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.inout.IoOrderDetailBizService; import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderService; import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.purchase.PurDeliveryDetailService; import com.glxp.api.service.purchase.PurDeliveryDetailService;
@ -59,7 +61,8 @@ public class PurDeliveryController extends BaseController {
IoOrderService ioOrderService; IoOrderService ioOrderService;
@Resource @Resource
IoOrderDetailBizService ioOrderDetailBizService; IoOrderDetailBizService ioOrderDetailBizService;
@Resource
InvWarehouseService invWarehouseService;
/** /**
* *
@ -77,6 +80,8 @@ public class PurDeliveryController extends BaseController {
purArrivalEntity.setUpdateTime(new Date()); purArrivalEntity.setUpdateTime(new Date());
purArrivalEntity.setUpdateUser(userId + ""); purArrivalEntity.setUpdateUser(userId + "");
purArrivalEntity.setStatus(purDeliveryRequest.getEditStatus()); //草稿状态 purArrivalEntity.setStatus(purDeliveryRequest.getEditStatus()); //草稿状态
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(purArrivalEntity.getInvCode());
purArrivalEntity.setDeptCode(invWarehouseEntity.getParentId());
if (purDeliveryRequest.getType() != null) { if (purDeliveryRequest.getType() != null) {
String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.SH_ORDER, "yyyyMMdd")); String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.SH_ORDER, "yyyyMMdd"));

@ -10,6 +10,7 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant; import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.ConstantType; import com.glxp.api.constant.ConstantType;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.basic.BasicProductsEntity; import com.glxp.api.entity.basic.BasicProductsEntity;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inout.IoOrderEntity;
@ -20,6 +21,7 @@ import com.glxp.api.res.purchase.PurOrderDetailResponse;
import com.glxp.api.res.purchase.PurOrderResponse; import com.glxp.api.res.purchase.PurOrderResponse;
import com.glxp.api.res.purchase.PurPlanResponse; import com.glxp.api.res.purchase.PurPlanResponse;
import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.inout.IoOrderDetailBizService; import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderService; import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.purchase.*; import com.glxp.api.service.purchase.*;
@ -66,7 +68,8 @@ public class PurOrderController {
IoOrderService ioOrderService; IoOrderService ioOrderService;
@Resource @Resource
IoOrderDetailBizService ioOrderDetailBizService; IoOrderDetailBizService ioOrderDetailBizService;
@Resource
InvWarehouseService invWarehouseService;
/** /**
* *
@ -84,7 +87,8 @@ public class PurOrderController {
purOrderEntity.setUpdateTime(new Date()); purOrderEntity.setUpdateTime(new Date());
purOrderEntity.setUpdateUser(userId + ""); purOrderEntity.setUpdateUser(userId + "");
purOrderEntity.setStatus(postPurOrderRequest.getEditStatus()); //草稿状态 purOrderEntity.setStatus(postPurOrderRequest.getEditStatus()); //草稿状态
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(purOrderEntity.getInvCode());
purOrderEntity.setDeptCode(invWarehouseEntity.getParentId());
if (postPurOrderRequest.getType() != null) { if (postPurOrderRequest.getType() != null) {
String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.CG_ORDER, "yyyyMMdd")); String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.CG_ORDER, "yyyyMMdd"));
purOrderEntity.setBillNo(billNo); purOrderEntity.setBillNo(billNo);

@ -11,6 +11,7 @@ import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.ConstantType; import com.glxp.api.constant.ConstantType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.basic.BasicProductsEntity; import com.glxp.api.entity.basic.BasicProductsEntity;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inout.IoOrderEntity;
@ -22,6 +23,7 @@ import com.glxp.api.res.purchase.PurArrivalResponse;
import com.glxp.api.res.purchase.PurReturnedDetailResponse; import com.glxp.api.res.purchase.PurReturnedDetailResponse;
import com.glxp.api.res.purchase.PurReturnedResponse; import com.glxp.api.res.purchase.PurReturnedResponse;
import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.inout.IoOrderDetailBizService; import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderService; import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.purchase.PurArrivalDetailService; import com.glxp.api.service.purchase.PurArrivalDetailService;
@ -64,6 +66,8 @@ public class PurReturnedController extends BaseController {
IoOrderService ioOrderService; IoOrderService ioOrderService;
@Resource @Resource
IoOrderDetailBizService ioOrderDetailBizService; IoOrderDetailBizService ioOrderDetailBizService;
@Resource
InvWarehouseService invWarehouseService;
/** /**
@ -82,6 +86,8 @@ public class PurReturnedController extends BaseController {
purArrivalEntity.setUpdateTime(new Date()); purArrivalEntity.setUpdateTime(new Date());
purArrivalEntity.setUpdateUser(userId + ""); purArrivalEntity.setUpdateUser(userId + "");
purArrivalEntity.setStatus(postPurReturnedRequest.getEditStatus()); //草稿状态 purArrivalEntity.setStatus(postPurReturnedRequest.getEditStatus()); //草稿状态
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(purArrivalEntity.getInvCode());
purArrivalEntity.setDeptCode(invWarehouseEntity.getParentId());
if (postPurReturnedRequest.getType() != null) { if (postPurReturnedRequest.getType() != null) {
String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.SH_ORDER, "yyyyMMdd")); String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.SH_ORDER, "yyyyMMdd"));
@ -154,13 +160,13 @@ public class PurReturnedController extends BaseController {
String billNo = ""; String billNo = "";
List<PurReturnedDetailEntity> purReturnedDetailEntities = purReturnedDetailService.findByOrderId(purReturnedEntity.getId() + ""); List<PurReturnedDetailEntity> purReturnedDetailEntities = purReturnedDetailService.findByOrderId(purReturnedEntity.getId() + "");
//对计划单里面的供应商进行分组
Map<String, List<PurReturnedDetailEntity>> map = purReturnedDetailEntities.stream().collect(Collectors.groupingBy(PurReturnedDetailEntity::getSupId));
if (postPurReturnedRequest.getEditStatus() == ConstantStatus.APPLY_AUDIT_ED) { if (postPurReturnedRequest.getEditStatus() == ConstantStatus.APPLY_AUDIT_ED) {
if (CollUtil.isNotEmpty(purReturnedDetailEntities) && postPurReturnedRequest.isAutoPurchase() == true if (CollUtil.isNotEmpty(purReturnedDetailEntities) && postPurReturnedRequest.isAutoPurchase() == true
&& StrUtil.isNotEmpty(postPurReturnedRequest.getTargetSubInv()) && StrUtil.isNotEmpty(postPurReturnedRequest.getTargetBillAction())) { && StrUtil.isNotEmpty(postPurReturnedRequest.getTargetSubInv()) && StrUtil.isNotEmpty(postPurReturnedRequest.getTargetBillAction())) {
//对计划单里面的供应商进行分组
Map<String, List<PurReturnedDetailEntity>> map = purReturnedDetailEntities.stream().collect(Collectors.groupingBy(PurReturnedDetailEntity::getSupId));
for (Map.Entry<String, List<PurReturnedDetailEntity>> m : map.entrySet()) { for (Map.Entry<String, List<PurReturnedDetailEntity>> m : map.entrySet()) {
//生产单据表信息 //生产单据表信息

@ -55,4 +55,6 @@ public class PurArrivalDetailEntity {
private String productDate; private String productDate;
@TableField(value = "expireDate") @TableField(value = "expireDate")
private String expireDate; private String expireDate;
@TableField(value = "arrivalCount")
private Integer arrivalCount;
} }

@ -132,4 +132,9 @@ public class PurArrivalEntity {
@TableField(value = "stockOrderNo") @TableField(value = "stockOrderNo")
private String stockOrderNo; private String stockOrderNo;
@TableField(value = "supId")
private String supId;
} }

@ -132,4 +132,7 @@ public class PurReturnedEntity {
*/ */
@TableField(value = "stockOrderNo") @TableField(value = "stockOrderNo")
private String stockOrderNo; private String stockOrderNo;
@TableField(value = "supId")
private String supId;
} }

@ -12,7 +12,7 @@ public class InspectionPDFTemplateRequest {
private int module; private int module;
private String orderId; private String orderId;
private Long customerId; private Long customerId;
private int moduleId; private Integer moduleId;
} }

@ -67,4 +67,6 @@ public class PurArrivalRequest extends ListPageRequest {
private Long purDeliveryId; private Long purDeliveryId;
private String supId;
} }

@ -66,5 +66,6 @@ public class PurDeliveryRequest extends ListPageRequest {
private String endDate; private String endDate;
private Long purOrderId; //采购订单ID private Long purOrderId; //采购订单ID
private String supId;
} }

@ -66,4 +66,5 @@ public class PurReturnedRequest extends ListPageRequest {
private String endDate; private String endDate;
private Long applyId; private Long applyId;
private String supId;
} }

@ -47,5 +47,6 @@ public class PurArrivalDetailResponse {
private String supId; private String supId;
private String supName; private String supName;
private Integer arrivalCount;
} }

@ -70,4 +70,7 @@ public class PurArrivalResponse {
private String createUserName; private String createUserName;
private String auditUserName; private String auditUserName;
private String supId;
private Integer arrivalCount;
private String supName;
} }

@ -70,4 +70,6 @@ public class PurReturnedResponse {
private String createUserName; private String createUserName;
private String auditUserName; private String auditUserName;
private String supName;
private String supId;
} }

@ -140,8 +140,8 @@
<if test="unionCode != '' and unionCode != null"> <if test="unionCode != '' and unionCode != null">
and ( and (
nameCode LIKE concat('%',#{unionCode},'%') nameCode LIKE concat('%',#{unionCode},'%')
or basic_udirel.ybbm LIKE concat('%',#{unionCode},'%') or basic_products.ybbm LIKE concat('%',#{unionCode},'%')
or basic_udirel.sptm LIKE concat('%',#{unionCode},'%') or basic_products.sptm LIKE concat('%',#{unionCode},'%')
) )
</if> </if>
<if test="thrPiId != '' and thrPiId != null"> <if test="thrPiId != '' and thrPiId != null">
@ -220,4 +220,4 @@
ORDER BY company_product_relevance.updateTime DESC ORDER BY company_product_relevance.updateTime DESC
</select> </select>
</mapper> </mapper>

@ -7,12 +7,14 @@
cb.employeeName createUserName, cb.employeeName createUserName,
ab.employeeName auditUserName, ab.employeeName auditUserName,
auth_warehouse.NAME invName, auth_warehouse.NAME invName,
auth_dept.`name` deptName auth_dept.`name` deptName,
bc.name supName
FROM pur_arrival FROM pur_arrival
LEFT JOIN auth_user cb ON pur_arrival.createUser = cb.id LEFT JOIN auth_user cb ON pur_arrival.createUser = cb.id
LEFT JOIN auth_user ab ON pur_arrival.auditUser = ab.id LEFT JOIN auth_user ab ON pur_arrival.auditUser = ab.id
LEFT JOIN auth_warehouse ON pur_arrival.invCode = auth_warehouse.`code` LEFT JOIN auth_warehouse ON pur_arrival.invCode = auth_warehouse.`code`
LEFT JOIN auth_dept ON auth_dept.CODE = pur_arrival.deptCode LEFT JOIN auth_dept ON auth_dept.code = pur_arrival.deptCode
left join basic_corp bc on pur_arrival.supId = bc.erpId
<where> <where>
<if test="billNo != '' and billNo != null"> <if test="billNo != '' and billNo != null">
AND billNo = #{billNo} AND billNo = #{billNo}
@ -30,11 +32,13 @@
<if test="status != null and status != 10 and status != 11"> <if test="status != null and status != 10 and status != 11">
and pur_arrival.status = #{status} and pur_arrival.status = #{status}
</if> </if>
<!-- 审核界面:查询未审核,已拒绝-->
<if test="status == 10"> <if test="status == 10">
and (pur_arrival.status = 3 or pur_arrival.status = 2 or pur_arrival.status = 4) and (pur_arrival.status = 2 or pur_arrival.status = 4)
</if> </if>
<!-- 草稿界面:草稿,已拒绝-->
<if test="status == 11"> <if test="status == 11">
and (pur_arrival.status = 1 or pur_arrival.status = 2 or pur_arrival.status = 4) and (pur_arrival.status = 1 or pur_arrival.status = 4)
</if> </if>
<if test="deptCode != '' and deptCode != null"> <if test="deptCode != '' and deptCode != null">

@ -90,6 +90,9 @@
<if test="expireDate != null"> <if test="expireDate != null">
expireDate=#{expireDate}, expireDate=#{expireDate},
</if> </if>
<if test="arrivalCount != null">
arrivalCount=#{arrivalCount},
</if>
</trim> </trim>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
@ -99,7 +102,7 @@
parameterType="com.glxp.api.entity.purchase.PurArrivalDetailEntity"> parameterType="com.glxp.api.entity.purchase.PurArrivalDetailEntity">
REPLACE INTO pur_arrival_detail REPLACE INTO pur_arrival_detail
(orderIdFk, productId, productName, count, supId, zczbhhzbapzbh, batchNo, productDate, (orderIdFk, productId, productName, count, supId, zczbhhzbapzbh, batchNo, productDate,
expireDate) values expireDate, arrivalCount) values
<foreach collection="datas" item="item" index="index" separator=","> <foreach collection="datas" item="item" index="index" separator=",">
(#{item.orderIdFk}, (#{item.orderIdFk},
@ -107,7 +110,7 @@
#{item.productName}, #{item.productName},
#{item.count}, #{item.count},
#{item.supId}, #{item.supId},
#{item.zczbhhzbapzbh}, #{item.batchNo}, #{item.productDate}, #{item.expireDate}) #{item.zczbhhzbapzbh}, #{item.batchNo}, #{item.productDate}, #{item.expireDate}, #{item.arrivalCount})
</foreach> </foreach>
</insert> </insert>

@ -52,6 +52,9 @@
<if test="createUser != '' and createUser != null"> <if test="createUser != '' and createUser != null">
AND createUser = #{createUser} AND createUser = #{createUser}
</if> </if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
</where> </where>
</select> </select>
</mapper> </mapper>

@ -7,12 +7,14 @@
cb.employeeName createUserName, cb.employeeName createUserName,
ab.employeeName auditUserName, ab.employeeName auditUserName,
auth_warehouse.NAME invName, auth_warehouse.NAME invName,
auth_dept.`name` deptName auth_dept.`name` deptName,
bc.name supName
FROM pur_returned FROM pur_returned
LEFT JOIN auth_user cb ON pur_returned.createUser = cb.id LEFT JOIN auth_user cb ON pur_returned.createUser = cb.id
LEFT JOIN auth_user ab ON pur_returned.auditUser = ab.id LEFT JOIN auth_user ab ON pur_returned.auditUser = ab.id
LEFT JOIN auth_warehouse ON pur_returned.invCode = auth_warehouse.`code` LEFT JOIN auth_warehouse ON pur_returned.invCode = auth_warehouse.`code`
LEFT JOIN auth_dept ON auth_dept.CODE = pur_returned.deptCode LEFT JOIN auth_dept ON auth_dept.CODE = pur_returned.deptCode
left join basic_corp bc on pur_returned.supId = bc.erpId
<where> <where>
<if test="billNo != '' and billNo != null"> <if test="billNo != '' and billNo != null">
AND billNo = #{billNo} AND billNo = #{billNo}
@ -30,11 +32,13 @@
<if test="status != null and status != 10 and status != 11"> <if test="status != null and status != 10 and status != 11">
and pur_returned.status = #{status} and pur_returned.status = #{status}
</if> </if>
<!-- 审核界面:查询未审核,已拒绝-->
<if test="status == 10"> <if test="status == 10">
and (pur_returned.status = 3 or pur_returned.status = 2 or pur_returned.status = 4) and (pur_returned.status = 2 or pur_returned.status = 4)
</if> </if>
<!-- 草稿界面:草稿,已拒绝-->
<if test="status == 11"> <if test="status == 11">
and (pur_returned.status = 1 or pur_returned.status = 2 or pur_returned.status = 4) and (pur_returned.status = 1 or pur_returned.status = 4)
</if> </if>
<if test="deptCode != '' and deptCode != null"> <if test="deptCode != '' and deptCode != null">

@ -29,7 +29,7 @@
FROM pur_returned_detail FROM pur_returned_detail
INNER JOIN basic_udirel ON pur_returned_detail.productId = basic_udirel.id INNER JOIN basic_udirel ON pur_returned_detail.productId = basic_udirel.id
INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
INNER JOIN basic_corp ON pur_returned_detail.supId = basic_corp.erpId left JOIN basic_corp ON pur_returned_detail.supId = basic_corp.erpId
<where> <where>
<if test="orderIdFk != '' and orderIdFk != null"> <if test="orderIdFk != '' and orderIdFk != null">
AND orderIdFk = #{orderIdFk} AND orderIdFk = #{orderIdFk}

@ -29,7 +29,8 @@ CALL Pro_Temp_ColumnWork('pur_delivery_detail', 'expireDate', 'varchar(255) ', 1
CALL Pro_Temp_ColumnWork('pur_arrival_detail', 'batchNo', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('pur_arrival_detail', 'batchNo', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('pur_arrival_detail', 'productDate', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('pur_arrival_detail', 'productDate', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('pur_arrival_detail', 'expireDate', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('pur_arrival_detail', 'expireDate', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('pur_arrival_detail', 'arrivalCount', 'int ', 1);
CALL Pro_Temp_ColumnWork('pur_arrival', 'supId', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('pur_returned_detail', 'batchNo', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('pur_returned_detail', 'batchNo', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('pur_returned_detail', 'productDate', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('pur_returned_detail', 'productDate', 'varchar(255) ', 1);
@ -37,3 +38,4 @@ CALL Pro_Temp_ColumnWork('pur_returned_detail', 'expireDate', 'varchar(255) ', 1
CALL Pro_Temp_ColumnWork('pur_delivery', 'supId', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('pur_delivery', 'supId', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('pur_returned', 'supId', 'varchar(255) ', 1);

Loading…
Cancel
Save