Merge remote-tracking branch 'origin/dev_2.5_mutiscan' into dev_2.5_mutiscan

dev_2.5_mutiscan
yewj 3 months ago
commit b065f502b2

@ -2,6 +2,7 @@ package com.glxp.api.controller.collect;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
@ -232,4 +233,16 @@ public class IoCollectOrderBackupController extends BaseController {
} }
@PostMapping("/udiwms/basic/collect/orderFinish/orderStats")
public BaseResponse orderStats(@RequestBody CollectOrderRequest collectOrderRequest) {
List<Long> workPlaceCodes = null;
List<UserWorkResponse> page;
// 上传医保不做登录权限限制
log.error("collectOrderRequest"+collectOrderRequest);
Page<IoCollectOrderResponse> orderResponses = ioCollectOrderBackupService.filterorderStatsList(collectOrderRequest);
return ResultVOUtils.success(orderResponses);
}
} }

@ -20,4 +20,5 @@ public interface IoCollectOrderBackupMapper extends BaseMapperPlus<IoCollectOrde
List<IoCollectOrderResponse> getList(CollectOrderUploadCountRequest collectOrderUploadCountRequest); List<IoCollectOrderResponse> getList(CollectOrderUploadCountRequest collectOrderUploadCountRequest);
List<IoCollectOrderResponse> filterorderStatsList(CollectOrderRequest collectOrderRequest);
} }

@ -228,5 +228,14 @@ public class SysWorkplaceDocumentEntity {
@TableField(value = "productType") @TableField(value = "productType")
private Integer productType; private Integer productType;
/**
* 0 1
*/
@TableField(value = "coercionSubmit")
private Integer coercionSubmit;
} }

@ -228,5 +228,10 @@ public class IoCollectOrderBizBackup implements Serializable {
*/ */
@TableField(value = "checkCode") @TableField(value = "checkCode")
private String checkCode; private String checkCode;
@TableField(exist = false)
private Integer setShouldCount;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

@ -177,6 +177,18 @@ public class CollectOrderRequest extends ListPageRequest {
private Integer returnStatus; private Integer returnStatus;
private Integer storard;
private String orderStartTime;
private String orderEndTime;
private Integer isMatching;
private Integer inAndOutType;
} }

@ -177,5 +177,10 @@ public class SysWorkplaceDocumentResponse {
private Integer productType; private Integer productType;
/**
* 0 1
*/
@TableField(value = "coercionSubmit")
private Integer coercionSubmit;
} }

