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

dev_2.5_optimize_250306
yewj 3 months ago
commit a02f3700a2

@ -0,0 +1,119 @@
package com.glxp.api.controller.basic;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.dao.system.ThrYbSetupMapper;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.entity.system.ThrYbSetup;
import com.glxp.api.req.basic.YbNotCodeQuery;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.YbNotCodeResponse;
import com.glxp.api.service.basic.impl.YbNotCodeServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.List;
@Slf4j
@RestController
public class YbNotCodeController {
@Resource
YbNotCodeServiceImpl ybNotCodeService;
@Resource
private ThrYbSetupMapper thrYbSetupMapper;
@PostMapping("/udi/ybNotCode/page")
public BaseResponse page(@RequestBody YbNotCodeQuery query) {
List<YbNotCode> list = ybNotCodeService.pageList(query);
PageInfo pageInfo = new PageInfo<>(list);
PageSimpleResponse page = new PageSimpleResponse();
page.setTotal(pageInfo.getTotal());
page.setList(pageInfo.getList());
return ResultVOUtils.success(page);
}
@PostMapping("/udi/ybNotCode/add")
public BaseResponse add(@RequestBody YbNotCode ybNotCode) {
return ResultVOUtils.success(ybNotCodeService.add(ybNotCode));
}
@PostMapping("/udi/ybNotCode/update")
public BaseResponse update(@RequestBody YbNotCode ybNotCode) {
return ResultVOUtils.success(ybNotCodeService.update(ybNotCode));
}
@PostMapping("/udi/ybNotCode/delete")
public BaseResponse delete(@RequestBody YbNotCode ybNotCode) {
return ResultVOUtils.success(ybNotCodeService.delete(ybNotCode));
}
@GetMapping("/udi/ybNotCode/export")
public void export( YbNotCodeQuery query,HttpServletResponse response) throws IOException {
List<YbNotCode> list;
if(query.getExcelType() !=null && query.getExcelType() == 1
){
list = ybNotCodeService.pageList( query );
}else {
list = ybNotCodeService.list( new QueryWrapper<>());
}
List<YbNotCodeResponse> splitCodeEntities = BeanUtil.copyToList(list, YbNotCodeResponse.class);
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode("无码药品信息管理模板" + DateUtil.format(new Date(), "yyyy-MM-dd") + ".xlsx", StandardCharsets.UTF_8.name()));
// 定义表头样式
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// 设置表头背景颜色为淡蓝色
headWriteCellStyle.setFillForegroundColor(IndexedColors.LIGHT_YELLOW.getIndex()); // 淡蓝色对应的索引值
WriteFont headWriteFont = new WriteFont();
headWriteFont.setFontHeightInPoints((short) 11);
headWriteCellStyle.setWriteFont(headWriteFont);
// 定义内容样式
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
// 构建样式策略
HorizontalCellStyleStrategy horizontalCellStyleStrategy =
new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
EasyExcel.write(response.getOutputStream(), YbNotCodeResponse.class).registerWriteHandler(horizontalCellStyleStrategy) .// 注册自定义样式处理器
sheet("无码药品申报导入").doWrite(splitCodeEntities);
}
@GetMapping("/udi/ybNotCode/getOrganizationCode")
public BaseResponse getOrganizationCode() {
ThrYbSetup thrYbSetup = thrYbSetupMapper.selectOne(
new QueryWrapper<ThrYbSetup>()
.last("limit 1")
);
String appId = "";
if(thrYbSetup!=null && StringUtils.isNotEmpty(thrYbSetup.getAppId())){
appId = thrYbSetup.getAppId();
}
return ResultVOUtils.success(appId);
}
}

@ -209,7 +209,7 @@ public class IoCollectOrderBackupController extends BaseController {
collectOrderUploadCountResponse.setAlreadyUploadingCount(alreadyUploadingCount);
collectOrderUploadCountResponse.setUploadingFailCount(uploadingFailCount);
// 总上传码数量 获取采购上传率 销售上传率 计算
ioCollectOrderBizBackupService.calculatedUploadRate(collectOrderUploadCountRequest, collectOrderUploadCountResponse);
ioCollectOrderBackupService.calculatedUploadRate(collectOrderUploadCountRequest, collectOrderUploadCountResponse);
return ResultVOUtils.success(collectOrderUploadCountResponse);
}

