平潭普耗相关修改,汇总统计修改

test
anthonywj 1 year ago
parent 463ddaa3c3
commit fd31e5a224

@ -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<LocalDate> {
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;

@ -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<LocalDateTim
public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
String value = p.getText();
try {
return value == null ? null : LocalDateTimeUtil.parse(value, DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN));
return StrUtil.isEmpty(value) ? null : LocalDateTimeUtil.parse(value, DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN));
} catch (Exception e) {
log.error("日期格式解析错误", e);
return null;

@ -1,5 +1,6 @@
package com.glxp.api.config.serializer;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
@ -16,7 +17,7 @@ public class LongJsonDeserializer extends JsonDeserializer<Long> {
@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);
}
}

@ -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) {

@ -115,7 +115,7 @@ public class LoginController extends BaseController {
Map<String, Object> claims = new HashMap<>();
claims.put("admin_id", authAdmin.getId());
String token = JwtUtils.createToken(claims, 1800l); // 一天后过期
String token = JwtUtils.createToken(claims, 86400L); // 一天后过期
Map<String, Object> map = new HashMap<>();
map.put("id", authAdmin.getId());

@ -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')

@ -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;

@ -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, "保存失败");
}

@ -31,4 +31,6 @@ public class FilterStatDataRequest extends ListPageRequest {
*/
private String endTime;
private String invCode;
}

@ -12,4 +12,5 @@ public class BasicExportStatusRequest extends ListPageRequest {
private Integer scheduleType;
public Integer createType;
private String syncTime;
private String today;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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());

@ -70,15 +70,15 @@ public class IoStatDayServiceImpl implements IoStatDayService {
IoStatDayEntity statData = getStatData(dataList, orderDetailResultEntity, yesterday);
//查询此单是出库还是入库
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode()));
if (order.getMainAction().equals(ConstantType.TYPE_PUT)) {
// IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().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());

@ -75,15 +75,15 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
IoStatMonthEntity statData = getStatData(dataList, orderDetailResultEntity, lastMonth);
//查询此单是出库还是入库
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode()));
if (order.getMainAction().equals(ConstantType.TYPE_PUT)) {
// IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().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()) {

@ -74,15 +74,15 @@ public class IoStatQuarterServiceImpl implements IoStatQuarterService {
IoStatQuarterEntity statData = getStatData(dataList, orderDetailResultEntity, yesterday);
//查询此单是出库还是入库
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode()));
if (order.getMainAction().equals(ConstantType.TYPE_PUT)) {
// IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().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()) {

@ -69,15 +69,15 @@ public class IoStatYearServiceImpl implements IoStatYearService {
IoStatYearEntity statData = getStatData(dataList, orderDetailResultEntity, yesterday);
//查询此单是出库还是入库
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode", orderDetailResultEntity.getDeptCode()));
if (order.getMainAction().equals(ConstantType.TYPE_PUT)) {
// IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().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()) {

@ -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
<where>
<if test="list != null and list.size() > 0">
and io_order_detail_result.orderIdFk in
@ -114,6 +116,7 @@
</foreach>
</if>
</where>
group by io_order_detail_result.id
</select>

@ -1,13 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.inout.IoStatOrderDao">
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatOrderEntity">
select *
<select id="filterList" resultType="com.glxp.api.res.inout.IoStatOrderResponse">
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
<where>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="invCode != null and invCode != ''">
and invCode = #{invCode}
</if>
<if test="recordKey != null and recordKey != ''">
and recordKey like concat('%', #{recordKey}, '%')
</if>

@ -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 id="filterListStock" resultType="com.glxp.api.res.inv.InvPreProductResponse">
select ipp.id,
ipp.nameCode,
bp.cpmctymc,
ipp.relIdFk,
bp.ggxh,
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,
bp.measname
ipp.nameCode,
bp.cpmctymc,
ipp.relIdFk,
bp.ggxh,
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,
bp.measname
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
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
<where>
bp.diType = 1
and ipp.reCount > 0
and ipp.reCount > 0
<if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
</if>
@ -219,34 +220,33 @@
</select>
<select id="findGroupBySpace" resultType="com.glxp.api.res.inv.InvPreProductResponse">
select
ipp.id,
ipp.nameCode,
bp.cpmctymc,
ipp.relId,
bp.ggxh,
ipp.batchNo,
ipp.produceDate,
ipp.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
sum(ipp.inCount) as inCount,
sum(ipp.outCount) as outCount,
sum(ipp.reCount) as reCount,
basic_corp.name supName,
ipp.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
asp.name spaceName,
ipp.deptCode,
ipp.invCode
select ipp.id,
ipp.nameCode,
bp.cpmctymc,
ipp.relId,
bp.ggxh,
ipp.batchNo,
ipp.produceDate,
ipp.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
sum(ipp.inCount) as inCount,
sum(ipp.outCount) as outCount,
sum(ipp.reCount) as reCount,
basic_corp.name supName,
ipp.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
asp.name spaceName,
ipp.deptCode,
ipp.invCode
from inv_pre_product_detail ipp
inner join basic_udirel on ipp.relId = 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
left join auth_space `asp` on ipp.invSpaceCode = `asp`.code
inner join basic_udirel on ipp.relId = 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
left join auth_space `asp` on ipp.invSpaceCode = `asp`.code
<where>
<if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')

@ -22,7 +22,8 @@
auth_dept.name deptName,
auth_warehouse.name invName,
ipp.deptCode,
ipp.invCode
ipp.invCode,
ipp.price
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
@ -81,32 +82,32 @@
<select id="filterListStock" resultType="com.glxp.api.res.inv.InvPreinProductResponse">
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
<where>
ipp.reCount > 0
<if test="cpmctymc != null and cpmctymc != ''">
@ -217,35 +218,34 @@
</select>
<select id="findGroupBySpace" resultType="com.glxp.api.res.inv.InvPreinProductResponse">
select
ipp.id,
ipp.nameCode,
bp.cpmctymc,
ipp.relId,
bp.ggxh,
ipp.batchNo,
ipp.produceDate,
ipp.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
sum(ipp.inCount) as inCount,
sum(ipp.outCount) as outCount,
sum(ipp.reCount) as reCount,
basic_corp.name supName,
ipp.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
asp.name spaceName,
ipp.deptCode,
ipp.invCode,
basic_udirel.id relIdFk
select ipp.id,
ipp.nameCode,
bp.cpmctymc,
ipp.relId,
bp.ggxh,
ipp.batchNo,
ipp.produceDate,
ipp.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
sum(ipp.inCount) as inCount,
sum(ipp.outCount) as outCount,
sum(ipp.reCount) as reCount,
basic_corp.name supName,
ipp.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
asp.name spaceName,
ipp.deptCode,
ipp.invCode,
basic_udirel.id relIdFk
from inv_prein_product_detail ipp
inner join basic_udirel on ipp.relId = 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
left join auth_space `asp` on ipp.invSpaceCode = `asp`.code
inner join basic_udirel on ipp.relId = 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
left join auth_space `asp` on ipp.invSpaceCode = `asp`.code
<where>
<if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')

@ -997,7 +997,7 @@ CALL Pro_Temp_ColumnWork('inv_count_codes', 'expireDate', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('inv_count_codes', 'serialNo', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('inv_count_order', 'codeCount', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_stat_order', 'deptCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_stat_order', 'invCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_stat_day', 'invCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_stat_month', 'invCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_stat_quarter', 'invCode', 'varchar(255)', 1);

Loading…
Cancel
Save