@ -194,6 +194,28 @@ public class IoCollectOrderResponse {
*/ */
private Integer orderUpStatus; private Integer orderUpStatus;
/**
*
*/
private Integer scanCount;
private Integer shouldCount;
private String scanRate;
/**
*
* 1
* 2
*/
private Integer storard;
/** /**
* *

@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
@ -15,6 +16,7 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant; import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.dao.auth.InvWarehouseDao; import com.glxp.api.dao.auth.InvWarehouseDao;
import com.glxp.api.dao.basic.BasicProductsDao;
import com.glxp.api.dao.basic.SysWorkplaceBusMapper; import com.glxp.api.dao.basic.SysWorkplaceBusMapper;
import com.glxp.api.dao.collect.IoCollectCodeBackMapper; import com.glxp.api.dao.collect.IoCollectCodeBackMapper;
import com.glxp.api.dao.collect.IoCollectCodeMapper; import com.glxp.api.dao.collect.IoCollectCodeMapper;
@ -23,10 +25,7 @@ import com.glxp.api.dao.inout.IoCodeTempDao;
import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.InvWarehouseEntity; import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.auth.SysWorkplace; import com.glxp.api.entity.auth.SysWorkplace;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.basic.*;
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
import com.glxp.api.entity.basic.SysWorkplaceBus;
import com.glxp.api.entity.basic.SysWorkplaceDocumentEntity;
import com.glxp.api.entity.collect.*; import com.glxp.api.entity.collect.*;
import com.glxp.api.entity.inout.IoCodeTempEntity; import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inout.IoOrderEntity;
@ -61,6 +60,8 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -785,4 +786,130 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
collectOrderUploadCountResponse.setFifoSplitTwoCount(fifoSplitTwoCount); collectOrderUploadCountResponse.setFifoSplitTwoCount(fifoSplitTwoCount);
} }
@Resource
private BasicProductsDao basicProductsDao;
public Page<IoCollectOrderResponse> filterorderStatsList(CollectOrderRequest collectOrderRequest) {
List<IoCollectOrderResponse> data = ioCollectOrderBackupMapper.filterorderStatsList(collectOrderRequest);
// for (IoCollectOrderResponse ioCollectOrderResponse : data){
// Integer newScanCount = 0;
// Integer shouldCount = 0;
// List<IoCollectOrderBizBackup> orderBizBackups = ioCollectOrderBizBackupService.listByBillNo(ioCollectOrderResponse.getBillNo());
// // 遍历集合进行累加
// for (IoCollectOrderBizBackup collectOrderBizResponse : orderBizBackups) {
// newScanCount += (collectOrderBizResponse.getScanCount() != null) ? collectOrderBizResponse.getScanCount() : 0;
// shouldCount += getCount(collectOrderBizResponse);
// }
// ioCollectOrderResponse.setScanCount(newScanCount);
// ioCollectOrderResponse.setShouldCount(shouldCount);
// ioCollectOrderResponse.setScanRate(getScanRate(shouldCount,newScanCount));
// if (newScanCount == shouldCount){
// ioCollectOrderResponse.setStorard(1);
// }else {
// ioCollectOrderResponse.setStorard(0);
// }
// }
// 筛选 setStorard 为 1 的数据
List<IoCollectOrderResponse> filteredData = new ArrayList<>();
List<IoCollectOrderResponse> filteredData1 = new ArrayList<>();
List<IoCollectOrderResponse> filteredData2 = new ArrayList<>();
for (IoCollectOrderResponse ioCollectOrderResponse : data) {
Integer newScanCount = 0;
Integer shouldCount = 0;
List<IoCollectOrderBizBackup> orderBizBackups = ioCollectOrderBizBackupService.listByBillNo(ioCollectOrderResponse.getBillNo());
// 遍历集合进行累加
for (IoCollectOrderBizBackup collectOrderBizResponse : orderBizBackups) {
newScanCount += (collectOrderBizResponse.getScanCount() != null) ? collectOrderBizResponse.getScanCount() : 0;
shouldCount += getCount(collectOrderBizResponse);
}
// 设置计算结果
ioCollectOrderResponse.setScanCount(newScanCount);
ioCollectOrderResponse.setShouldCount(shouldCount);
ioCollectOrderResponse.setScanRate(getScanRate(shouldCount, newScanCount));
ioCollectOrderResponse.setStorard(newScanCount.equals(shouldCount) ? 1 : 0);
if (collectOrderRequest.getStorard() == null){
filteredData.add(ioCollectOrderResponse);
}else if (collectOrderRequest.getStorard() == 1){
if (ioCollectOrderResponse.getStorard() == 1) {
filteredData.add(ioCollectOrderResponse);
}
}else if (collectOrderRequest.getStorard() == 0){
if (ioCollectOrderResponse.getStorard() == 0) {
filteredData.add(ioCollectOrderResponse);
}
}
}
// 获取分页参数
Integer pageNum = collectOrderRequest.getPage() != null ? collectOrderRequest.getPage() : 1;
Integer pageSize = collectOrderRequest.getLimit() != null ? collectOrderRequest.getLimit() : 10;
// 计算分页信息
int total = filteredData.size();
int totalPages = (int) Math.ceil((double) total / pageSize);
int start = (pageNum - 1) * pageSize;
int end = Math.min(start + pageSize, total);
// 截取分页数据
List<IoCollectOrderResponse> pageData = filteredData.subList(start, end);
// 创建分页对象
Page<IoCollectOrderResponse> page = new Page<>();
page.setCurrent(pageNum);
page.setSize(pageSize);
page.setTotal(total);
page.setPages(totalPages);
page.setRecords(pageData);
return page;
}
public Integer getCount(IoCollectOrderBizBackup collectOrderBizResponse){
Integer shouldCount = 0;
List<BasicProductsEntity> productList = basicProductsDao.selectList(
new LambdaQueryWrapper<BasicProductsEntity>()
.eq(BasicProductsEntity::getYbbm, collectOrderBizResponse.getYbbm())
.eq(BasicProductsEntity::getPackLevel, "1"));
BasicProductsEntity product = productList.get(0);
Integer myBhxjsl = product.getBhxjsl();
double quotient = (double) collectOrderBizResponse.getCount() / myBhxjsl;
int integerPart = (int) quotient;
if (quotient == integerPart) {
if (integerPart == 0) {
if (collectOrderBizResponse.getAutoTagStatus() != 2) {
shouldCount = 1;
}
} else {
shouldCount = integerPart;
}
} else {
if (IntUtil.value(collectOrderBizResponse.getAutoTagStatus()) == 2) {
shouldCount = 0;
} else {
shouldCount = integerPart + 1;
}
}
return shouldCount;
}
public String getScanRate(Integer scanCount,Integer shouldCount) {
if (scanCount == null || scanCount == 0) {
return 0.00 + "%" ; // 或返回 null 根据业务需求
}
double v = BigDecimal.valueOf(shouldCount)
.divide(BigDecimal.valueOf(scanCount), 4, RoundingMode.HALF_UP)
.multiply(BigDecimal.valueOf(100))
.setScale(2, RoundingMode.HALF_UP)
.doubleValue();
DecimalFormat df = new DecimalFormat("#.00");
return df.format(v) + "%";
}
} }

@ -708,6 +708,7 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC
for (IoCollectOrderBiz ioCollectOrderBiz : collectOrderBizs) { for (IoCollectOrderBiz ioCollectOrderBiz : collectOrderBizs) {
IoCollectOrderBizBackup ioCollectOrderBizBackup = new IoCollectOrderBizBackup(); IoCollectOrderBizBackup ioCollectOrderBizBackup = new IoCollectOrderBizBackup();
BeanUtils.copyProperties(ioCollectOrderBiz, ioCollectOrderBizBackup); BeanUtils.copyProperties(ioCollectOrderBiz, ioCollectOrderBizBackup);
ioCollectOrderBizBackup.setScanCount(ioCollectOrderBiz.getScanCount());
ioCollectOrderBizBackup.setId(ioCollectOrderBiz.getId()); ioCollectOrderBizBackup.setId(ioCollectOrderBiz.getId());
ioCollectOrderBizBackups.add(ioCollectOrderBizBackup); ioCollectOrderBizBackups.add(ioCollectOrderBizBackup);
} }

@ -101,6 +101,12 @@
<if test="invAlert != null"> <if test="invAlert != null">
and icob.invAlert = #{invAlert} and icob.invAlert = #{invAlert}
</if> </if>
<if test="isMatching != null">
and sys_workplace_document.isMatching = #{isMatching}
</if>
<if test="inAndOutType != null">
and sys_workplace_document.inAndOutType = #{inAndOutType}
</if>
<if test="invAlerts != null and invAlerts.size() > 0"> <if test="invAlerts != null and invAlerts.size() > 0">
and icob.invAlert in and icob.invAlert in
<foreach collection="invAlerts" item="item" index="index" separator="," open="(" close=")"> <foreach collection="invAlerts" item="item" index="index" separator="," open="(" close=")">
@ -164,4 +170,156 @@
</select> </select>
<select id="filterorderStatsList" resultType="com.glxp.api.res.collect.IoCollectOrderResponse">
SELECT icob.billNo,
icob.busType,
icob.fromType,
icob.fromTypeDesc,
icob.fromCorp,
icob.billTime,
icob.orderCirType,
icob.createTime,
icob.workPlaceCode,
icob.remark,
icob.createUser,
icob.updateTime,
icob.updateUser,
icob.tagStatus,
icob.splitStatus,
icob.invAlert,
icob.splitMsg,
icob.fromCorpName,
icob.shipperName,
icob.thrBusType,
icob.shipper,
icob.tagMsg,
sys_workplace_document.busName busTypeName,
sw.workplaceName,
icob.id,
icob.orderTime,
icob.uploadStatus,
icob.uploadError,
icob.checkCodeStatus,
icob.errorMsg,
icob.uploadYbTime,
row_number() over ( order by case
when icob.orderTime is null then icob.createTime
else icob.orderTime end desc )
as orderSequence
FROM io_collect_order_backup icob
left join sys_workplace_document on icob.busType = sys_workplace_document.documentTypeCode
left join basic_corp bc on icob.fromCorp = bc.erpId
left join sys_workplace sw on icob.workPlaceCode = sw.workplaceId
<where>
<if test="billNo != '' and billNo != null">
AND billNo LIKE concat('%', #{billNo}, '%')
</if>
<if test="workplaceName != '' and workplaceName != null">
AND workplaceName LIKE concat('%', #{workplaceName}, '%')
</if>
<if test="busType != null and busType != ''">
AND busType = #{busType}
</if>
<if test="fromCorp != '' and fromCorp != null">
AND fromCorp LIKE concat('%', #{fromCorp}, '%')
</if>
<if test="busType != null and busType != ''">
AND busType = #{busType}
</if>
<if test="tagStatus != null">
AND tagStatus = #{tagStatus}
</if>
<if test="workPlaceCode != null">
AND icob.workPlaceCode = #{workPlaceCode}
</if>
<if test="chargeUser != null">
AND sw.chargeUser = #{chargeUser}
</if>
<if test="unionKey != null">
AND (
icob.billNo like concat(#{unionKey}, '%')
or icob.fromCorp like concat('%', #{unionKey}, '%')
or icob.fromCorpName like concat('%', #{unionKey}, '%')
or icob.backupOrderRemark1 like concat('%', #{unionKey}, '%')
or icob.backupOrderRemark2 like concat('%', #{unionKey}, '%')
or icob.backupOrderRemark3 like concat('%', #{unionKey}, '%')
or icob.backupOrderRemark4 like concat('%', #{unionKey}, '%')
or icob.backupOrderRemark5 like concat('%', #{unionKey}, '%')
or icob.backupOrderRemark6 like concat('%', #{unionKey}, '%'))
</if>
<if test="tagStatusList != null and tagStatusList.size() > 0">
and tagStatus in
<foreach collection="tagStatusList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="documentTypeCodes != null and documentTypeCodes.size() > 0">
and busType in
<foreach collection="documentTypeCodes" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="workPlaceCodes != null and workPlaceCodes.size() > 0">
and icob.workPlaceCode in
<foreach collection="workPlaceCodes" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="invAlert != null">
and icob.invAlert = #{invAlert}
</if>
<if test="invAlerts != null and invAlerts.size() > 0">
and icob.invAlert in
<foreach collection="invAlerts" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="uploadStatus != null">
and icob.uploadStatus = #{uploadStatus}
</if>
<if test="keyWords != null and keyWords != ''">
and (icob.billNo like concat( #{keyWords}, '%')
or icob.fromCorp like concat('%', #{keyWords}, '%')
or icob.workPlaceCode like concat('%', #{keyWords}, '%')
or icob.busType like concat('%', #{keyWords}, '%')
or icob.fromType like concat('%', #{keyWords}, '%'))
</if>
<if test="shipperName != '' and shipperName != null">
AND icob.shipperName LIKE concat('%', #{shipperName}, '%')
</if>
<if test="fromType != '' and fromType != null">
AND icob.fromType LIKE concat('%', #{fromType}, '%')
</if>
<if test="fromCorpName != '' and fromCorpName != null">
AND icob.fromCorpName LIKE concat('%', #{fromCorpName}, '%')
</if>
<if test="startTime != null and startTime != ''">
<![CDATA[
and icob.billTime >= DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime != null and endTime != ''">
<![CDATA[
and icob.billTime <= DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="orderStartTime != null and orderStartTime != '' and orderEndTime != null and orderEndTime != ''">
AND date_format(icob.updateTime, '%Y-%m-%d') between date_format(#{orderStartTime},
'%Y-%m-%d') and date_format(#{orderEndTime}, '%Y-%m-%d')
</if>
<if test="uploadStatusList!= null and uploadStatusList.size() > 0">
and uploadStatus IN
<foreach collection="uploadStatusList" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
GROUP BY icob.billNo
order by case when icob.orderTime is null then icob.createTime else icob.orderTime end desc
</select>
</mapper> </mapper>

@ -5615,3 +5615,8 @@ CREATE TABLE IF NOT EXISTS `yb_uploading_log` (
CALL Modify_index('yb_uploading_log', 'billNo', 'idx_yb_uploading_log_billNo', 'BTREE'); CALL Modify_index('yb_uploading_log', 'billNo', 'idx_yb_uploading_log_billNo', 'BTREE');
CALL Modify_index('yb_uploading_log', 'updateTime', 'idx_yb_uploading_log_updateTime', 'BTREE'); CALL Modify_index('yb_uploading_log', 'updateTime', 'idx_yb_uploading_log_updateTime', 'BTREE');
CALL Pro_Temp_ColumnWork('sys_workplace_document', 'coercionSubmit',
'tinyint NULL DEFAULT NULL COMMENT ''是否允许强制提交单据10''',
1);

Loading…
Cancel
Save