每日汇总统计等

test
anthonywj 2 years ago
parent 4d307a42a3
commit 32bd31903d

@ -23,9 +23,10 @@ public class TestController {
@GetMapping("/test/stat/order")
public BaseResponse getStatus(BasicExportStatusRequest basicExportStatusRequest) {
public BaseResponse getStatus(BasicExportStatusRequest basicExportStatusRequest) throws Exception {
long start = System.currentTimeMillis();
statOrderService.starGen(start);
statOrderService.starGen(MsDateUtil.timeToStamp(basicExportStatusRequest.getToday()));
long end = System.currentTimeMillis();
return ResultVOUtils.success("生成成功!" + start + "=====" + end + "\n-------" + (start - end));
}

@ -69,8 +69,6 @@ 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 (orderDetailResultEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
//入库
statData.setInCount(orderDetailResultEntity.getReCount() + statData.getInCount());
@ -130,7 +128,7 @@ public class IoStatDayServiceImpl implements IoStatDayService {
private IoStatDayEntity getStatData(List<IoStatDayEntity> dataList, IoOrderDetailStatRsponse orderDetailResultEntity, DateTime yesterday) {
if (CollUtil.isNotEmpty(dataList)) {
for (IoStatDayEntity statDayEntity : dataList) {
if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk()) && statDayEntity.getDeptCode().equals(orderDetailResultEntity.getDeptCode())) {
if (statDayEntity.getRelIdFk().equals(orderDetailResultEntity.getBindRlFk()) && statDayEntity.getInvCode().equals(orderDetailResultEntity.getInvCode())) {
if ((StrUtil.isNotBlank(statDayEntity.getBatchNo()) && StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo())) && statDayEntity.getBatchNo().equals(orderDetailResultEntity.getBatchNo())) {
return statDayEntity;
} else if (StrUtil.isBlank(statDayEntity.getBatchNo()) && StrUtil.isBlank(orderDetailResultEntity.getBatchNo())) {
@ -246,7 +244,8 @@ public class IoStatDayServiceImpl implements IoStatDayService {
.eq("relIdFk", orderDetailResultEntity.getBindRlFk())
.eq(StrUtil.isNotBlank(orderDetailResultEntity.getDeptCode()), "deptCode", orderDetailResultEntity.getDeptCode())
.eq(StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo()), "batchNo", orderDetailResultEntity.getBatchNo())
.eq(StrUtil.isNotBlank(orderDetailResultEntity.getNameCode()), "nameCode", orderDetailResultEntity.getNameCode());
.eq(StrUtil.isNotBlank(orderDetailResultEntity.getNameCode()), "nameCode", orderDetailResultEntity.getNameCode())
.eq(StrUtil.isNotBlank(orderDetailResultEntity.getNameCode()), "invCode", orderDetailResultEntity.getInvCode());
return wrapper;
}
@ -257,7 +256,8 @@ public class IoStatDayServiceImpl implements IoStatDayService {
.filter(notComment -> {
List<IoStatDayEntity> filtered = newIoStatDayEntity.stream().filter(all ->
Objects.equals(all.getBatchNo(), notComment.getBatchNo()) // 使用 Objects.equals 来进行非空判断
&& Objects.equals(all.getRelIdFk(), notComment.getRelIdFk()))
&& Objects.equals(all.getRelIdFk(), notComment.getRelIdFk())
&& Objects.equals(all.getInvCode(), notComment.getInvCode()))
.collect(Collectors.toList());
return filtered.isEmpty();
}).collect(Collectors.toList());

@ -148,6 +148,7 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
statOrderEntity.setType(3);
statOrderEntity.setTitle(lastMonth.year() + " 年 " + lastMonth.monthBaseOne() + " 月出入库汇总");
DateUtil.offsetMonth(lastMonth, +1);
statOrderEntity.setInvCode(key);
statOrderEntity.setDate(lastMonth);
Date updateTime = new Date();
@ -185,7 +186,7 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
if (CollUtil.isNotEmpty(dataList)) {
for (IoStatMonthEntity statDayEntity : dataList) {
if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk()) && statDayEntity.getDeptCode().equals(orderDetailResultEntity.getDeptCode())) {
if (statDayEntity.getRelIdFk().equals(orderDetailResultEntity.getBindRlFk()) && statDayEntity.getInvCode().equals(orderDetailResultEntity.getInvCode())) {
if ((StrUtil.isNotBlank(statDayEntity.getBatchNo()) && StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo())) && statDayEntity.getBatchNo().equals(orderDetailResultEntity.getBatchNo())) {
return statDayEntity;
} else if (StrUtil.isBlank(statDayEntity.getBatchNo()) && StrUtil.isBlank(orderDetailResultEntity.getBatchNo())) {
@ -265,7 +266,8 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
wrapper.eq("relIdFk", ioOrderDetailResultEntity.getBindRlFk());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getDeptCode()), "deptCode", ioOrderDetailResultEntity.getDeptCode());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getBatchNo()), "batchNo", ioOrderDetailResultEntity.getBatchNo());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getNameCode()), "nameCode", ioOrderDetailResultEntity.getNameCode());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getNameCode()), "nameCode", ioOrderDetailResultEntity.getNameCode())
.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getNameCode()), "invCode", ioOrderDetailResultEntity.getInvCode());
return wrapper;
}
@ -282,7 +284,7 @@ public class IoStatMonthServiceImpl implements IoStatMonthService {
List<IoStatMonthEntity> filtered = newIoStatDayEntity.stream().filter(all ->
Objects.equals(all.getBatchNo(), notComment.getBatchNo()) // 使用 Objects.equals 来进行非空判断
&& Objects.equals(all.getRelIdFk(), notComment.getRelIdFk())
&& Objects.equals(all.getDeptCode(), notComment.getDeptCode()))
&& Objects.equals(all.getInvCode(), notComment.getInvCode()))
.collect(Collectors.toList());
return filtered.isEmpty();
}).collect(Collectors.toList());

