汇总代码提交

pro
郑明梁 2 years ago
parent 269ddea831
commit 847de9c01b

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import javax.validation.Valid;
import java.math.BigDecimal; import java.math.BigDecimal;
@Data @Data
@ -182,4 +183,7 @@ public class IoOrderDetailResultEntity {
@TableField(value = "remark5") @TableField(value = "remark5")
private String remark5; private String remark5;
@TableField(exist = false)
private String deptCode;
} }

@ -163,4 +163,10 @@ public class IoStatDayEntity {
@TableField(value = "updateTime") @TableField(value = "updateTime")
private Date updateTime; private Date updateTime;
@TableField(value = "deptCode")
private String deptCode;
@TableField(exist = false)
private String deptName;
} }

@ -157,4 +157,9 @@ public class IoStatMonthEntity {
@TableField(value = "updateTime") @TableField(value = "updateTime")
private Date updateTime; private Date updateTime;
@TableField(value = "deptCode")
private String deptCode;
@TableField(exist = false)
private String deptName;
} }

@ -151,4 +151,7 @@ public class IoStatQuarterEntity {
@TableField(value = "updateTime") @TableField(value = "updateTime")
private Date updateTime; private Date updateTime;
@TableField(value = "deptCode")
private String deptCode;
} }

@ -145,4 +145,8 @@ public class IoStatYearEntity {
@TableField(value = "updateTime") @TableField(value = "updateTime")
private Date updateTime; private Date updateTime;
@TableField(value = "deptCode")
private String deptCode;
} }

