1、选入药品bug

2、医保上传统计问题
dev_unify
qiuyt 7 months ago
parent 9dbc74c56f
commit ed9a13f65b

@ -166,6 +166,9 @@ public class CollectOrderBizResponse {
private String busType;
private Integer uploadStatus;
private Integer fifoSplit;
private Integer billNo;
// /**
// * 未赋码数量
// */

@ -18,5 +18,19 @@ public class CollectOrderUploadCountResponse {
private BigDecimal buyerCentage;
private BigDecimal salesCentage;
private Integer codeCount;
private Integer buyerScanCount;
private Integer salesScanCount;
private Integer count;
/**
*
*/
private Integer fifoSplitOneCount;
/**
*
*/
private Integer fifoSplitTwoCount;
/**
*
*/
private Integer fifoSplitThreeCount;
}

@ -418,18 +418,7 @@ public class UdiContrastService {
for (int i = 0; i < thirdAliDrugList.size(); i++) {
ThirdAliDrug thirdAliDrug = thirdAliDrugList.get(i);
List<Integer> integers = new ArrayList<>();
if (StrUtil.isNotEmpty(thirdAliDrug.getPackRatio())) {
integers = DimaUtil.calculateLevels(thirdAliDrug.getPackRatio());
}
udiProductEntity.setPackLevel(thirdAliDrug.getPackLevel());
try {
udiProductEntity.setBhxjsl(integers.get(IntUtil.value(thirdAliDrug.getPackLevel()) - 1));
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
Log.error("计算包装级别出错" + thirdAliDrug.getPackLevel() + "---" + integers + "-----" + thirdAliDrug.toString());
udiProductEntity.setBhxjsl(0);
}
udiProductEntity.setNameCode(thirdAliDrug.getNameCode());
@ -448,13 +437,26 @@ public class UdiContrastService {
//设置最小产品数量
// udiProductEntity.setBhxjsl(ybDrug.getFactor());
//设置包装级别
udiProductEntity.setPackLevel(1 + "");
// udiProductEntity.setPackLevel(1 + "");
//生产厂家
udiProductEntity.setManufactory(thirdAliDrug.getManufacturer());
//商品条码 essentialDrugMarkName sptm
// udiProductEntity.setSptm(ybDrug.getBusinessLicense());
udiProductEntity.setPrepnUnit(thirdAliDrug.getPrepnUnitName());
List<Integer> integers = new ArrayList<>();
if (StrUtil.isNotEmpty(thirdAliDrug.getPackRatio())) {
integers = DimaUtil.calculateLevels(thirdAliDrug.getPackRatio());
}
udiProductEntity.setPackLevel(thirdAliDrug.getPackLevel());
try {
udiProductEntity.setBhxjsl(integers.get(IntUtil.value(thirdAliDrug.getPackLevel()) - 1));
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
Log.error("计算包装级别出错" + thirdAliDrug.getPackLevel() + "---" + integers + "-----" + thirdAliDrug.toString());
udiProductEntity.setBhxjsl(0);
}
if (IntUtil.value(thirdAliDrug.getPackLevel()) == 1) {
udiProductEntity.setXjdw(ybDrug.getMinUnit());
if (DimaUtil.trMinCount(thirdAliDrug.getBzgg()) != null) {

@ -1,10 +1,16 @@
package com.glxp.api.service.collect;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.dao.collect.IoCollectCodeBackMapper;
import com.glxp.api.dao.collect.IoCollectCodeMapper;
import com.glxp.api.dao.collect.IoCollectOrderBizBackupMapper;
import com.glxp.api.entity.collect.IoCollectCode;
import com.glxp.api.entity.collect.IoCollectCodeBackup;
import com.glxp.api.entity.collect.IoCollectOrderBizBackup;
import com.glxp.api.http.ErpBasicClient;
import com.glxp.api.req.collect.CollectOrderBizRequest;
@ -27,6 +33,8 @@ public class IoCollectOrderBizBackupService extends ServiceImpl<IoCollectOrderBi
IoCollectOrderBizBackupMapper ioCollectOrderBizBackupMapper;
@Resource
private ErpBasicClient erpBasicClient;
@Resource
private IoCollectCodeBackMapper ioCollectCodeBackMapper;
public List<CollectOrderBizResponse> filterList(CollectOrderBizRequest collectOrderRequest) {
if (collectOrderRequest == null) {
@ -48,13 +56,20 @@ public class IoCollectOrderBizBackupService extends ServiceImpl<IoCollectOrderBi
Map<String, String[]> buyTypeMap = new HashMap<>();
List<String> buyTypeBuyer = new ArrayList<>();
List<String> buyTypeSales = new ArrayList<>();
Integer buyerCount = 0;
Integer salesCount = 0;
// Integer buyerCount = 0;
// Integer salesCount = 0;
Integer buyerScanCount = 0;
Integer salesScanCount = 0;
BigDecimal buyerCentage = new BigDecimal(0);
BigDecimal salesCentage = new BigDecimal(0);
Integer codeCount = 0;
Integer fifoSplitOneCount = 0;
Integer fifoSplitTwoCount = 0;
Integer fifoSplitThreeCount = 0;
if (list != null && list.size() > 0) {
BaseResponse<Map<String, String[]>> baseResponse = erpBasicClient.getBuyType("thirdId");
if (baseResponse.getCode() == 20000) {
@ -67,47 +82,71 @@ public class IoCollectOrderBizBackupService extends ServiceImpl<IoCollectOrderBi
}
for (CollectOrderBizResponse collectOrderBizResponse : list) {
for (String buyType : buyTypeBuyer) {
if (buyType.equals(collectOrderBizResponse.getBusType())) {
buyerCount += collectOrderBizResponse.getCount();
// 只有已上传的码才是正确的码
if (2 == collectOrderBizResponse.getUploadStatus()) {
buyerScanCount += collectOrderBizResponse.getScanCount();
collectOrderBizResponse.setCount(collectOrderBizResponse.getCount() == null ? 0 : collectOrderBizResponse.getCount());
collectOrderBizResponse.setScanCount(collectOrderBizResponse.getScanCount() == null ? 0 : collectOrderBizResponse.getScanCount());
if(2 == collectOrderBizResponse.getUploadStatus()){
for (String buyType : buyTypeSales) {
if (buyType.equals(collectOrderBizResponse.getBusType())) {
// salesCount += collectOrderBizResponse.getCount();
salesScanCount ++;
}
}
}
for (String buyType : buyTypeSales) {
if (buyType.equals(collectOrderBizResponse.getBusType())) {
salesCount += collectOrderBizResponse.getCount();
if (2 == collectOrderBizResponse.getUploadStatus()) {
salesScanCount += collectOrderBizResponse.getScanCount();
for (String buyType : buyTypeBuyer) {
if (buyType.equals(collectOrderBizResponse.getBusType())) {
// buyerCount += collectOrderBizResponse.getCount();
// 只有已上传的码才是正确的码
buyerScanCount ++;
}
}
if(collectOrderBizResponse.getFifoSplit() == 1){
fifoSplitOneCount ++;
}else if(collectOrderBizResponse.getFifoSplit() == 2){
fifoSplitTwoCount ++;
}else if(collectOrderBizResponse.getFifoSplit() == 3){
fifoSplitThreeCount ++;
}
}
codeCount++;
}
// 计算采购率和销售率
BigDecimal buyerCountBigDecimal = BigDecimal.valueOf(buyerCount);
BigDecimal buyerScanCountBigDecimal = BigDecimal.valueOf(buyerScanCount);
if(buyerCountBigDecimal.equals(new BigDecimal(0))){
buyerCentage = new BigDecimal(0).setScale(2, BigDecimal.ROUND_HALF_UP);
}else {
buyerCentage = buyerScanCountBigDecimal.divide(buyerCountBigDecimal,4, BigDecimal.ROUND_HALF_UP ).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
}
BigDecimal salesCountBigDecimal = BigDecimal.valueOf(salesCount);
BigDecimal salesScanCountBigDecimal = BigDecimal.valueOf(salesScanCount);
if(salesCountBigDecimal.equals(new BigDecimal(0))){
salesCentage = new BigDecimal(0).setScale(2, BigDecimal.ROUND_HALF_UP);
}else {
salesCentage = salesScanCountBigDecimal.divide(salesCountBigDecimal,4, BigDecimal.ROUND_HALF_UP ).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
}
codeCount = buyerScanCount + salesScanCount;
// BigDecimal buyerCountBigDecimal = BigDecimal.valueOf(buyerCount);
// BigDecimal buyerScanCountBigDecimal = BigDecimal.valueOf(buyerScanCount);
// if(buyerCountBigDecimal.equals(new BigDecimal(0))){
// buyerCentage = new BigDecimal(0).setScale(2, BigDecimal.ROUND_HALF_UP);
// }else {
// buyerCentage = buyerScanCountBigDecimal.divide(buyerCountBigDecimal,4, BigDecimal.ROUND_HALF_UP ).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
// }
//
// BigDecimal salesCountBigDecimal = BigDecimal.valueOf(salesCount);
// BigDecimal salesScanCountBigDecimal = BigDecimal.valueOf(salesScanCount);
// if(salesCountBigDecimal.equals(new BigDecimal(0))){
// salesCentage = new BigDecimal(0).setScale(2, BigDecimal.ROUND_HALF_UP);
// }else {
// salesCentage = salesScanCountBigDecimal.divide(salesCountBigDecimal,4, BigDecimal.ROUND_HALF_UP ).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
// }
// codeCount = buyerScanCount + salesScanCount;
}
collectOrderUploadCountResponse.setBuyerCentage(buyerCentage);
collectOrderUploadCountResponse.setSalesCentage(salesCentage);
collectOrderUploadCountResponse.setBuyerScanCount(buyerScanCount);
collectOrderUploadCountResponse.setSalesScanCount(salesScanCount);
collectOrderUploadCountResponse.setCodeCount(codeCount);
// collectOrderUploadCountResponse.setCount(buyerCount+salesCount);
collectOrderUploadCountResponse.setFifoSplitOneCount(fifoSplitOneCount);
collectOrderUploadCountResponse.setFifoSplitTwoCount(fifoSplitTwoCount);
collectOrderUploadCountResponse.setFifoSplitThreeCount(fifoSplitThreeCount);
}
public static void main(String[] args) {

@ -38,11 +38,16 @@
</select>
<select id="getList" resultType="com.glxp.api.res.collect.CollectOrderBizResponse">
SELECT
biz_bac.* ,bac.busType,bac.uploadStatus
biz_bac.* ,bac.busType,bac.uploadStatus,code_ba.fifoSplit
FROM
io_collect_order_biz_backup biz_bac, io_collect_order_backup bac where biz_bac.orderIdFk = bac.billNo
<if test="startTime != '' and startTime != null and endTime != '' and endTime != null">
AND bac.updateTime BETWEEN #{startTime} AND #{endTime}
</if>
io_collect_code_backup code_ba LEFT JOIN io_collect_order_backup bac ON code_ba.billNo = bac.billNo
LEFT JOIN io_collect_order_biz_backup biz_bac ON biz_bac.orderIdFk = bac.billNo
<where>
<if test="startTime != '' and startTime != null and endTime != '' and endTime != null">
AND bac.updateTime BETWEEN #{startTime} AND #{endTime}
</if>
</where>
group by code_ba.id
</select>
</mapper>

Loading…
Cancel
Save