@ -113,8 +113,10 @@ public class IoStatQuarterServiceImpl implements IoStatQuarterService {
if (null == statDataDetailRequest) {
return Collections.emptyList();
}
if (null == statDataDetailRequest.getPage() && null == statDataDetailRequest.getLimit()) {
PageHelper.offsetPage((statDataDetailRequest.getPage() - 1) * statDataDetailRequest.getLimit(), statDataDetailRequest.getLimit());
if (statDataDetailRequest.getPage() != null) {
int offset = (statDataDetailRequest.getPage() - 1) * statDataDetailRequest.getLimit();
PageHelper.offsetPage(offset, statDataDetailRequest.getLimit());
}
return statQuarterDao.filterList(statDataDetailRequest);
}
@ -147,7 +149,7 @@ public class IoStatQuarterServiceImpl implements IoStatQuarterService {
DateTime dateTime = DateUtil.offsetDay(yesterday, +1);
statOrderEntity.setDate(dateTime);
statOrderEntity.setTitle(yesterday.year() + " 年 " + yesterday.quarter() + " 季度出入库汇总");
statOrderEntity.setInvCode(key);
Date updateTime = new Date();
statOrderEntity.setUpdateTime(updateTime);
@ -184,8 +186,10 @@ public class IoStatQuarterServiceImpl implements IoStatQuarterService {
if (CollUtil.isNotEmpty(dataList)) {
for (IoStatQuarterEntity statDayEntity : dataList) {
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 (statDayEntity.getRelIdFk().equals(orderDetailResultEntity.getBindRlFk())
&& statDayEntity.getInvCode().equals(orderDetailResultEntity.getInvCode())) {
if ((StrUtil.isNotBlank(statDayEntity.getBatchNo()) && StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo()))
&& statDayEntity.getBatchNo().equals(orderDetailResultEntity.getBatchNo())) {
return statDayEntity;
} else if (StrUtil.isBlank(statDayEntity.getBatchNo()) && StrUtil.isBlank(orderDetailResultEntity.getBatchNo())) {
return statDayEntity;
@ -262,6 +266,7 @@ public class IoStatQuarterServiceImpl implements IoStatQuarterService {
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getDeptCode()), "deptCode", ioOrderDetailResultEntity.getDeptCode());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getBatchNo()), "batchNo", ioOrderDetailResultEntity.getBatchNo());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getNameCode()), "nameCode", ioOrderDetailResultEntity.getNameCode());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getNameCode()), "invCode", ioOrderDetailResultEntity.getInvCode());
return wrapper;
}
@ -329,7 +334,8 @@ public class IoStatQuarterServiceImpl implements IoStatQuarterService {
List<IoStatQuarterEntity> filtered = newIoStatDayEntity.stream().filter(all ->
Objects.equals(all.getBatchNo(), notComment.getBatchNo()) // 使用 Objects.equals 来进行非空判断
&& Objects.equals(all.getRelIdFk(), notComment.getRelIdFk())
&& Objects.equals(all.getDeptCode(), notComment.getDeptCode()))
&& Objects.equals(all.getDeptCode(), notComment.getDeptCode())
&& Objects.equals(all.getInvCode(), notComment.getInvCode()))
.collect(Collectors.toList());
return filtered.isEmpty();
}).collect(Collectors.toList());

