diff --git a/src/main/java/com/glxp/api/config/serializer/LocalDateJsonDeserializer.java b/src/main/java/com/glxp/api/config/serializer/LocalDateJsonDeserializer.java index c080c6b1..507fd2cd 100644 --- a/src/main/java/com/glxp/api/config/serializer/LocalDateJsonDeserializer.java +++ b/src/main/java/com/glxp/api/config/serializer/LocalDateJsonDeserializer.java @@ -2,6 +2,7 @@ package com.glxp.api.config.serializer; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.util.StrUtil; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; @@ -21,7 +22,7 @@ public class LocalDateJsonDeserializer extends JsonDeserializer { public LocalDate deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { String value = p.getText(); try { - return value == null ? null : LocalDateTimeUtil.parseDate(value, DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)); + return StrUtil.isEmpty(value) ? null : LocalDateTimeUtil.parseDate(value, DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)); } catch (Exception e) { log.error("日期格式解析错误", e); return null; diff --git a/src/main/java/com/glxp/api/config/serializer/LocalDateTimeJsonDeserializer.java b/src/main/java/com/glxp/api/config/serializer/LocalDateTimeJsonDeserializer.java index 45534bbe..a663a514 100644 --- a/src/main/java/com/glxp/api/config/serializer/LocalDateTimeJsonDeserializer.java +++ b/src/main/java/com/glxp/api/config/serializer/LocalDateTimeJsonDeserializer.java @@ -2,6 +2,7 @@ package com.glxp.api.config.serializer; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.util.StrUtil; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; @@ -21,7 +22,7 @@ public class LocalDateTimeJsonDeserializer extends JsonDeserializer { @Override public Long deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { String value = p.getText(); - return value == null ? null : Long.parseLong(value); + return StrUtil.isEmpty(value) ? null : Long.parseLong(value); } } diff --git a/src/main/java/com/glxp/api/controller/TestController.java b/src/main/java/com/glxp/api/controller/TestController.java index 27ef732b..288b3c4f 100644 --- a/src/main/java/com/glxp/api/controller/TestController.java +++ b/src/main/java/com/glxp/api/controller/TestController.java @@ -1,15 +1,19 @@ package com.glxp.api.controller; +import cn.hutool.core.util.StrUtil; import com.glxp.api.annotation.RepeatSubmit; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.req.sync.BasicExportStatusRequest; import com.glxp.api.task.TestStatOrderService; +import com.glxp.api.util.MsDateUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.text.ParseException; +import java.util.Date; @Slf4j @RestController @@ -26,6 +30,22 @@ public class TestController { return ResultVOUtils.success("生成成功!" + start + "=====" + end + "\n-------" + (start - end)); } + + @GetMapping("/test/stat/genToday") + public BaseResponse genToday(BasicExportStatusRequest basicExportStatusRequest) { + if (StrUtil.isEmpty(basicExportStatusRequest.getToday())) { + return ResultVOUtils.error(500, "当前时间不能为空!"); + } + long start = System.currentTimeMillis(); + try { + statOrderService.genStat(MsDateUtil.parseDate(basicExportStatusRequest.getToday(), "yyyy-MM-dd")); + } catch (ParseException e) { + e.printStackTrace(); + } + long end = System.currentTimeMillis(); + return ResultVOUtils.success("生成成功!" + start + "=====" + end + "\n-------" + (start - end)); + } + @RepeatSubmit() @GetMapping("/test/repeat") public BaseResponse testRepeat(String message) { diff --git a/src/main/java/com/glxp/api/controller/auth/LoginController.java b/src/main/java/com/glxp/api/controller/auth/LoginController.java index a88b6f31..7c8a274c 100644 --- a/src/main/java/com/glxp/api/controller/auth/LoginController.java +++ b/src/main/java/com/glxp/api/controller/auth/LoginController.java @@ -115,7 +115,7 @@ public class LoginController extends BaseController { Map claims = new HashMap<>(); claims.put("admin_id", authAdmin.getId()); - String token = JwtUtils.createToken(claims, 1800l); // 一天后过期 + String token = JwtUtils.createToken(claims, 86400L); // 一天后过期 Map map = new HashMap<>(); map.put("id", authAdmin.getId()); diff --git a/src/main/java/com/glxp/api/controller/inout/11 b/src/main/java/com/glxp/api/controller/inout/11 new file mode 100644 index 00000000..b77d6953 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/inout/11 @@ -0,0 +1 @@ +select * from basic_('7328','17117','17119','10053','10053','10052','10052','16844','11500','13649','11499','13749','2393','2677','3247','3247','1979','2379','1981','13201','9195','1984','2395','9028','3548','17129','791','791','1997','2400','3238','840','9615','9615','12476','17136','13978','13980','16729','15846','8919','842','16730','10400','663','663','10401','664','664','16197','17127','17126','15920','17131','16412','17145','2774','7508','652','740','740','17125','17146','10036','9751','15598','17153','2396','16292','7345','17148','4905','8607','742','2381','4510','640','2010','15596','15596','15556','15556','2382','744','11974','14797','11687','15850','2454','7380','15528','15848','5381','7443','8263','15897','12206','12206','747','846','846','847','848','848','848','848','2002','17140','17135','17134','17133','2654','2654','2653','2397','2398','4131','647','10580','4130','833','2563','16696','3354','13180','17086','17080','17081','17077','17147','15381','10037','14043','5448','13179','17143','17151','851','15369','642','642','17124','17139','17138','9741','2009','751','752','15646','857','7371','7371','7378','13588','762','762','8544','1970','14414','4736','4521','14413','14413','4524','2550','2551','684','2339','12474','16220','15633','2003','2008','15603','694','694','10612','14283','4046','15696','793','793','4027','12895','2667','2669','2669','2459','16247','2559','835','17128','17122','17120','17141','17123','15686','655','654','2070','659','10520','15648','809','809','9517','12257','2391','2391','15919','17132','951','1307','15566','15487','15557','947','947','894','894','3609','2908','2469','3188','1778','2913','1779','1779','15761','1804','1803','1803','3094','4264','4265','17171','14944','14944','1667','1667','1805','2935','1806','1672','14359','11147','889','13199','3873','1648','1648','1649','1649','1649','16675','16129','10030','10041','1781','2447','1668','1650','16847','15794','16846','1689','1689','4468','1596','8611','7407','16167','1598','1598','10038','1747','1747','1745','1745','15759','15758','8226','1808','8754','8754','8223','11727','11727','11727','11727','11731','1703','1704','1704','2448','2448','2450','2449','2877','3631','3632','3632','12933','14088','16828','13747','13747','1964','2842','2842','2842','13069','16338','16339','9807','9807','1730','1752','1783','13145','7517','7517','7517','7516','7516','7516','11724','11724','11724','11724','11724','1754','11719','4068','1988','13070','13070','1738','3239','3239','3239','7337','7337','15849','7441','14597','1963','1727','1727','1726','15611','15722','15722','1732','1732','2228','1819','1786','10519','3187','3187','8252','8252','8252','8252','7584','7584','7584','1654','11628','13005','13005','13005','15082','14845','14845','9515','9515','9808','10157','8204','8204','15384','1824','1826','1788','1788','1788','1788','1788','1789','1789','1789','1789','4063','4063','1827','1792','1582','1582','14099','16998','10078','16046','11729','1835','1835','14591','3251','869','1690','1690','1837','14888','14888','1894','8425','8427','10075','10075','15738','15738','16694','15007','3758','3758','1968','17155','2462','2462','1775','1760','1761','10816','1757','1757','1757','3274','3274','3274','3274','15593','15593','15593','15593','17026','17026','17026','17026','17026','17026','13003','17049','13000','13000','13000','14891','14891','8454','15592','15592','7497','9198','9198','10452','10452','4055','4055','4055','2128','16629','16629','16629','14028','16824','14418','2232','13917','2001','14856','1839','10624','15721','16438','1762','1762','8202','8202','1989','1989','15112','15112','16837','16964','16965','2125','2125','2125','1583','1583','1583','1585','1585','1584','1584','2664','2664','14042','14042','14042','7523','13322','1967','3281','3281','3281','2473','2473','9485','14416','14416','16826','16826','13753','13753','13752','14010','14010','7352','13068','13068','15531','15531','11631','2267','2270','2776','2776','3353','3353','3353','2271','10931','10931','10931','10931','10931','2775','2775','2272','2283','2283','2283','2283','3865','12683','12683','2670','2471','1795','1795','1682','2614','2614','14801','16111','4067','7521','1962','10049','10049','1658','1592','1593','1593','1659','10621','10621','10621','10621','10621','10621','10621','10621','15543','15543','15543','11252','14215','14215','14215','14215','14215','13912','13912','13912','14044','14044','14044','15540','15380','15380','15380','13707','13707','10040','14586','14586','4062','8230','1663','1661','1661','1843','1683','1683','15385','15385','15385','14287','1684','1644','14946','14946','14946','14946','15821','14764','14764','9948','3872','3872','3872','1844','1844','1796','11718','13291','13291','13291','13328','13328','13328','12249','12249','15006','15006','15281','1712','1711','1711','1711','1710','13067','13067','4409','15755','1797','1797','1713','2950','2950','1849','1645','1645','14426','1851','3869','3869','3869','14588','7530','7535') diff --git a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java index e1329558..8f0a2fe0 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -798,6 +798,7 @@ public class IoCodeTempController extends BaseController { } } + public BaseResponse checkInv(BasicBussinessTypeEntity bussinessTypeEntity, IoCodeTempEntity codeTempEntity, boolean isEdit) { if (bussinessTypeEntity.isVailInv() && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { int count = 0; 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 b81a0203..3b72c306 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -14,6 +14,7 @@ import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.Constant; import com.glxp.api.constant.ConstantStatus; +import com.glxp.api.constant.ConstantType; import com.glxp.api.controller.BaseController; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.InvWarehouseEntity; @@ -44,6 +45,7 @@ import com.glxp.api.service.inout.*; import com.glxp.api.service.inout.impl.IoOrderInvoiceService; import com.glxp.api.service.inout.impl.ReceiveDetailService; import com.glxp.api.service.inout.impl.ReceiveService; +import com.glxp.api.service.inv.impl.InvProductDetailService; import com.glxp.api.service.purchase.PurOrderService; import com.glxp.api.service.purchase.SupCertService; import com.glxp.api.service.purchase.SupProductService; @@ -53,6 +55,7 @@ import com.glxp.api.service.thrsys.ThrOrderDetailService; import com.glxp.api.service.thrsys.ThrOrderService; import com.glxp.api.service.thrsys.ThrSystemBusApiService; import com.glxp.api.util.GennerOrderUtils; +import com.glxp.api.util.IntUtil; import com.glxp.api.util.MsDateUtil; import com.glxp.api.util.OrderNoTypeBean; import org.springframework.validation.BindingResult; @@ -221,6 +224,8 @@ public class IoOrderDetailBizController extends BaseController { return ResultVOUtils.success(orderEntity); } + @Resource + InvProductDetailService invProductDetailService; //修改业务单据详情 @AuthRuleAnnotation("") @@ -231,6 +236,22 @@ public class IoOrderDetailBizController extends BaseController { if (isExit) { return ResultVOUtils.error(500, "存在相同产品,相同批次号,请检查后保存!"); } + + IoOrderEntity orderEntity = orderService.findByBillNo(orderDetailBizEntity.getOrderIdFk()); + BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); + if (bussinessTypeEntity.getCheckWebNew() == 4 && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { + Integer count = invProductDetailService.vailStockCount(orderDetailBizEntity.getBindRlFk(), orderDetailBizEntity.getBatchNo(), orderDetailBizEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), null); + + count = IntUtil.value(count)-orderDetailBizEntity.getCount(); + + if (count <= 0) { + if (count == -1) { + return ResultVOUtils.error(500, "该产品未入库"); + } else + return ResultVOUtils.error(500, "当前库存不足"); + } + } + return orderDetailBizService.update(orderDetailBizEntity) > 0 ? ResultVOUtils.success("保存成功!") : ResultVOUtils.error(500, "保存失败"); } diff --git a/src/main/java/com/glxp/api/req/inout/FilterStatDataRequest.java b/src/main/java/com/glxp/api/req/inout/FilterStatDataRequest.java index 166ca303..bde2b534 100644 --- a/src/main/java/com/glxp/api/req/inout/FilterStatDataRequest.java +++ b/src/main/java/com/glxp/api/req/inout/FilterStatDataRequest.java @@ -31,4 +31,6 @@ public class FilterStatDataRequest extends ListPageRequest { */ private String endTime; + private String invCode; + } diff --git a/src/main/java/com/glxp/api/req/sync/BasicExportStatusRequest.java b/src/main/java/com/glxp/api/req/sync/BasicExportStatusRequest.java index 3d8b8467..7bb2cf7a 100644 --- a/src/main/java/com/glxp/api/req/sync/BasicExportStatusRequest.java +++ b/src/main/java/com/glxp/api/req/sync/BasicExportStatusRequest.java @@ -12,4 +12,5 @@ public class BasicExportStatusRequest extends ListPageRequest { private Integer scheduleType; public Integer createType; private String syncTime; + private String today; } diff --git a/src/main/java/com/glxp/api/res/inout/IoStatOrderResponse.java b/src/main/java/com/glxp/api/res/inout/IoStatOrderResponse.java new file mode 100644 index 00000000..9824ebfa --- /dev/null +++ b/src/main/java/com/glxp/api/res/inout/IoStatOrderResponse.java @@ -0,0 +1,65 @@ +package com.glxp.api.res.inout; + +import lombok.Data; + +import java.util.Date; + +@Data +public class IoStatOrderResponse { + + private Integer id; + + /** + * 记录号 + */ + private String recordKey; + + /** + * 生成时间 + */ + private Date date; + + /** + * 1:年;2.季度;3:月; 4:日; + */ + private Integer type; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 表格表头 + */ + private String title; + + /** + * 备注 + */ + private String remark; + + + /** + * 仓库编码 + */ + private String deptCode; + + /** + * 仓库编码 + */ + private String invCode; + + + /** + * 仓库编码 + */ + private String deptName; + + /** + * 仓库编码 + */ + private String invName; + + +} diff --git a/src/main/java/com/glxp/api/res/inv/InvPreProductResponse.java b/src/main/java/com/glxp/api/res/inv/InvPreProductResponse.java index f9cb91e5..72d246f7 100644 --- a/src/main/java/com/glxp/api/res/inv/InvPreProductResponse.java +++ b/src/main/java/com/glxp/api/res/inv/InvPreProductResponse.java @@ -2,6 +2,8 @@ package com.glxp.api.res.inv; import lombok.Data; +import java.math.BigDecimal; + /** * 寄售库存VO */ @@ -106,5 +108,5 @@ public class InvPreProductResponse { private String invCode; private String measname; - + private BigDecimal price; } diff --git a/src/main/java/com/glxp/api/res/inv/InvPreinProductResponse.java b/src/main/java/com/glxp/api/res/inv/InvPreinProductResponse.java index 42afb616..e55648f6 100644 --- a/src/main/java/com/glxp/api/res/inv/InvPreinProductResponse.java +++ b/src/main/java/com/glxp/api/res/inv/InvPreinProductResponse.java @@ -2,6 +2,8 @@ package com.glxp.api.res.inv; import lombok.Data; +import java.math.BigDecimal; + /** * 预验收库存VO */ @@ -31,8 +33,8 @@ public class InvPreinProductResponse { private String ggxh; /* - * 计量单位 - * */ + * 计量单位 + * */ private String measname; /** @@ -112,5 +114,5 @@ public class InvPreinProductResponse { // 货位名称 private String spaceName; - + private BigDecimal price; } diff --git a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java index 118874d1..7fc19e08 100644 --- a/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoAddInoutService.java @@ -246,7 +246,7 @@ public class IoAddInoutService { //新增业务单据处理 - public void dealBusProcess(IoOrderEntity orderEntity, BasicBussinessTypeEntity bussinessTypeEntity) { + public BaseResponse dealBusProcess(IoOrderEntity orderEntity, BasicBussinessTypeEntity bussinessTypeEntity) { orderEntity.setErrMsg("正在处理!"); orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESSING); @@ -261,7 +261,7 @@ public class IoAddInoutService { orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); orderEntity.setUpdateTime(new Date()); orderService.update(orderEntity); - return; + return ResultVOUtils.error(500, "单据重复上传"); } @@ -270,7 +270,7 @@ public class IoAddInoutService { orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); orderEntity.setUpdateTime(new Date()); orderService.update(orderEntity); - return; + return ResultVOUtils.error(500, "未选择往来单位"); } if (StrUtil.isEmpty(orderEntity.getInvCode())) { @@ -278,7 +278,7 @@ public class IoAddInoutService { orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); orderEntity.setUpdateTime(new Date()); orderService.update(orderEntity); - return; + return ResultVOUtils.error(500, "未选择当前仓库信息"); } @@ -300,7 +300,7 @@ public class IoAddInoutService { orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); orderEntity.setUpdateTime(new Date()); orderService.update(orderEntity); - return; + return ResultVOUtils.error(500, "errMsg"); } orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK); orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST); @@ -309,15 +309,14 @@ public class IoAddInoutService { //业务单直接生成扫码单 if (bussinessTypeEntity.getCheckWebNew() == 4) { boolean exit = codeTempService.isExit(orderEntity.getBillNo()); - if (!exit) + if (!exit) { stockGenScan(orderEntity); + } } - - - return; - + return ResultVOUtils.success(); } + /** * 业务单生成扫码单 */ @@ -328,8 +327,10 @@ public class IoAddInoutService { for (IoOrderDetailBizEntity bizEntity : bizEntities) { IoCodeTempEntity codeTempEntity = new IoCodeTempEntity(); - String udiCode = "#" + bizEntity.getNameCode() + "#" + bizEntity.getProductDate() + "#" + bizEntity.getExpireDate() + - "#" + bizEntity.getBatchNo() + "#" + "#" + "#"; + String udiCode = "#" + bizEntity.getNameCode() + + "#" + StrUtil.trimToEmpty(bizEntity.getProductDate()) + + "#" + StrUtil.trimToEmpty(bizEntity.getExpireDate()) + + "#" + StrUtil.trimToEmpty(bizEntity.getBatchNo()) + "#" + "#" + "#"; codeTempEntity.setCode(udiCode); codeTempEntity.setMainAction(orderEntity.getMainAction()); codeTempEntity.setAction(orderEntity.getAction()); diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoStatDayServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoStatDayServiceImpl.java index 0262c0de..5d80042c 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoStatDayServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoStatDayServiceImpl.java @@ -70,15 +70,15 @@ public class IoStatDayServiceImpl implements IoStatDayService { IoStatDayEntity statData = getStatData(dataList, orderDetailResultEntity, yesterday); //查询此单是出库还是入库 - IoOrderEntity order = orderDao.selectOne(new QueryWrapper().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode())); - if (order.getMainAction().equals(ConstantType.TYPE_PUT)) { +// IoOrderEntity order = orderDao.selectOne(new QueryWrapper().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode())); + if (orderDetailResultEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { //入库 statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount()); if (null != orderDetailResultEntity.getPrice()) { BigDecimal inAmount = orderDetailResultEntity.getPrice().multiply(BigDecimal.valueOf(orderDetailResultEntity.getReCount())); statData.setInAmount(inAmount.add(statData.getInAmount())); } - } else if (order.getMainAction().equals(ConstantType.TYPE_OUT)) { + } else if (orderDetailResultEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { //出库 statData.setOutCount(orderDetailResultEntity.getReCount() + statData.getOutCount()); if (null != orderDetailResultEntity.getPrice()) { @@ -141,7 +141,6 @@ public class IoStatDayServiceImpl implements IoStatDayService { } IoStatDayEntity statData = new IoStatDayEntity(); - statData.setDeptCode(orderDetailResultEntity.getDeptCode()); statData.setYear(yesterday.year()); statData.setQuarter(yesterday.quarter()); statData.setMonth(yesterday.monthBaseOne()); @@ -153,6 +152,8 @@ public class IoStatDayServiceImpl implements IoStatDayService { statData.setBatchNo(orderDetailResultEntity.getBatchNo()); //设置结余价格 statData.setBalancePrice(orderDetailResultEntity.getPrice()); + statData.setInvCode(orderDetailResultEntity.getInvCode()); + statData.setDeptCode(orderDetailResultEntity.getDeptCode()); //设置初始化出入库数量和价格 statData.setInCount(0); statData.setInPrice(null == orderDetailResultEntity.getPrice() ? BigDecimal.ZERO : orderDetailResultEntity.getPrice()); diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoStatMonthServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoStatMonthServiceImpl.java index bcd0ec1d..3edab997 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoStatMonthServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoStatMonthServiceImpl.java @@ -75,15 +75,15 @@ public class IoStatMonthServiceImpl implements IoStatMonthService { IoStatMonthEntity statData = getStatData(dataList, orderDetailResultEntity, lastMonth); //查询此单是出库还是入库 - IoOrderEntity order = orderDao.selectOne(new QueryWrapper().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode())); - if (order.getMainAction().equals(ConstantType.TYPE_PUT)) { +// IoOrderEntity order = orderDao.selectOne(new QueryWrapper().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode())); + if (orderDetailResultEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { //入库 statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount()); if (null != orderDetailResultEntity.getPrice()) { BigDecimal inAmount = orderDetailResultEntity.getPrice().multiply(BigDecimal.valueOf(orderDetailResultEntity.getReCount())); statData.setInAmount(inAmount.add(statData.getInAmount())); } - } else if (order.getMainAction().equals(ConstantType.TYPE_OUT)) { + } else if (orderDetailResultEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { //出库 statData.setOutCount(orderDetailResultEntity.getReCount() + statData.getOutCount()); if (null != orderDetailResultEntity.getPrice()) { diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoStatQuarterServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoStatQuarterServiceImpl.java index d216023e..21b7b6d6 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoStatQuarterServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoStatQuarterServiceImpl.java @@ -74,15 +74,15 @@ public class IoStatQuarterServiceImpl implements IoStatQuarterService { IoStatQuarterEntity statData = getStatData(dataList, orderDetailResultEntity, yesterday); //查询此单是出库还是入库 - IoOrderEntity order = orderDao.selectOne(new QueryWrapper().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode())); - if (order.getMainAction().equals(ConstantType.TYPE_PUT)) { +// IoOrderEntity order = orderDao.selectOne(new QueryWrapper().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode())); + if (orderDetailResultEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { //入库 statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount()); if (null != orderDetailResultEntity.getPrice()) { BigDecimal inAmount = orderDetailResultEntity.getPrice().multiply(BigDecimal.valueOf(orderDetailResultEntity.getReCount())); statData.setInAmount(inAmount.add(statData.getInAmount())); } - } else if (order.getMainAction().equals(ConstantType.TYPE_OUT)) { + } else if (orderDetailResultEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { //出库 statData.setOutCount(orderDetailResultEntity.getReCount() + statData.getOutCount()); if (null != orderDetailResultEntity.getPrice()) { diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoStatYearServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoStatYearServiceImpl.java index ce19ca4c..9de2b936 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoStatYearServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoStatYearServiceImpl.java @@ -69,15 +69,15 @@ public class IoStatYearServiceImpl implements IoStatYearService { IoStatYearEntity statData = getStatData(dataList, orderDetailResultEntity, yesterday); //查询此单是出库还是入库 - IoOrderEntity order = orderDao.selectOne(new QueryWrapper().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode())); - if (order.getMainAction().equals(ConstantType.TYPE_PUT)) { +// IoOrderEntity order = orderDao.selectOne(new QueryWrapper().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode())); + if (orderDetailResultEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { //入库 statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount()); if (null != orderDetailResultEntity.getPrice()) { BigDecimal inAmount = orderDetailResultEntity.getPrice().multiply(BigDecimal.valueOf(orderDetailResultEntity.getReCount())); statData.setInAmount(inAmount.add(statData.getInAmount())); } - } else if (order.getMainAction().equals(ConstantType.TYPE_OUT)) { + } else if (orderDetailResultEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { //出库 statData.setOutCount(orderDetailResultEntity.getReCount() + statData.getOutCount()); if (null != orderDetailResultEntity.getPrice()) { diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderDetailResultDao.xml b/src/main/resources/mybatis/mapper/inout/IoOrderDetailResultDao.xml index 6048bc77..5b86ba39 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderDetailResultDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderDetailResultDao.xml @@ -102,9 +102,11 @@ price, reCount, io_order.deptCode, - io_order.invCode + io_order.invCode, + bbt.mainAction from io_order_detail_result left JOIN io_order on io_order.billNo = io_order_detail_result.orderIdFk + left join basic_bussiness_type bbt on io_order.action = bbt.action and io_order_detail_result.orderIdFk in @@ -114,6 +116,7 @@ + group by io_order_detail_result.id diff --git a/src/main/resources/mybatis/mapper/inout/IoStatOrderDao.xml b/src/main/resources/mybatis/mapper/inout/IoStatOrderDao.xml index fb79410a..1ccc0085 100644 --- a/src/main/resources/mybatis/mapper/inout/IoStatOrderDao.xml +++ b/src/main/resources/mybatis/mapper/inout/IoStatOrderDao.xml @@ -1,13 +1,18 @@ - + select io_stat_order.*, ad.name deptName, aw.name invName from io_stat_order + left join auth_dept ad on io_stat_order.deptCode = ad.code + left join auth_warehouse aw on io_stat_order.invCode = aw.code and type = #{type} + + and invCode = #{invCode} + and recordKey like concat('%', #{recordKey}, '%') diff --git a/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml index 76e3e484..65f5a06e 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreProductDao.xml @@ -22,7 +22,8 @@ auth_warehouse.name invName, ipp.deptCode, ipp.invCode, - bp.measname + bp.measname, + ipp.price from inv_pre_product ipp inner join basic_udirel on ipp.relIdFk = basic_udirel.id inner join basic_products bp on basic_udirel.uuid = bp.uuid @@ -82,35 +83,35 @@ select ipp.id, - ipp.nameCode, - bp.cpmctymc, - ipp.relIdFk, - bp.ggxh, - bp.measname, - ipp.batchNo, - ipp.productionDate, - ipp.expireDate, - bp.ylqxzcrbarmc, - bp.zczbhhzbapzbh, - ipp.inCount, - ipp.outCount, - ipp.reCount, - ipp.customerId, - basic_corp.name supName, - ipp.supId, - auth_dept.name deptName, - auth_warehouse.name invName, - ipp.deptCode, - ipp.invCode + ipp.nameCode, + bp.cpmctymc, + ipp.relIdFk, + bp.ggxh, + bp.measname, + ipp.batchNo, + ipp.productionDate, + ipp.expireDate, + bp.ylqxzcrbarmc, + bp.zczbhhzbapzbh, + ipp.inCount, + ipp.outCount, + ipp.reCount, + ipp.customerId, + basic_corp.name supName, + ipp.supId, + auth_dept.name deptName, + auth_warehouse.name invName, + ipp.deptCode, + ipp.invCode from inv_prein_product ipp - inner join basic_udirel on ipp.relIdFk = basic_udirel.id - inner join basic_products bp on basic_udirel.uuid = bp.uuid - left join basic_corp on ipp.supId = basic_corp.erpId - left join auth_dept on auth_dept.code = ipp.deptCode - left join auth_warehouse on auth_warehouse.code = ipp.invCode + inner join basic_udirel on ipp.relIdFk = basic_udirel.id + inner join basic_products bp on basic_udirel.uuid = bp.uuid + left join basic_corp on ipp.supId = basic_corp.erpId + left join auth_dept on auth_dept.code = ipp.deptCode + left join auth_warehouse on auth_warehouse.code = ipp.invCode ipp.reCount > 0 @@ -217,35 +218,34 @@