@ -1,19 +1,14 @@
package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.req.basic.YbNotCodeQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface YbNotCodeMapper {
int deleteByPrimaryKey(String ybbm);
int insert(YbNotCode record);
int insertSelective(YbNotCode record);
import java.util.List;
YbNotCode selectByPrimaryKey(String ybbm);
int updateByPrimaryKeySelective(YbNotCode record);
int updateByPrimaryKey(YbNotCode record);
}
@Mapper
public interface YbNotCodeMapper extends BaseMapper<YbNotCode> {
List<YbNotCode> pageList(@Param("vo") YbNotCodeQuery ybNotCodeQuery);
}

@ -3,6 +3,8 @@ package com.glxp.api.dao.collect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.collect.IoCollectOrderBackup;
import com.glxp.api.req.collect.CollectOrderRequest;
import com.glxp.api.req.collect.CollectOrderUploadCountRequest;
import com.glxp.api.res.collect.CollectOrderBizResponse;
import com.glxp.api.res.collect.IoCollectOrderResponse;
import org.apache.ibatis.annotations.Mapper;
@ -12,5 +14,6 @@ import java.util.List;
public interface IoCollectOrderBackupMapper extends BaseMapper<IoCollectOrderBackup> {
List<IoCollectOrderResponse> filterList(CollectOrderRequest collectOrderRequest);
List<IoCollectOrderResponse> getList(CollectOrderUploadCountRequest collectOrderUploadCountRequest);
}

@ -15,6 +15,5 @@ public interface IoCollectOrderBizBackupMapper extends BaseMapper<IoCollectOrder
List<CollectOrderBizResponse> filterList(CollectOrderBizRequest collectOrderRequest);
List<CollectOrderBizResponse> getList(CollectOrderUploadCountRequest collectOrderUploadCountRequest);
}

@ -0,0 +1,9 @@
package com.glxp.api.dao.system;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.system.ThrYbSetup;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ThrYbSetupMapper extends BaseMapper<ThrYbSetup> {
}

@ -1,5 +1,9 @@
package com.glxp.api.entity.basic;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -8,26 +12,25 @@ import lombok.NoArgsConstructor;
*
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "yb_not_code")
public class YbNotCode {
/**
*
*/
@TableId(value = "ybbm", type = IdType.INPUT)
private String ybbm;
/**
*
*/
private String organizationcode;
@TableField(value = "organizationCode")
private String organizationCode;
/**
*
* 1
* 5
* 6
* 7
* 0
* 1 5 6 7 0
*/
private Integer notcodetype;
@TableField(value = "notCodeType")
private Integer notCodeType;
@TableField(exist = false)
private String notCodeTypeName;
}

@ -0,0 +1,98 @@
package com.glxp.api.entity.system;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
@Data
@TableName(value = "thr_yb_setup")
public class ThrYbSetup implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
private Integer id;
@TableField(value = "url")
private String url;
@TableField(value = "appId")
private String appId;
@TableField(value = "appSecret")
private String appSecret;
@TableField(value = "signKey")
private String signKey;
@TableField(value = "encKey")
private String encKey;
/**
*
*/
@TableField(value = "mdtrtarea_admvs")
private String mdtrtarea_admvs;
/**
*
*/
@TableField(value = "insuplc_admdvs")
private String insuplc_admdvs;
/**
*
*/
@TableField(value = "opter")
private String opter;
/**
*
*/
@TableField(value = "opter_name")
private String opter_name;
/**
*
*/
@TableField(value = "fixmedins_code")
private String fixmedins_code;
/**
*
*/
@TableField(value = "fixmedins_name")
private String fixmedins_name;
/**
*
*/
@TableField(value = "infver")
private String infver;
/**
*
*/
@TableField(value = "recer_sys_code")
private String recer_sys_code;
/**
*
*/
@TableField(value = "opter_type")
private String opter_type;
@TableField(value = "sequenceNum")
private String sequenceNum;
@TableField(value = "opter_no")
private String opter_no;
@TableField(value = "mac")
private String mac;
@TableField(value = "ip")
private String ip;
@TableField(value = "signNo")
private String signNo;
@TableField(value = "signData")
private String signData;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,31 @@
package com.glxp.api.req.basic;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
@Data
public class YbNotCodeQuery extends ListPageRequest {
/**
*
*/
@TableId(value = "ybbm", type = IdType.INPUT)
private String ybbm;
/**
*
*/
@TableField(value = "organizationCode")
private String organizationCode;
/**
* 1 5 6 7 0
*/
@TableField(value = "notCodeType")
private Integer notCodeType;
private Integer excelType;
}