@ -140,7 +140,7 @@ public class IoStatYearServiceImpl implements IoStatYearService {
DateTime dateTime = DateUtil.offsetDay(yesterday, +1);
statOrderEntity.setDate(dateTime);
statOrderEntity.setTitle(yesterday.year() + " 年度出入库汇总");
statOrderEntity.setInvCode(key);
Date updateTime = new Date();
statOrderEntity.setUpdateTime(updateTime);
@ -177,7 +177,7 @@ public class IoStatYearServiceImpl implements IoStatYearService {
if (CollUtil.isNotEmpty(dataList)) {
for (IoStatYearEntity statDayEntity : dataList) {
if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk()) && statDayEntity.getDeptCode().equals(orderDetailResultEntity.getDeptCode())) {
if (Long.valueOf(statDayEntity.getRelIdFk()).equals(orderDetailResultEntity.getBindRlFk()) && statDayEntity.getInvCode().equals(orderDetailResultEntity.getInvCode())) {
if ((StrUtil.isNotBlank(statDayEntity.getBatchNo()) && StrUtil.isNotBlank(orderDetailResultEntity.getBatchNo())) && statDayEntity.getBatchNo().equals(orderDetailResultEntity.getBatchNo())) {
return statDayEntity;
} else if (StrUtil.isBlank(statDayEntity.getBatchNo()) && StrUtil.isBlank(orderDetailResultEntity.getBatchNo())) {
@ -247,6 +247,7 @@ public class IoStatYearServiceImpl implements IoStatYearService {
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getDeptCode()), "deptCode", ioOrderDetailResultEntity.getDeptCode());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getBatchNo()), "batchNo", ioOrderDetailResultEntity.getBatchNo());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getNameCode()), "nameCode", ioOrderDetailResultEntity.getNameCode());
wrapper.eq(StrUtil.isNotBlank(ioOrderDetailResultEntity.getNameCode()), "invCode", ioOrderDetailResultEntity.getInvCode());
return wrapper;
}
@ -276,7 +277,8 @@ public class IoStatYearServiceImpl implements IoStatYearService {
List<IoStatYearEntity> filtered = newIoStatDayEntity.stream().filter(all ->
Objects.equals(all.getBatchNo(), notComment.getBatchNo()) // 使用 Objects.equals 来进行非空判断
&& Objects.equals(all.getRelIdFk(), notComment.getRelIdFk())
&& Objects.equals(all.getDeptCode(), notComment.getDeptCode()))
&& Objects.equals(all.getDeptCode(), notComment.getDeptCode())
&& Objects.equals(all.getInvCode(), notComment.getInvCode()))
.collect(Collectors.toList());
return filtered.isEmpty();
}).collect(Collectors.toList());

@ -2,7 +2,7 @@
<!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.IoStatQuarterDao">
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatQuarterEntity">
select *, ( SELECT NAME FROM auth_dept WHERE io_stat_quarter.deptCode = auth_dept.CODE ) deptName
select *, (SELECT NAME FROM auth_dept WHERE io_stat_quarter.deptCode = auth_dept.CODE) deptName
from io_stat_quarter
<where>
<if test="recordKey != null and recordKey != ''">
@ -21,7 +21,7 @@
</select>
<select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatQuarterEntity">
select *, ( SELECT NAME FROM auth_dept WHERE io_stat_quarter.deptCode = auth_dept.CODE ) deptName
select *, (SELECT NAME FROM auth_dept WHERE io_stat_quarter.deptCode = auth_dept.CODE) deptName
from io_stat_quarter
where recordKeyFk = #{recordKey}
</select>

@ -997,7 +997,7 @@ CALL Pro_Temp_ColumnWork('inv_count_codes', 'produceDate', 'varchar(255)', 1);
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);

@ -83,3 +83,9 @@ VALUES (1, 'udi_wms_new', '3.0.6', 306, 'UDI扫码终端', '2023-10-30 18:42:24'
CALL Pro_Temp_ColumnWork('basic_product_category', 'deptCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_product_category', 'invCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'inPreInBack', 'tinyint', 1);
INSERT ignore INTO sys_param_config(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`,
`paramType`, `paramExplain`, `updateTime`)
VALUES (20088, 0, '单据详情展示方式', 'order_detail_visible', '1', 0, 0, '1:按DI统一排序2按扫码或录入时间排序', NULL);

Loading…
Cancel
Save