@ -69,7 +69,7 @@ public class IoStatDayServiceImpl implements IoStatDayService {
IoStatDayEntity statData = getStatData(dataList, orderDetailResultEntity, yesterday); IoStatDayEntity statData = getStatData(dataList, orderDetailResultEntity, yesterday);
//查询此单是出库还是入库 //查询此单是出库还是入库
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk())); IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode",orderDetailResultEntity.getDeptCode()));
if (order.getMainAction().equals(ConstantType.TYPE_PUT)) { if (order.getMainAction().equals(ConstantType.TYPE_PUT)) {
//入库 //入库
statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount()); statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount());
@ -129,7 +129,7 @@ public class IoStatDayServiceImpl implements IoStatDayService {
private IoStatDayEntity getStatData(List<IoStatDayEntity> dataList, IoOrderDetailResultEntity orderDetailResultEntity, DateTime yesterday) { private IoStatDayEntity getStatData(List<IoStatDayEntity> dataList, IoOrderDetailResultEntity orderDetailResultEntity, DateTime yesterday) {
if (CollUtil.isNotEmpty(dataList)) { if (CollUtil.isNotEmpty(dataList)) {
for (IoStatDayEntity statDayEntity : dataList) { for (IoStatDayEntity statDayEntity : dataList) {
if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk())) { if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk()) && statDayEntity.getDeptCode().equals(orderDetailResultEntity.getDeptCode())) {
if ((StrUtil.isNotBlank(statDayEntity.getBatchNo()) && StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo())) && statDayEntity.getBatchNo().equals(orderDetailResultEntity.getBatchNo())) { if ((StrUtil.isNotBlank(statDayEntity.getBatchNo()) && StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo())) && statDayEntity.getBatchNo().equals(orderDetailResultEntity.getBatchNo())) {
return statDayEntity; return statDayEntity;
} else if (StrUtil.isBlank(statDayEntity.getBatchNo()) && StrUtil.isBlank(orderDetailResultEntity.getBatchNo())) { } else if (StrUtil.isBlank(statDayEntity.getBatchNo()) && StrUtil.isBlank(orderDetailResultEntity.getBatchNo())) {
@ -140,6 +140,7 @@ public class IoStatDayServiceImpl implements IoStatDayService {
} }
IoStatDayEntity statData = new IoStatDayEntity(); IoStatDayEntity statData = new IoStatDayEntity();
statData.setDeptCode(orderDetailResultEntity.getDeptCode());
statData.setYear(yesterday.year()); statData.setYear(yesterday.year());
statData.setQuarter(yesterday.quarter()); statData.setQuarter(yesterday.quarter());
statData.setMonth(yesterday.monthBaseOne()); statData.setMonth(yesterday.monthBaseOne());

@ -74,7 +74,7 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
IoStatMonthEntity statData = getStatData(dataList, orderDetailResultEntity, lastMonth); IoStatMonthEntity statData = getStatData(dataList, orderDetailResultEntity, lastMonth);
//查询此单是出库还是入库 //查询此单是出库还是入库
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk())); IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("mainAction").eq("billNo", orderDetailResultEntity.getOrderIdFk()).eq("deptCode",orderDetailResultEntity.getDeptCode()));
if (order.getMainAction().equals(ConstantType.TYPE_PUT)) { if (order.getMainAction().equals(ConstantType.TYPE_PUT)) {
//入库 //入库
statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount()); statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount());
@ -175,7 +175,7 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
if (CollUtil.isNotEmpty(dataList)) { if (CollUtil.isNotEmpty(dataList)) {
for (IoStatMonthEntity statDayEntity : dataList) { for (IoStatMonthEntity statDayEntity : dataList) {
if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk())) { if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk()) && statDayEntity.getDeptCode().equals(orderDetailResultEntity.getDeptCode())) {
if ((StrUtil.isNotBlank(statDayEntity.getBatchNo()) && StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo())) && statDayEntity.getBatchNo().equals(orderDetailResultEntity.getBatchNo())) { if ((StrUtil.isNotBlank(statDayEntity.getBatchNo()) && StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo())) && statDayEntity.getBatchNo().equals(orderDetailResultEntity.getBatchNo())) {
return statDayEntity; return statDayEntity;
} else if (StrUtil.isBlank(statDayEntity.getBatchNo()) && StrUtil.isBlank(orderDetailResultEntity.getBatchNo())) { } else if (StrUtil.isBlank(statDayEntity.getBatchNo()) && StrUtil.isBlank(orderDetailResultEntity.getBatchNo())) {
@ -187,6 +187,7 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
IoStatMonthEntity statData = new IoStatMonthEntity(); IoStatMonthEntity statData = new IoStatMonthEntity();
statData.setYear(lastMonth.year()); statData.setYear(lastMonth.year());
statData.setDeptCode(orderDetailResultEntity.getDeptCode());
statData.setQuarter(lastMonth.quarter()); statData.setQuarter(lastMonth.quarter());
statData.setMonth(lastMonth.monthBaseOne()); statData.setMonth(lastMonth.monthBaseOne());
statData.setRelIdFk(String.valueOf(orderDetailResultEntity.getBindRlFk())); statData.setRelIdFk(String.valueOf(orderDetailResultEntity.getBindRlFk()));
@ -268,7 +269,8 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
.filter(notComment -> { .filter(notComment -> {
List<IoStatMonthEntity> filtered = newIoStatDayEntity.stream().filter(all -> List<IoStatMonthEntity> filtered = newIoStatDayEntity.stream().filter(all ->
Objects.equals(all.getBatchNo(), notComment.getBatchNo()) // 使用 Objects.equals 来进行非空判断 Objects.equals(all.getBatchNo(), notComment.getBatchNo()) // 使用 Objects.equals 来进行非空判断
&& Objects.equals(all.getRelIdFk(), notComment.getRelIdFk())) && Objects.equals(all.getRelIdFk(), notComment.getRelIdFk())
&& Objects.equals(all.getDeptCode(), notComment.getDeptCode()))
.collect(Collectors.toList()); .collect(Collectors.toList());
return filtered.isEmpty(); return filtered.isEmpty();
}).collect(Collectors.toList()); }).collect(Collectors.toList());

@ -84,8 +84,10 @@
coName, coName,
spec, spec,
price, price,
reCount reCount,
io_order.deptCode
from io_order_detail_result from io_order_detail_result
left JOIN io_order on io_order.billNo=io_order_detail_result.orderIdFk
<where> <where>
<if test="list != null and list.size() > 0 "> <if test="list != null and list.size() > 0 ">
orderIdFk in orderIdFk in

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.IoStatDayDao"> <mapper namespace="com.glxp.api.dao.inout.IoStatDayDao">
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatDayEntity"> <select id="filterList" resultType="com.glxp.api.entity.inout.IoStatDayEntity">
select * select *, ( SELECT NAME FROM auth_dept WHERE io_stat_day.deptCode = auth_dept.CODE ) deptName
from io_stat_day from io_stat_day
<where> <where>
<if test="recordKey != null and recordKey != ''"> <if test="recordKey != null and recordKey != ''">

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.IoStatMonthDao"> <mapper namespace="com.glxp.api.dao.inout.IoStatMonthDao">
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatMonthEntity"> <select id="filterList" resultType="com.glxp.api.entity.inout.IoStatMonthEntity">
select * select *, ( SELECT NAME FROM auth_dept WHERE io_stat_month.deptCode = auth_dept.CODE ) deptName
from io_stat_month from io_stat_month
<where> <where>
<if test="recordKey != null and recordKey != ''"> <if test="recordKey != null and recordKey != ''">

Loading…
Cancel
Save