diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index 521aa2db..f88106b6 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -615,6 +615,7 @@ public class IoOrderDetailBizController extends BaseController { orderService.update(orderEntity); } ioOrderDetailBizEntity.setCheckFileName(ioOrderDetailBizEntity.getFilePath()); + ioOrderDetailBizEntity.setCheckColdFileName(ioOrderDetailBizEntity.getColdFilePath()); boolean b = orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity); return ResultVOUtils.success("修改成功!"); } diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java index 04f9a76f..653ebcab 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java @@ -2,6 +2,7 @@ package com.glxp.api.controller.inout; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.common.enums.ResultEnum; @@ -13,19 +14,36 @@ import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; import com.glxp.api.entity.inout.IoOrderEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; +import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.req.inout.FilterCodeRequest; import com.glxp.api.req.inout.FilterOrderDetailResultRequest; import com.glxp.api.req.inout.FilterOrderRequest; +import com.glxp.api.req.inout.InspectionPDFTemplateRequest; import com.glxp.api.res.inout.IoCodeResponse; import com.glxp.api.res.inout.IoOrderDetailResultResponse; import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.inout.*; +import com.glxp.api.service.system.SystemPDFModuleService; +import com.glxp.api.service.system.SystemPDFTemplateService; +import com.glxp.api.util.JasperUtils; +import net.sf.jasperreports.engine.JRException; +import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 单据扫码明细查询接口 @@ -40,6 +58,12 @@ public class IoOrderDetailResultController extends BaseController { IBasicBussinessTypeService basicBussinessTypeService; @Resource IoCodeService codeService; + @Resource + private SystemPDFTemplateService systemPDFTemplateService; + @Resource + private SystemPDFModuleService systemPDFModuleService; + @Value("${file_path}") + private String filePath; /** * 查询单据扫码明细列表 @@ -140,4 +164,96 @@ public class IoOrderDetailResultController extends BaseController { return ResultVOUtils.success(orderDetailBizEntities); } + + //校验模板是否正确 + @AuthRuleAnnotation("") + @PostMapping("/udiwms/pdf/template/order/result/file") + public BaseResponse inspectionStockOrderPDFFromTemplateFile(@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) { + + //查询模板文件是否存在 + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getId()); + if (null == sysPdfTemplateRelevanceStatemenEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); + } + + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId())); + if (null == systemPDFTemplateEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + } + return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId()); + } + + + /** + * 出入库明细打印 + * + * @param filterOrderDetailResultRequest + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udiwms/inout/resultDetail/filterOrderPrint") + public BaseResponse filterOrderPrint(@RequestBody FilterOrderDetailResultRequest filterOrderDetailResultRequest, HttpServletRequest request, HttpServletResponse response) throws JRException, IOException { + List ioOrderDetailResultResponseList=new ArrayList<>(); + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(filterOrderDetailResultRequest.getTemplateId()); + //打印单号标签 + Map data = new HashMap<>(1); + List list = new ArrayList<>(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式 + + //按选入打印 + if(filterOrderDetailResultRequest.getList() != null && filterOrderDetailResultRequest.getList().size()>0){ + ioOrderDetailResultResponseList =filterOrderDetailResultRequest.getList(); + }else{ + //按查询打印 + FilterOrderRequest filterOrderRequest = new FilterOrderRequest(); + filterOrderRequest.setVueType(filterOrderDetailResultRequest.getActionType()); + List actions = orderService.setActions(filterOrderRequest); + if (CollUtil.isEmpty(actions)) { + return ResultVOUtils.success(""); + } + filterOrderDetailResultRequest.setActions(actions); + ioOrderDetailResultResponseList = orderDetailResultService.filterOrderList(filterOrderDetailResultRequest); + for (IoOrderDetailResultResponse orderDetailResultResponse : ioOrderDetailResultResponseList) { + if (orderDetailResultResponse.getMainAction().equals(ConstantType.TYPE_OUT)) { + orderDetailResultResponse.setOutCount(orderDetailResultResponse.getReCount()); + orderDetailResultResponse.setInCount(0); + } else { + orderDetailResultResponse.setOutCount(0); + orderDetailResultResponse.setInCount(orderDetailResultResponse.getReCount()); + } + } + } + int i=1; + for (IoOrderDetailResultResponse ioOrderDetailResultResponse : ioOrderDetailResultResponseList) { + //组装数据 + Map ioOrderDetailResultData = new HashMap<>(); + ioOrderDetailResultData.put("index", String.valueOf(i)); + ioOrderDetailResultData.put("nameCode", ioOrderDetailResultResponse.getNameCode() == null ? ' ' : ioOrderDetailResultResponse.getNameCode()); + ioOrderDetailResultData.put("batchNo", ioOrderDetailResultResponse.getBatchNo() == null ? ' ' : ioOrderDetailResultResponse.getBatchNo()); + ioOrderDetailResultData.put("productDate", ioOrderDetailResultResponse.getProductDate() == null ? ' ' : ioOrderDetailResultResponse.getProductDate()); + ioOrderDetailResultData.put("expireDate", ioOrderDetailResultResponse.getExpireDate() == null ? ' ' : ioOrderDetailResultResponse.getExpireDate()); + ioOrderDetailResultData.put("coName", ioOrderDetailResultResponse.getCoName() == null ? ' ' : ioOrderDetailResultResponse.getCoName()); + ioOrderDetailResultData.put("certCode", ioOrderDetailResultResponse.getCertCode() == null ? ' ' : ioOrderDetailResultResponse.getCertCode()); + ioOrderDetailResultData.put("ylqxzcrbarmc", ioOrderDetailResultResponse.getYlqxzcrbarmc() == null ? ' ' : ioOrderDetailResultResponse.getYlqxzcrbarmc()); + ioOrderDetailResultData.put("manufacturer", ioOrderDetailResultResponse.getManufacturer() == null ? ' ' : ioOrderDetailResultResponse.getManufacturer()); + ioOrderDetailResultData.put("measname", ioOrderDetailResultResponse.getMeasname() == null ? ' ' : ioOrderDetailResultResponse.getMeasname()); + ioOrderDetailResultData.put("spec", ioOrderDetailResultResponse.getSpec() == null ? ' ' : ioOrderDetailResultResponse.getSpec()); + ioOrderDetailResultData.put("price", ioOrderDetailResultResponse.getPrice() == null ? ' ' : ioOrderDetailResultResponse.getPrice()); + ioOrderDetailResultData.put("count", ioOrderDetailResultResponse.getCount()); + ioOrderDetailResultData.put("reCount",ioOrderDetailResultResponse.getReCount()); + ioOrderDetailResultData.put("inCount", ioOrderDetailResultResponse.getInCount()); + ioOrderDetailResultData.put("acceptCount", ioOrderDetailResultResponse.getAcceptCount()); + ioOrderDetailResultData.put("fromCorpName", ioOrderDetailResultResponse.getFromCorpName() == null ? ' ' : ioOrderDetailResultResponse.getFromCorpName()); + ioOrderDetailResultData.put("billTypeName", ioOrderDetailResultResponse.getBillTypeName() == null ? ' ' : ioOrderDetailResultResponse.getBillTypeName()); + ioOrderDetailResultData.put("mainAction", ioOrderDetailResultResponse.getMainAction() == null ? ' ' : ioOrderDetailResultResponse.getMainAction()); + ioOrderDetailResultData.put("auditTime", ioOrderDetailResultResponse.getAuditTime() == null ? ' ' : formatter.format(ioOrderDetailResultResponse.getAuditTime())); + list.add(ioOrderDetailResultData); + i++; + } + + String param = JSON.toJSONString(list); + JasperUtils.jasperReport(request, response, param, filePath+"pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + return ResultVOUtils.success(); + } + } diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java index bffa41e7..18b9ef0d 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java @@ -25,7 +25,6 @@ import java.util.List; public class IoOrderInvoiceController { @Resource IoOrderInvoiceService ioOrderInvoiceService; - RefreshInoiceRequest refreshInoiceRequest; @Resource IoOrderDetailCodeService orderDetailCodeService; @@ -37,7 +36,7 @@ public class IoOrderInvoiceController { IoOrderInvoiceRequest orderInvoiceRequest = new IoOrderInvoiceRequest(); BeanUtils.copyProperties(refreshInoiceRequest, orderInvoiceRequest); - List orderInvoiceEntities = ioOrderInvoiceService.selectOrderInvoice(orderInvoiceRequest); + List orderInvoiceEntities = ioOrderInvoiceService.findByBillNo(orderInvoiceRequest.getOrderIdFk()); List orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderInvoiceRequest.getOrderIdFk()); RefreshInoiceResponse response = new RefreshInoiceResponse(); diff --git a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java index c7e8e823..b64f4696 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java @@ -1,5 +1,6 @@ package com.glxp.api.controller.inv; +import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; @@ -12,6 +13,7 @@ import com.glxp.api.entity.inv.InnerOrderEntity; import com.glxp.api.entity.inv.InvInnerOrderPrintEntity; import com.glxp.api.entity.inv.InvInnerOrderPdfTempEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SystemPDFModuleEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.req.inout.InspectionPDFTemplateRequest; @@ -173,7 +175,7 @@ public class InvInnerOrderPrintController { innerOrderPdfTempService.insertStockPrintTempEntity(stockPrintTempEntity); stockPrintTempEntities.add(stockPrintTempEntity); } - jaspaperService.printPdfLocal(splits, stockPrintTempEntities, systemPDFTemplateEntity.getPath()); + jaspaperService.printPdfLocal(splits, stockPrintTempEntities, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath()); PageInfo pageInfo; pageInfo = new PageInfo<>(stockPrintTempEntities); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); @@ -184,7 +186,7 @@ public class InvInnerOrderPrintController { } else { Map data = new HashMap(); data.put("data", printEntities); - JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); } @@ -219,6 +221,94 @@ public class InvInnerOrderPrintController { } + + //-----------打印码 + @AuthRuleAnnotation("") + @PostMapping("/udiwms/pdf/template/inspection/stock/qrcode/text/statement/file") + public BaseResponse inspectionStockQRCodeTextPDFFromTemplateStatementFile( + @RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) throws Exception { + + //查询模板文件是否存在 + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getLabelId()+""); + if (null == sysPdfTemplateRelevanceStatemenEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); + } + + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId())); + if (null == systemPDFTemplateEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + } + return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId()); + } + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/pdf/template/stock/qrcode/text/statement/file") + public BaseResponse stockQRCodeTextPDFFromTemplateStatementFile( + @RequestBody InnerOrderQRCodeTextPDFTemplateRequest stockQRCodeTextPDFTemplateRequest, + HttpServletRequest request, HttpServletResponse response) throws Exception { + + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(stockQRCodeTextPDFTemplateRequest.getLabelId()+""); + if (sysPdfTemplateRelevanceStatemenEntity == null) return ResultVOUtils.error(500, "未找到单据模板模块设置,请检查"); + + SystemPDFTemplateEntity systemPDFTemplateEntity = + systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId())); + if (systemPDFTemplateEntity == null) return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + + List printEntities = new ArrayList<>(); + List mStockPrintEntities = new ArrayList<>(); + FilterinnerOrderprintRequest filterinnerOrderprintRequest = new FilterinnerOrderprintRequest(); + if (stockQRCodeTextPDFTemplateRequest.getOrderId() != null) { + filterinnerOrderprintRequest.setSOrderId(stockQRCodeTextPDFTemplateRequest.getOrderId()); + } else { + filterinnerOrderprintRequest.setId(stockQRCodeTextPDFTemplateRequest.getQueryId()); + } + List stockPrintEntities = invInnerOrderPrintService.filterJoinInnerPrint(filterinnerOrderprintRequest); + if (stockPrintEntities != null && stockPrintEntities.size() > 0) { + mStockPrintEntities.addAll(stockPrintEntities); + } + for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) { + PdfPrintCountEntity pdfPrintCount = getCount(stockQRCodeTextPDFTemplateRequest.getCountList(), InnerOrderPrintResponse); + if (pdfPrintCount != null && pdfPrintCount.getRowCount() > 0) { + for (int i = 0; i < pdfPrintCount.getRowCount(); i++) { + InnerOrderPrintResponse clone = new InnerOrderPrintResponse(); + BeanUtils.copyProperties(InnerOrderPrintResponse, clone); + printEntities.add(clone); + } + } else { + printEntities.add(InnerOrderPrintResponse); + } + } + + + String param = JSON.toJSONString(printEntities); + JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); + + String orderId = ""; + for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) { + InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity(); + innerOrderPrintEntity.setStatus(1); + innerOrderPrintEntity.setId(InnerOrderPrintResponse.getId()); + invInnerOrderPrintService.updateOrder(innerOrderPrintEntity); + orderId = InnerOrderPrintResponse.getId() + ""; + } + + //查询订单id + InvInnerOrderPrintEntity innerOrderPrintEntity = invInnerOrderPrintService.selectById(orderId); + //更新内部码状态 + InnerOrderEntity innerOrderEntity = innerOrderService.findByRecordKey(innerOrderPrintEntity.getOrderIdFk()); + if (innerOrderEntity != null) { + innerOrderEntity.setGenStatus(2); + innerOrderEntity.setId(innerOrderEntity.getId()); + innerOrderService.update(innerOrderEntity); + } + IoOrderEntity ioOrderEntity = new IoOrderEntity(); + ioOrderEntity.setInCodeStatus(1); + ioOrderEntity.setBillNo(innerOrderPrintEntity.getOrderIdFk()); + ioOrderService.updateByBillNo(ioOrderEntity); + return null; + + } + public PdfPrintCountEntity getCount(List countList, InnerOrderPrintResponse InnerOrderPrintResponse) { for (PdfPrintCountEntity pdfPrintCount : countList) { if (pdfPrintCount.getQueryId().equals(InnerOrderPrintResponse.getId() + "")) { diff --git a/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java b/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java index b602414e..efbee6f7 100644 --- a/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java +++ b/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java @@ -116,7 +116,10 @@ public class PurOrderController { if (purOrderRequest.getStatus() == null) { purOrderRequest.setStatus(11); //查询未审核和草稿状态 } - + String customerId = customerService.getCustomerId(); + if (!customerId.equals("110")) { + purOrderRequest.setSupId(customerId); + } List purApplyEntities = purOrderService.queryPageList(purOrderRequest); PageInfo pageInfo; pageInfo = new PageInfo<>(purApplyEntities); @@ -156,7 +159,7 @@ public class PurOrderController { purOrderEntity.setUpdateTime(new Date()); purOrderService.update(purOrderEntity); - if(postPurOrderRequest.isAutoPurchase() && StrUtil.isNotEmpty(postPurOrderRequest.getTargetBillAction())){ + if (postPurOrderRequest.isAutoPurchase() && StrUtil.isNotEmpty(postPurOrderRequest.getTargetBillAction())) { String billNo = ""; List purOrderDetailEntities = purOrderDetailService.findByOrderId(purOrderEntity.getId() + ""); @@ -164,61 +167,59 @@ public class PurOrderController { Map> map = purOrderDetailEntities.stream().collect(Collectors.groupingBy(PurOrderDetailEntity::getSupId)); + if (CollUtil.isNotEmpty(purOrderDetailEntities) && postPurOrderRequest.isAutoPurchase() == true + && StrUtil.isNotEmpty(postPurOrderRequest.getTargetBillAction())) { - if (CollUtil.isNotEmpty(purOrderDetailEntities) && postPurOrderRequest.isAutoPurchase() == true - && StrUtil.isNotEmpty(postPurOrderRequest.getTargetBillAction())) { - - for (Map.Entry> m : map.entrySet()) { - //生产单据表信息 - IoOrderEntity ioOrderEntity = new IoOrderEntity(); - ioOrderEntity.setBillNo(gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd"))); - ioOrderEntity.setCorpOrderId(CustomUtil.getDate()); - ioOrderEntity.setMainAction(ConstantType.TYPE_PUT); - ioOrderEntity.setAction(postPurOrderRequest.getTargetBillAction()); - ioOrderEntity.setFromCorp(m.getKey()); - ioOrderEntity.setFromType(ConstantStatus.FROM_Order); - ioOrderEntity.setStatus(1); - ioOrderEntity.setDealStatus(1); - ioOrderEntity.setOrderType(1); - ioOrderEntity.setCreateTime(new Date()); - ioOrderEntity.setCreateUser(postPurOrderRequest.getPurOrderEntity().getAuditUser()); - ioOrderEntity.setUpdateTime(new Date()); - ioOrderEntity.setUpdateUser(postPurOrderRequest.getPurOrderEntity().getAuditUser()); - ioOrderEntity.setCustomerId("110"); - ioOrderEntity.setDeptCode(purOrderEntity.getDeptCode()); - ioOrderEntity.setInvCode(purOrderEntity.getInvCode()); - ioOrderService.insertOrder(ioOrderEntity); - billNo += ioOrderEntity.getBillNo() + ","; - //插入业务单表 - for (PurOrderDetailEntity obj : m.getValue()) { - BasicProductsEntity basicProductsEntity = purOrderDetailService.selectIoOrderDetailBiz(obj.getId()); - IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); - ioOrderDetailBizEntity.setOrderIdFk(ioOrderEntity.getBillNo()); - ioOrderDetailBizEntity.setBindRlFk(Long.valueOf(obj.getProductId())); - ioOrderDetailBizEntity.setCount(obj.getCount()); - ioOrderDetailBizEntity.setUuidFk(basicProductsEntity.getUuid()); - ioOrderDetailBizEntity.setNameCode(basicProductsEntity.getNameCode()); - ioOrderDetailBizEntity.setCoName(basicProductsEntity.getCpmctymc()); - ioOrderDetailBizEntity.setCertCode(basicProductsEntity.getZczbhhzbapzbh()); - ioOrderDetailBizEntity.setYlqxzcrbarmc(basicProductsEntity.getYlqxzcrbarmc()); - ioOrderDetailBizEntity.setManufacturer(basicProductsEntity.getManufactory()); - ioOrderDetailBizEntity.setMeasname(basicProductsEntity.getMeasname()); - ioOrderDetailBizEntity.setSpec(basicProductsEntity.getGgxh()); - if (basicProductsEntity.getPrice() != null) { - ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice())); - } - ioOrderDetailBizEntity.setSupId(obj.getSupId()); - ioOrderDetailBizService.insert(ioOrderDetailBizEntity); + for (Map.Entry> m : map.entrySet()) { + //生产单据表信息 + IoOrderEntity ioOrderEntity = new IoOrderEntity(); + ioOrderEntity.setBillNo(gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd"))); + ioOrderEntity.setCorpOrderId(CustomUtil.getDate()); + ioOrderEntity.setMainAction(ConstantType.TYPE_PUT); + ioOrderEntity.setAction(postPurOrderRequest.getTargetBillAction()); + ioOrderEntity.setFromCorp(m.getKey()); + ioOrderEntity.setFromType(ConstantStatus.FROM_Order); + ioOrderEntity.setStatus(1); + ioOrderEntity.setDealStatus(1); + ioOrderEntity.setOrderType(1); + ioOrderEntity.setCreateTime(new Date()); + ioOrderEntity.setCreateUser(postPurOrderRequest.getPurOrderEntity().getAuditUser()); + ioOrderEntity.setUpdateTime(new Date()); + ioOrderEntity.setUpdateUser(postPurOrderRequest.getPurOrderEntity().getAuditUser()); + ioOrderEntity.setCustomerId("110"); + ioOrderEntity.setDeptCode(purOrderEntity.getDeptCode()); + ioOrderEntity.setInvCode(purOrderEntity.getInvCode()); + ioOrderService.insertOrder(ioOrderEntity); + billNo += ioOrderEntity.getBillNo() + ","; + //插入业务单表 + for (PurOrderDetailEntity obj : m.getValue()) { + BasicProductsEntity basicProductsEntity = purOrderDetailService.selectIoOrderDetailBiz(obj.getId()); + IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); + ioOrderDetailBizEntity.setOrderIdFk(ioOrderEntity.getBillNo()); + ioOrderDetailBizEntity.setBindRlFk(Long.valueOf(obj.getProductId())); + ioOrderDetailBizEntity.setCount(obj.getCount()); + ioOrderDetailBizEntity.setUuidFk(basicProductsEntity.getUuid()); + ioOrderDetailBizEntity.setNameCode(basicProductsEntity.getNameCode()); + ioOrderDetailBizEntity.setCoName(basicProductsEntity.getCpmctymc()); + ioOrderDetailBizEntity.setCertCode(basicProductsEntity.getZczbhhzbapzbh()); + ioOrderDetailBizEntity.setYlqxzcrbarmc(basicProductsEntity.getYlqxzcrbarmc()); + ioOrderDetailBizEntity.setManufacturer(basicProductsEntity.getManufactory()); + ioOrderDetailBizEntity.setMeasname(basicProductsEntity.getMeasname()); + ioOrderDetailBizEntity.setSpec(basicProductsEntity.getGgxh()); + if (basicProductsEntity.getPrice() != null) { + ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice())); } + ioOrderDetailBizEntity.setSupId(obj.getSupId()); + ioOrderDetailBizService.insert(ioOrderDetailBizEntity); } - purOrderEntity.setStockOrderNo(billNo.substring(0, billNo.length() - 1)); - purOrderService.update(purOrderEntity); } + purOrderEntity.setStockOrderNo(billNo.substring(0, billNo.length() - 1)); + purOrderService.update(purOrderEntity); + } } - return ResultVOUtils.success("更新成功!"); } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index 73115e77..1de6dcae 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -241,6 +241,11 @@ public class SupCertController { supCertEntity.setUpdateTime(new Date()); supCertEntity.setStatus(0); supCertEntity.setId(IdUtil.getSnowflakeNextId()); + if (supCertEntity.getVailDate() != null && supCertEntity.getExpireDate() != null) { + if (supCertEntity.getVailDate().getTime() > supCertEntity.getExpireDate().getTime()) { + return ResultVOUtils.error(999, "失效期不能小于生效期!"); + } + } boolean b = supCertService.insertCompanyCert(supCertEntity); return ResultVOUtils.success("成功"); } @@ -305,7 +310,7 @@ public class SupCertController { if (postSupCertRequest.getVailDate() != null && postSupCertRequest.getExpireDate() != null) { if (postSupCertRequest.getVailDate().getTime() > postSupCertRequest.getExpireDate().getTime()) { - return ResultVOUtils.error(999, "生效期不能小于失效期!"); + return ResultVOUtils.error(999, "失效期不能小于生效期!"); } } diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java index f2bb0ca6..2a542be5 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java @@ -180,12 +180,23 @@ public class IoOrderDetailBizEntity { @TableField(value = "filePath") private String filePath; + @TableField(value = "coldFilePath") + private String coldFilePath; + /** * 检验报告名称 */ @TableField(value = "checkFileName") private String checkFileName; + /** + * 冷链报告名称 + */ + @TableField(value = "checkColdFileName") + private String checkColdFileName; + + + @TableField(exist = false) private boolean checkSuccess; diff --git a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java index 700c315c..f27320f3 100644 --- a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java +++ b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java @@ -1,5 +1,6 @@ package com.glxp.api.req.inout; +import com.glxp.api.res.inout.IoOrderDetailResultResponse; import com.glxp.api.util.page.ListPageRequest; import lombok.Data; @@ -43,7 +44,9 @@ public class FilterOrderDetailResultRequest extends ListPageRequest { private String endAduditTime; //结束日期 private String fromCorp; private String actionType; + private String templateId; private String manufacturer; private String zczbhhzbapzbh; private List actions; + private List list; } diff --git a/src/main/java/com/glxp/api/req/purchase/PurOrderRequest.java b/src/main/java/com/glxp/api/req/purchase/PurOrderRequest.java index f74661d5..845c4dc8 100644 --- a/src/main/java/com/glxp/api/req/purchase/PurOrderRequest.java +++ b/src/main/java/com/glxp/api/req/purchase/PurOrderRequest.java @@ -81,6 +81,7 @@ public class PurOrderRequest extends ListPageRequest { private Date auditTime; private String createUser; + private String supId; /** * 创建时间 diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java index 2d908e88..d4a9fc4f 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java @@ -169,6 +169,10 @@ public class IoOrderDetailBizResponse { private String invoiceCode; + private String coldFilePath; + + private String checkColdFileName; + } diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderDetailResultResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderDetailResultResponse.java index 2c079da3..56e2da9f 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailResultResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailResultResponse.java @@ -3,6 +3,7 @@ package com.glxp.api.res.inout; import lombok.Data; import java.math.BigDecimal; +import java.util.Date; /** * 单据扫码明细VO @@ -159,6 +160,7 @@ public class IoOrderDetailResultResponse { private String fromCorpName; private String billTypeName; private String mainAction; + private Date auditTime; } diff --git a/src/main/java/com/glxp/api/util/SupplementVailUtil.java b/src/main/java/com/glxp/api/util/SupplementVailUtil.java index 17912680..7ac1aea6 100644 --- a/src/main/java/com/glxp/api/util/SupplementVailUtil.java +++ b/src/main/java/com/glxp/api/util/SupplementVailUtil.java @@ -54,7 +54,7 @@ public class SupplementVailUtil { basicProductSetEntity = basicProductSetEntityMap.get("manufactory"); if (isMustFill(type, basicProductSetEntity)) { if (StrUtil.isEmptyIfStr(supplementRequest.getManufactory())) { - return "生产厂家不能为空"; + return "生产企业不能为空"; } } diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml b/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml index 2421b41c..f60f7cf2 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml @@ -13,18 +13,18 @@ diff --git a/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml b/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml index 8fcc3dd7..acf4c3d0 100644 --- a/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml @@ -40,12 +40,15 @@ cb.employeeName createUserName, ab.employeeName auditUserName, auth_warehouse.NAME invName, - auth_dept.`name` deptName + auth_dept.`name` deptName, + basic_corp.name supName FROM pur_order LEFT JOIN auth_user cb ON pur_order.createUser = cb.id LEFT JOIN auth_user ab ON pur_order.auditUser = ab.id LEFT JOIN auth_warehouse ON pur_order.invCode = auth_warehouse.`code` LEFT JOIN auth_dept ON auth_dept.CODE = pur_order.deptCode + left join basic_corp on pur_order.supId = basic_corp.erpId + AND billNo = #{billNo} @@ -92,6 +95,9 @@ AND auditUser = #{auditUser} + + AND pur_order.supId = #{supId} + AND createUser = #{createUser} diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index 05273196..3b6f34c7 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -184,6 +184,11 @@ CALL Pro_Temp_ColumnWork('sys_pdf_template', 'bussinessStatus', 'varchar(255)', CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'filePath', 'varchar(255)', 1); +CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'coldFilePath', 'varchar(255)', 1); + +CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'checkColdFileName', 'varchar(255)', 1); + + CALL Pro_Temp_ColumnWork('io_order', 'checkStatus', 'tinyint', 1); INSERT ignore INTO `sys_scheduled`(`id`, `cronName`, `cron`, `customerId`, `remark`)