@ -0,0 +1,26 @@
package com.glxp.api.res.basic;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
@Data
@HeadRowHeight(16) // 设置表头 高度 为 40
public class YbNotCodeResponse {
@ExcelProperty(value = "机构编码", index = 0)
@ColumnWidth(32)
private String ybbm;
@ExcelProperty(value = "国家医保目录编码", index = 1)
@ColumnWidth(28)
private String organizationCode;
@ExcelProperty(value = "无码类型(仅填数字即可)", index = 2)
@ColumnWidth(54)
private String notCodeType;
}

@ -17,10 +17,20 @@ public class CollectOrderUploadCountResponse {
private BigDecimal buyerCentage;
private BigDecimal salesCentage;
private Integer codeCount;
private Integer buyerScanCount;
private Integer salesScanCount;
private Integer buyerScanCountReturn ;
private Integer salesScanCountReturn ;
private Integer buyerScanSumCount;
private Integer salesScanSumCount;
private Integer buyerScanSumCountReturn ;
private Integer salesScanSumCountReturn ;
private Integer count;
/**
*

@ -184,7 +184,10 @@ public class IoCollectOrderResponse {
private Integer checkCodeStatus;
private Integer ledNum;
/**
*
*/
private Integer relCodeCount;
public String getFromName() {

@ -1,43 +0,0 @@
package com.glxp.api.service.auth;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.dao.basic.YbNotCodeMapper;
@Service
public class YbNotCodeService{
@Resource
private YbNotCodeMapper ybNotCodeMapper;
public int deleteByPrimaryKey(String ybbm) {
return ybNotCodeMapper.deleteByPrimaryKey(ybbm);
}
public int insert(YbNotCode record) {
return ybNotCodeMapper.insert(record);
}
public int insertSelective(YbNotCode record) {
return ybNotCodeMapper.insertSelective(record);
}
public YbNotCode selectByPrimaryKey(String ybbm) {
return ybNotCodeMapper.selectByPrimaryKey(ybbm);
}
public int updateByPrimaryKeySelective(YbNotCode record) {
return ybNotCodeMapper.updateByPrimaryKeySelective(record);
}
public int updateByPrimaryKey(YbNotCode record) {
return ybNotCodeMapper.updateByPrimaryKey(record);
}
}

@ -0,0 +1,20 @@
package com.glxp.api.service.basic;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.req.basic.YbNotCodeQuery;
import java.util.List;
public interface YbNotCodeService extends IService<YbNotCode>{
List<YbNotCode> pageList(YbNotCodeQuery query);
Boolean add(YbNotCode ybNotCode);
Boolean update(YbNotCode ybNotCode);
Boolean delete(YbNotCode ybNotCode);
}

@ -0,0 +1,44 @@
package com.glxp.api.service.basic.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.YbNotCodeMapper;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.req.basic.YbNotCodeQuery;
import com.glxp.api.service.basic.YbNotCodeService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class YbNotCodeServiceImpl extends ServiceImpl<YbNotCodeMapper, YbNotCode> implements YbNotCodeService {
@Resource
private YbNotCodeMapper ybNotCodeMapper;
@Override
public List<YbNotCode> pageList(YbNotCodeQuery query) {
if (query.getPage() != null) {
PageHelper.startPage(query.getPage(), query.getLimit());
}
return ybNotCodeMapper.pageList(query);
}
@Override
public Boolean add(YbNotCode ybNotCode) {
return ybNotCodeMapper.insert(ybNotCode) > 0 ? true : false;
}
@Override
public Boolean update(YbNotCode ybNotCode) {
return ybNotCodeMapper.updateById(ybNotCode) > 0 ? true : false;
}
@Override
public Boolean delete(YbNotCode ybNotCode) {
return ybNotCodeMapper.deleteById(ybNotCode) > 0 ? true : false;
}
}

@ -3,6 +3,7 @@ package com.glxp.api.service.collect;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -32,10 +33,12 @@ import com.glxp.api.http.ErpBasicClient;
import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.req.collect.CollectOrderBizRequest;
import com.glxp.api.req.collect.CollectOrderRequest;
import com.glxp.api.req.collect.CollectOrderUploadCountRequest;
import com.glxp.api.req.collect.PostCollectOrderRequest;
import com.glxp.api.req.inout.ReviewFinishRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.res.collect.CollectOrderBizResponse;
import com.glxp.api.res.collect.CollectOrderUploadCountResponse;
import com.glxp.api.res.collect.IoCollectOrderResponse;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.auth.SysWorkplaceService;
@ -54,6 +57,7 @@ import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@ -181,8 +185,8 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
SysWorkplaceDocumentEntity sysWorkplaceDocumentEntity = sysWorkplaceDocumentService.findByWorkplaceCode(collectOrder.getWorkPlaceCode(), collectOrder.getBusType());
// 如果是null 就可能是上货工位进行医保上传
if(Objects.isNull(sysWorkplaceDocumentEntity)){
sysWorkplaceDocumentEntity = sysWorkplaceDocumentService.filterListExhibitGoods(collectOrder.getWorkPlaceCode(), collectOrder.getBusType());
if (Objects.isNull(sysWorkplaceDocumentEntity)) {
sysWorkplaceDocumentEntity = sysWorkplaceDocumentService.filterListExhibitGoods(collectOrder.getWorkPlaceCode(), collectOrder.getBusType());
}
@ -427,13 +431,13 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
for (CollectOrderBizResponse collectOrderBizResponse : orderRequest.getCollectOrderList().get(0).getCollectOrderBizResponseList()) {
long count = ioCollectCodeBackService.count(
new QueryWrapper<IoCollectCodeBackup>()
.eq("billNo",collectOrderBizResponse.getBillNo())
.eq("fifoSplit","1").or().eq("fifoSplit","4")
.eq("billNo", collectOrderBizResponse.getBillNo())
.eq("fifoSplit", "1").or().eq("fifoSplit", "4")
.last("limit 1")
);
if(count >0){
if (count > 0) {
collectOrderBizResponse.setTrdnFlag("1");
}else {
} else {
collectOrderBizResponse.setTrdnFlag("0");
}
@ -650,4 +654,115 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
return collectOrderBizResponses;
}
/**
*
*/
public void calculatedUploadRate(CollectOrderUploadCountRequest collectOrderUploadCountRequest, CollectOrderUploadCountResponse collectOrderUploadCountResponse) {
List<IoCollectOrderResponse> list = ioCollectOrderBackupMapper.getList(collectOrderUploadCountRequest);
Map<String, String[]> buyTypeMap = new HashMap<>();
Integer buyerScanCount = 0;
Integer salesScanCount = 0;
Integer buyerScanCountReturn = 0;
Integer salesScanCountReturn = 0;
Integer buyerScanSumCount = 0;
Integer salesScanSumCount = 0;
Integer buyerScanSumCountReturn = 0;
Integer salesScanSumCountReturn = 0;
BigDecimal buyerCentage = new BigDecimal(0);
BigDecimal salesCentage = new BigDecimal(0);
Integer codeCount = 0;
Integer fifoSplitOneCount = 0;
Integer fifoSplitTwoCount = 0;
String sum = "_sum";
if (list != null && list.size() > 0) {
BaseResponse<Map<String, String[]>> baseResponse = erpBasicClient.getBuyType("thirdId");
if (baseResponse.getCode() == 20000) {
buyTypeMap = baseResponse.getData();
}
Map<String, Integer> map = new HashMap();
for (Map.Entry<String, String[]> entry : buyTypeMap.entrySet()) {
String key = entry.getKey();
if (ArrayUtil.isEmpty(entry.getValue())) {
continue;
}
String result = String.join(", ", entry.getValue());
int sumCount = 0;
int okCount = 0;
for (IoCollectOrderResponse collectOrderResponse : list) {
if (result.contains(collectOrderResponse.getBusType())) {
if (collectOrderResponse.getRelCodeCount() != null) {
if (2 == collectOrderResponse.getUploadStatus()) {
okCount += collectOrderResponse.getRelCodeCount();
}
sumCount += collectOrderResponse.getRelCodeCount();
}
}
}
map.put(key , okCount);
map.put(key + sum, sumCount);
}
// 数据做处理
for (Map.Entry<String, Integer> entry : map.entrySet()) {
String key = entry.getKey();
Integer value = entry.getValue();
if (key.equals("buyType_3502")) {
buyerScanCount += value;
} else if (key.equals("buyType_3504")) {
buyerScanCountReturn += value;
} else if (key.equals("buyType_3505")) {
salesScanCount += value;
} else if (key.equals("buyType_35051")) {
salesScanCount += value;
} else if (key.equals("buyType_3506")) {
salesScanCountReturn += value;
}
if (key.equals("buyType_3502" + sum)) {
buyerScanSumCount += value;
} else if (key.equals("buyType_3504" + sum)) {
buyerScanSumCountReturn += value;
} else if (key.equals("buyType_3505" + sum)) {
salesScanSumCount += value;
} else if (key.equals("buyType_35051" + sum)) {
salesScanSumCount += value;
} else if (key.equals("buyType_3506" + sum)) {
salesScanSumCountReturn += value;
}
}
}
collectOrderUploadCountResponse.setBuyerCentage(buyerCentage);
collectOrderUploadCountResponse.setSalesCentage(salesCentage);
collectOrderUploadCountResponse.setBuyerScanCount(buyerScanCount);
collectOrderUploadCountResponse.setSalesScanCount(salesScanCount);
collectOrderUploadCountResponse.setBuyerScanCountReturn(buyerScanCountReturn);
collectOrderUploadCountResponse.setSalesScanCountReturn(salesScanCountReturn);
collectOrderUploadCountResponse.setBuyerScanSumCount(buyerScanSumCount);
collectOrderUploadCountResponse.setSalesScanSumCount(salesScanSumCount);
collectOrderUploadCountResponse.setBuyerScanSumCountReturn(buyerScanSumCountReturn);
collectOrderUploadCountResponse.setSalesScanSumCountReturn(salesScanSumCountReturn);
collectOrderUploadCountResponse.setCodeCount(codeCount);
collectOrderUploadCountResponse.setFifoSplitOneCount(fifoSplitOneCount);
collectOrderUploadCountResponse.setFifoSplitTwoCount(fifoSplitTwoCount);
}
}

@ -12,6 +12,7 @@ import com.glxp.api.req.collect.CollectOrderBizRequest;
import com.glxp.api.req.collect.CollectOrderUploadCountRequest;
import com.glxp.api.res.collect.CollectOrderBizResponse;
import com.glxp.api.res.collect.CollectOrderUploadCountResponse;
import io.swagger.models.auth.In;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -39,96 +40,8 @@ public class IoCollectOrderBizBackupService extends ServiceImpl<IoCollectOrderBi
return data;
}
/**
*
*/
public void calculatedUploadRate(CollectOrderUploadCountRequest collectOrderUploadCountRequest, CollectOrderUploadCountResponse collectOrderUploadCountResponse) {
List<CollectOrderBizResponse> list = ioCollectOrderBizBackupMapper.getList(collectOrderUploadCountRequest);
Map<String, String[]> buyTypeMap = new HashMap<>();
List<String> buyTypeBuyer = new ArrayList<>();
List<String> buyTypeSales = new ArrayList<>();
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;
if (list != null && list.size() > 0) {
BaseResponse<Map<String, String[]>> baseResponse = erpBasicClient.getBuyType("thirdId");
if (baseResponse.getCode() == 20000) {
buyTypeMap = baseResponse.getData();
buyTypeBuyer = new ArrayList<>(Arrays.asList(buyTypeMap.get("buyType_3501")));
buyTypeBuyer.addAll(Arrays.asList(buyTypeMap.get("buyType_3502")));
buyTypeSales = new ArrayList<>(Arrays.asList(buyTypeMap.get("buyType_3505")));
buyTypeSales.addAll(Arrays.asList(buyTypeMap.get("buyType_3506")));
}
for (CollectOrderBizResponse collectOrderBizResponse : list) {
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();
if(collectOrderBizResponse.getRelCodeCount() != null && collectOrderBizResponse.getRelCodeCount() >0){
buyerScanCount += collectOrderBizResponse.getRelCodeCount();
}else {
buyerScanCount ++;
}
}
}
for (String buyType : buyTypeBuyer) {
if (buyType.equals(collectOrderBizResponse.getBusType())) {
// buyerCount += collectOrderBizResponse.getCount();
// 只有已上传的码才是正确的码
if(collectOrderBizResponse.getRelCodeCount() != null && collectOrderBizResponse.getRelCodeCount() >0){
salesScanCount += collectOrderBizResponse.getRelCodeCount();
}else {
salesScanCount ++;
}
}
}
if(collectOrderBizResponse.getFifoSplit() == 1
){
fifoSplitOneCount ++;
}else if(collectOrderBizResponse.getFifoSplit() == 2){
fifoSplitTwoCount ++;
}else if(collectOrderBizResponse.getFifoSplit() == 3){
fifoSplitTwoCount ++;
}else if(collectOrderBizResponse.getFifoSplit() == 4){
fifoSplitOneCount ++;
}
}
if(collectOrderBizResponse.getRelCodeCount() != null && collectOrderBizResponse.getRelCodeCount() >0){
codeCount += collectOrderBizResponse.getRelCodeCount();
}else {
codeCount ++;
}
}
}
collectOrderUploadCountResponse.setBuyerCentage(buyerCentage);
collectOrderUploadCountResponse.setSalesCentage(salesCentage);
collectOrderUploadCountResponse.setBuyerScanCount(buyerScanCount);
collectOrderUploadCountResponse.setSalesScanCount(salesScanCount);
collectOrderUploadCountResponse.setCodeCount(codeCount);
collectOrderUploadCountResponse.setFifoSplitOneCount(fifoSplitOneCount);
collectOrderUploadCountResponse.setFifoSplitTwoCount(fifoSplitTwoCount);
}
public static void main(String[] args) {
System.out.println(new BigDecimal(0).setScale(2, BigDecimal.ROUND_HALF_UP));
}
public List<IoCollectOrderBizBackup> listByBillNo(String billNo) {

@ -12,69 +12,25 @@
<!--@mbg.generated-->
ybbm, organizationCode, notCodeType
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from yb_not_code
where ybbm = #{ybbm,jdbcType=VARCHAR}
<select id="pageList" resultType="com.glxp.api.entity.basic.YbNotCode">
select *,CASE
WHEN notCodeType = 1 THEN '部分早期未赋予追溯码'
WHEN notCodeType = 5 THEN '最小包装无追溯码'
WHEN notCodeType = 6 THEN '无追溯码'
WHEN notCodeType = 7 THEN '其他原因'
WHEN notCodeType = 0 THEN '默认不是无码类型'
ELSE '默认不是无码类型'
END AS notCodeTypeName from yb_not_code
<where>
<if test="vo.ybbm!=null and vo.ybbm!=''">
and ybbm = #{vo.ybbm}
</if>
<if test="vo.organizationCode!=null and vo.organizationCode!=''">
and organizationCode = #{vo.organizationCode}
</if>
<if test="vo.notCodeType!=null and vo.notCodeType!=-1">
and notCodeType = #{vo.notCodeType}
</if>
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from yb_not_code
where ybbm = #{ybbm,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.glxp.api.entity.basic.YbNotCode">
<!--@mbg.generated-->
insert into yb_not_code (ybbm, organizationCode, notCodeType
)
values (#{ybbm,jdbcType=VARCHAR}, #{organizationcode,jdbcType=VARCHAR}, #{notcodetype,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.glxp.api.entity.basic.YbNotCode">
<!--@mbg.generated-->
insert into yb_not_code
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ybbm != null">
ybbm,
</if>
<if test="organizationcode != null">
organizationCode,
</if>
<if test="notcodetype != null">
notCodeType,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ybbm != null">
#{ybbm,jdbcType=VARCHAR},
</if>
<if test="organizationcode != null">
#{organizationcode,jdbcType=VARCHAR},
</if>
<if test="notcodetype != null">
#{notcodetype,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.api.entity.basic.YbNotCode">
<!--@mbg.generated-->
update yb_not_code
<set>
<if test="organizationcode != null">
organizationCode = #{organizationcode,jdbcType=VARCHAR},
</if>
<if test="notcodetype != null">
notCodeType = #{notcodetype,jdbcType=VARCHAR},
</if>
</set>
where ybbm = #{ybbm,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.basic.YbNotCode">
<!--@mbg.generated-->
update yb_not_code
set organizationCode = #{organizationcode,jdbcType=VARCHAR},
notCodeType = #{notcodetype,jdbcType=VARCHAR}
where ybbm = #{ybbm,jdbcType=VARCHAR}
</update>
</mapper>
</mapper>

@ -148,4 +148,19 @@
order by case when icob.orderTime is null then icob.createTime else icob.orderTime end desc
</select>
<select id="getList" resultType="com.glxp.api.res.collect.IoCollectOrderResponse">
SELECT
bac.*,(SELECT sum(IF( relCodeCount > 0, relCodeCount, 1 )) FROM
io_collect_code_backup code_ba where code_ba.billNo = bac.billNo ) as relCodeCount
FROM
io_collect_order_backup bac
<where>
<if test="startTime != '' and startTime != null and endTime != '' and endTime != null">
AND bac.updateTime BETWEEN #{startTime} AND #{endTime}
</if>
</where>
</select>
</mapper>

@ -39,18 +39,5 @@
</where>
group by icobb.id
</select>
<select id="getList" resultType="com.glxp.api.res.collect.CollectOrderBizResponse">
SELECT
biz_bac.* ,bac.busType,bac.uploadStatus,code_ba.fifoSplit,code_ba.relCodeCount
FROM
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>

@ -5448,27 +5448,31 @@ CALL Pro_Temp_ColumnWork('io_collect_set', 'drugDealConfirm',
CALL Pro_Temp_ColumnWork('basic_udirel', 'manuReview',
'tinyint NULL DEFAULT b''0'' COMMENT ''是否已人工审核''', 1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'notCodeType',
' tinyint NULL DEFAULT b''0''COMMENT ''无码类型''',
' tinyint NULL DEFAULT b''0''COMMENT ''无码类型 0、默认不是无码类型1、部分早期未赋予追溯码5、最小包装无追溯码6、无追溯码7、其他原因''',
1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'drugSellingPrice',
' decimal(10, 2) DEFAULT NULL COMMENT ''药品售价''',
1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'drugSellingPriceTime',
' datetime DEFAULT NULL COMMENT ''药品售价''',
' datetime DEFAULT NULL COMMENT ''售价开始时间''',
1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'hangingNetType',
' tinyint DEFAULT NULL COMMENT ''是否挂网''',
' tinyint DEFAULT NULL COMMENT ''是否挂网 0 否 1 是''',
1);
CREATE TABLE IF NOT EXISTS `yb_not_code` (
`ybbm` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '国家医保目录编码',
`organizationCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '机构编码',
`notCodeType` tinyint DEFAULT NULL COMMENT '无码类型 1、部分早期未赋予追溯码 5、最小包装无追溯码 6、无追溯码 7、其他原因 0、默认不是无码类型',
`notCodeType` tinyint DEFAULT NULL COMMENT '无码类型 0、默认不是无码类型1、部分早期未赋予追溯码5、最小包装无追溯码6、无追溯码7、其他原因',
PRIMARY KEY (`ybbm`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='医保无码信息表';

Loading…
Cancel
Save