Merge branch 'dev_fifo' into dev_fifo_z

dev_fifo_z1
anthonywj 11 months ago
commit de0987058c

@ -161,12 +161,16 @@ public class LoginController extends BaseController {
if (authAdmin == null) {
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
}
if (!PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(SecureUtil.sha256(authAdmin.getPassWord()))) {
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
if (PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(PasswordUtils.authAdminPwd(authAdmin.getPassWord()))
|| loginRequest.getPassword().equals(authAdmin.getPassWord())
|| (loginRequest.getPassword().equals(PasswordUtils.authAdminPwd(authAdmin.getPassWord())))
) {
} else {
if (!PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(SecureUtil.sha256(authAdmin.getPassWord()))) {
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
}
}
// if (!PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(authAdmin.getPassWord())) {
// throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
// }
if (authAdmin.getUserFlag() == 0) {
throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!");
}

@ -409,7 +409,7 @@ public class IoCodeTempController extends BaseController {
// }
if (bussinessTypeEntity != null && udiInfoEntity != null) {
//是否校验耗材材质 1高值耗材2.普通耗材
if (IntUtil.value(bussinessTypeEntity.getVailHcType() )== 1) {
if (IntUtil.value(bussinessTypeEntity.getVailHcType()) == 1) {
}
if (IntUtil.value(udiInfoEntity.getHcType()) != 1) {
return ResultVOUtils.error(500, "单据只允许录入高值耗材" + ",请检查后重试!");
@ -421,11 +421,11 @@ public class IoCodeTempController extends BaseController {
}
//是否开启校验扫码 0:不校验1:只允许录入扫码产品2:只允许录入不扫码产品
if (IntUtil.value(bussinessTypeEntity.getCodeCheck() == 1)){
if (IntUtil.value(bussinessTypeEntity.getCodeCheck() == 1)) {
if (IntUtil.value(udiInfoEntity.getRequireScanCode()) != 1) {
return ResultVOUtils.error(500, "单据只允许录入需要扫码产品" + ",请检查后重试!");
}
}else if (IntUtil.value(bussinessTypeEntity.getCodeCheck() == 2)) {
} else if (IntUtil.value(bussinessTypeEntity.getCodeCheck() == 2)) {
if (IntUtil.value(udiInfoEntity.getRequireScanCode()) != 0) {
return ResultVOUtils.error(500, "单据只允许录入不需要扫码产品" + ",请检查后重试!");
}
@ -433,7 +433,6 @@ public class IoCodeTempController extends BaseController {
}
String orderId = addOrderRequest.getBillNo();
//三期校验

@ -763,6 +763,7 @@ public class IoOrderController extends BaseController {
}
//单据编辑,条码减一
@AuthRuleAnnotation("")
@PostMapping("udiwms/inout/code/finish/delete")

@ -6,11 +6,17 @@ import com.glxp.api.entity.thrsys.ThrInvOrderDetail;
import com.glxp.api.req.thrsys.FilterThrInvOrderRequest;
import com.glxp.api.res.thrsys.ThrInvOrderResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
@Mapper
public interface ThrInvOrderMapper extends BaseMapperPlus<ThrInvOrderMapper, ThrInvOrder, ThrInvOrder> {
List<ThrInvOrderResponse> filterThrInvOrder(FilterThrInvOrderRequest filterThrInvOrderRequest);
@Select("SELECT COUNT(*) FROM thr_inv_order WHERE startDate <= #{startDate} AND endDate >= #{endDate}")
int countDownloadsInRange(Date startDate, Date endDate);
}

@ -111,4 +111,4 @@ public class InvRemindSetEntity {
", 备注:='" + remark + '\'' +
'}';
}
}
}

@ -216,4 +216,9 @@ public class FilterOrderRequest extends ListPageRequest {
private String sickerAdNum;
private List<String> sickerAdNums;
/**
* 12
*/
private Integer invoiceRegStatus;
}

@ -46,6 +46,7 @@ import com.glxp.api.service.inout.IoAddInoutService;
import com.glxp.api.service.inout.IoCheckInoutService;
import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.inv.impl.InvProductService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.service.thrsys.ThrInvOrderService;
import com.glxp.api.service.thrsys.ThrSystemBusApiService;
@ -61,6 +62,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -336,8 +338,13 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
filterInvProductRequest.setStartDate(stringToDate(days + " 00:00:00"));
filterInvProductRequest.setEndDate(stringToDate(days + " 23:59:59"));
handleExternalThrInvSfOrder(filterInvProductRequest);
log.info("自动抓取第三方收费出入库明细生成单据定时任务结束");
if (thrInvOrderMapper.countDownloadsInRange(filterInvProductRequest.getStartDate(), filterInvProductRequest.getEndDate()) <= 0) {
handleExternalThrInvSfOrder(filterInvProductRequest);
log.info("自动抓取第三方收费出入库明细生成单据定时任务结束");
} else {
log.info("已下载户略");
}
}
@ -703,9 +710,10 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
//校验产品是否被供应商关联
CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId);
if (udiRlSupEntity != null)
if (udiRlSupEntity != null) {
item.setPrice(udiRlSupEntity.getPrice());
item.setSupId(udiRlSupEntity.getCustomerId());
else
} else
exmsg.append(thrCode + "供应商未关联");
} else {
exmsg.append(thrCode + ",");
@ -841,22 +849,12 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
if (CollUtil.isNotEmpty(thrInvOrders)) {
for (ThrInvOrder thrInvOrder : thrInvOrders) {
/**
* 1
* 2
* 3
* 4
*/
List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList(
new LambdaQueryWrapper<ThrInvOrderDetail>()
.and(o -> o.isNull(ThrInvOrderDetail::getHandleStatus).or().ne(ThrInvOrderDetail::getHandleStatus, 1)).
eq(ThrInvOrderDetail::getOrderIdFk, thrInvOrder.getBillNo())
);
if (CollectionUtil.isEmpty(thrInvOrderDetails)) continue;
log.info("扫描处理第三方收费明细生成单据定时任务==orderIdFk==:[" + thrInvOrder.getBillNo() + "]");
//新单号
//通过单号获取单据信息
QueryWrapper<ThrInvOrder> qw = new QueryWrapper<>();
qw.eq("billNo", thrInvOrder.getBillNo());
@ -895,6 +893,8 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
});
fullGen.getAndIncrement();
}
} else {
updateThrInvOrderDetails.add(item);
}
});
if (thrInvOrderDetails.size() == fullGen.intValue()) {
@ -944,23 +944,24 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
//新增明细
if (CollectionUtil.isNotEmpty(addThrInvOrderDetails)) {
thrInvOrderDetailMapper.insertBatch(addThrInvOrderDetails);
genOrder(thrInvOrder, bussinessTypeEntity, addThrInvOrderDetails);
}
//更新明细
if (CollectionUtil.isNotEmpty(updateThrInvOrderDetails)) {
thrInvOrderDetailMapper.updateBatchById(updateThrInvOrderDetails);
genOrder(thrInvOrder, bussinessTypeEntity, updateThrInvOrderDetails);
}
genOrder(thrInvOrder, bussinessTypeEntity);
log.info("扫描处理第三方收费明细生成单据定时任务结束");
}
}
}
public boolean genOrder(
ThrInvOrder thrInvOrder, BasicBussinessTypeEntity bussinessTypeEntity) {
QueryWrapper<ThrInvOrderDetail> qwd = new QueryWrapper<>();
qwd.eq("orderIdFk", thrInvOrder.getBillNo());
List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList(qwd);
ThrInvOrder thrInvOrder, BasicBussinessTypeEntity bussinessTypeEntity, List<ThrInvOrderDetail> thrInvOrderDetails) {
// QueryWrapper<ThrInvOrderDetail> qwd = new QueryWrapper<>();
// qwd.eq("orderIdFk", thrInvOrder.getBillNo());
// List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList(qwd);
if (CollectionUtil.isEmpty(thrInvOrderDetails))
return false;
@ -995,7 +996,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
ioOrderEntity.setCorpOrderId(UUID.randomUUID() + "");//单据号
ioOrderEntity.setThrOrderIdFk(thrInvOrder.getBillNo());//单据号
ioOrderEntity.setUpdateTime(new Date());
ioOrderEntity.setCreateTime(new Date());
if (thrInvOrder.getStartDate() != null) {
ioOrderEntity.setCreateTime(new Date());
}
ioOrderEntity.setCustomerId("110");
Long userId = 1l;
// try {
@ -1003,13 +1006,13 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
// } catch (Exception e) {
// e.printStackTrace();
// }
ioOrderEntity.setCreateUser(userId + "");
ioOrderEntity.setUpdateUser(userId + "");
ioOrderEntity.setCreateUser(userId + "");
ioOrderEntity.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);//正常单据处理
List<IoOrderDetailBizEntity> newOrderDetailBiz = new ArrayList<>();
if (entry.getValue().size() > 0) {
if (!copyOrderDetailBiz(entry.getValue(), newOrderDetailBiz, newBillNo)) {
continue;
continue;
}
}
String toBillNo = (thrInvOrder.getToBillNo() == null ? "" : thrInvOrder.getToBillNo()) + ("," + newBillNo);
@ -1018,6 +1021,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
// 使用substring()去掉第一个字符
toBillNo = toBillNo.substring(1);
}
thrInvOrderDetailMapper.updateBatchById(thrInvOrderDetails);
thrInvOrder.setToBillNo(toBillNo);
thrInvOrderMapper.updateById(thrInvOrder);
ioOrderService.insertOrder(ioOrderEntity);
@ -1110,11 +1114,13 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
item.setRelId(relId);
item.setHandleStatus(1);
item.setToBillNo(newBillNo);
updateThrInvOrderDetails.add(item);
//校验产品是否被供应商关联
CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId);
if (udiRlSupEntity != null)
if (udiRlSupEntity != null) {
item.setSupId(udiRlSupEntity.getCustomerId());
}
} else {
}
}
@ -1183,6 +1189,11 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
thrInvOrder.setToBillNo(toBillNo);
thrInvOrderMapper.updateById(thrInvOrder);
thrInvOrderDetails.forEach(item -> {
item.setToBillNo(newBillNo);
}
);
thrInvOrderDetailMapper.updateBatchById(thrInvOrderDetails);
ioOrderService.insertOrder(ioOrderEntity);
ioOrderDetailBizService.batchInsertBizs(newOrderDetailBiz);
//自动处理业务单据
@ -1337,10 +1348,12 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();
parameterPackag(basicProductsEntity, ioOrderDetailBizEntity, thrInvOrderDetail);
ioOrderDetailBizEntity.setOrderIdFk(newBillNo);
ioOrderDetailBizEntity.setBatchNo("/");
thrInvOrderDetail.setToBillNo(newBillNo);
thrInvOrderDetail.setHandleStatus(1);
newOrderDetailBiz.add(ioOrderDetailBizEntity);
}
}
}
return true;
}
@ -1451,6 +1464,10 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
}
@Resource
InvProductService invProductService;
/**
*
*
@ -1487,15 +1504,31 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
thrInvOrderDetail.setRelId(relId);
thrInvOrderDetail.setThrCode(thrCode);
thrInvOrderDetail.setReCount(String.valueOf(count));
thrInvOrderDetails.add(thrInvOrderDetail);
if (ObjectUtil.isNull(relId)) {
exmsg.append(thrCode + ",");
}
//校验产品是否被供应商关联
CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId);
if (udiRlSupEntity != null)
thrInvOrderDetail.setSupId(udiRlSupEntity.getCustomerId());
else
List<UdiRlSupEntity> udiRlSupEntitys = udiRlSupService.findByUdiRlId(relId);
if (CollUtil.isNotEmpty(udiRlSupEntitys)) {
for (UdiRlSupEntity udiRlSupEntity : udiRlSupEntitys) {
Integer count1 = invProductService.selectExitCount("1000000", Long.parseLong(udiRlSupEntity.getCustomerId()), Long.parseLong(udiRlSupEntity.getUdiRlIdFk()));
if (IntUtil.value(count1 > 0)) {
thrInvOrderDetail.setSupId(udiRlSupEntity.getCustomerId());
if (udiRlSupEntity.getPrice() == null)
thrInvOrderDetail.setPrice(BigDecimal.ZERO);
else
thrInvOrderDetail.setPrice(udiRlSupEntity.getPrice());
}
}
if (thrInvOrderDetail.getSupId() == null) {
thrInvOrderDetail.setSupId(udiRlSupEntitys.get(0).getCustomerId());
if (udiRlSupEntitys.get(0).getPrice() == null)
thrInvOrderDetail.setPrice(BigDecimal.ZERO);
else
thrInvOrderDetail.setPrice(udiRlSupEntitys.get(0).getPrice());
}
} else
exmsg.append(thrCode + "供应商未关联");
@ -1518,7 +1551,6 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
} else {//走项目组套
thrInvOrder.setSkProject(1);
StringBuilder exmsg = new StringBuilder("");
list.forEach(item -> {
@ -1533,24 +1565,24 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
//通过thrCode获取到项目组套
List<BasicSkProjectDetailEntity> skProjectDetailEntityList = basicDestinyRelService.filterDestinyRelListByPId(thrCode);
if (CollectionUtil.isNotEmpty(skProjectDetailEntityList) && count > 0) {
Integer finalCount = count;
if (IntUtil.value(cpMutiFilter) > 0 && IntUtil.value(finalCount) > 1) {
log.error(item.getCpmctymc() + "," + item.getThrCode() + "项目关联多个耗材对照,已过滤!");
if (IntUtil.value(cpMutiFilter) > 0 && skProjectDetailEntityList.size() > 1) {
log.error(item.getCpmctymc() + "," + item.getThrCode() + "项目关联多个耗材对照,已过滤!");
} else {
skProjectDetailEntityList.forEach(sk -> {
ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail();
BeanUtils.copyProperties(item, thrInvOrderDetail);
thrInvOrderDetail.setOrderIdFk(billNo);
thrInvOrderDetail.setRelId(sk.getRelId());
thrInvOrderDetail.setSupId(sk.getSupId() + "");
UdiRlSupEntity udiRlSupEntity = udiRlSupService.findByUdiRlIdUnitFk(thrInvOrderDetail.getRelId() + "", thrInvOrderDetail.getSupId());
if (udiRlSupEntity != null && udiRlSupEntity.getPrice() != null) {
thrInvOrderDetail.setPrice(udiRlSupEntity.getPrice());
}
Integer skCount = sk.getCount();
if (skCount != null && skCount > 0) {
thrInvOrderDetail.setReCount(String.valueOf(skCount * finalCount));
}
//过滤是否高值
if (IntUtil.value(highFilter) > 0) {
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(sk.getRelId());
@ -1560,7 +1592,6 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
} else {
thrInvOrderDetails.add(thrInvOrderDetail);
}
});
}

@ -110,59 +110,64 @@ public class SyncThirdSysTask implements SchedulingConfigurer {
List<ThrSystemDetailEntity> list = thrSystemDetailDao.selectAutoExecuteList();
if (CollUtil.isNotEmpty(list)) {
log.info("本次查询到的接口列表数量:{}", list.size());
list.parallelStream().forEach(thrSystemDetailEntity -> {
switch (thrSystemDetailEntity.getKey()) {
case ThirdSysConstant.WAREHOUSE_QUERY_URL:
//下载第三方仓库信息
downloadThrInv(thrSystemDetailEntity);
break;
case ThirdSysConstant.CORP_URL:
//下载往来单位信息
downloadThrCorp(thrSystemDetailEntity);
break;
case ThirdSysConstant.PI_QUERY_URL:
//下载第三方产品信息
downloadThrPi(thrSystemDetailEntity);
break;
case ThirdSysConstant.BUS_TYPE_QUERY_URL:
//下载第三方单据类型
downloadThrBusType(thrSystemDetailEntity);
break;
case ThirdSysConstant.ORDER_SUBMIT_URL:
//提交单据
submitOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.ORDER_QUERY_URL:
downloadThrOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.PI_SUBMIT_URL:
//提交产品信息
postRelProduct(thrSystemDetailEntity);
break;
case ThirdSysConstant.SICKER_QUERY_URL:
//下载患者信息
downloadSicker(thrSystemDetailEntity);
break;
case ThirdSysConstant.INV_SF_ORDER_QUERY_URL:
//下载出入库明细收费
downloadInvSfOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.INV_PH_ORDER_QUERY_URL:
//下载出入库明细普耗
downloadInvPhOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.INV_GH_ORDER_QUERY_URL:
//下载出入库明细高耗
downloadInvGhOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.SF_PROJECT_DICT_URL:
//下载收费项目字典
downloadSfProject(thrSystemDetailEntity);
break;
default:
//其他接口暂不处理
break;
list.forEach(thrSystemDetailEntity -> {
try {
switch (thrSystemDetailEntity.getKey()) {
case ThirdSysConstant.WAREHOUSE_QUERY_URL:
//下载第三方仓库信息
downloadThrInv(thrSystemDetailEntity);
break;
case ThirdSysConstant.CORP_URL:
//下载往来单位信息
downloadThrCorp(thrSystemDetailEntity);
break;
case ThirdSysConstant.PI_QUERY_URL:
//下载第三方产品信息
downloadThrPi(thrSystemDetailEntity);
break;
case ThirdSysConstant.BUS_TYPE_QUERY_URL:
//下载第三方单据类型
downloadThrBusType(thrSystemDetailEntity);
break;
case ThirdSysConstant.ORDER_SUBMIT_URL:
//提交单据
submitOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.ORDER_QUERY_URL:
downloadThrOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.PI_SUBMIT_URL:
//提交产品信息
postRelProduct(thrSystemDetailEntity);
break;
case ThirdSysConstant.SICKER_QUERY_URL:
//下载患者信息
downloadSicker(thrSystemDetailEntity);
break;
case ThirdSysConstant.INV_SF_ORDER_QUERY_URL:
//下载出入库明细收费
downloadInvSfOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.INV_PH_ORDER_QUERY_URL:
//下载出入库明细普耗
downloadInvPhOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.INV_GH_ORDER_QUERY_URL:
//下载出入库明细高耗
downloadInvGhOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.SF_PROJECT_DICT_URL:
//下载收费项目字典
downloadSfProject(thrSystemDetailEntity);
break;
default:
//其他接口暂不处理
break;
}
} catch (Exception e) {
log.error("执行第三方接口异常:{}", ExceptionUtils.getStackTrace(e));
}
});
} else {
log.info("未配置自动执行的第三方接口列表");

@ -4,7 +4,7 @@ server:
spring:
datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt2?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
hikari:

@ -550,7 +550,7 @@
</where>
</select>
<!-- LEFT JOIN io_order_detail_code dc ON io.billNo = dc.orderIdFk-->
<select id="getfilterOrderList" resultType="com.glxp.api.res.inout.IoOrderResponse">
SELECT io.*,
bus.NAME AS billTypeName,
@ -562,7 +562,7 @@
LEFT JOIN auth_dept ad ON io.deptCode = ad.CODE
LEFT JOIN auth_warehouse aw ON io.invCode = aw.CODE
LEFT JOIN basic_corp bc ON io.fromCorp = bc.erpId
LEFT JOIN io_order_detail_code dc ON io.billNo = dc.orderIdFk
left join io_order_invoice on io_order_invoice.orderIdFk = io.billNo
<where>
<if test="confirmStatus != null and confirmStatus != ''">
AND io.checkStatus = #{confirmStatus}
@ -605,6 +605,13 @@
<if test="inCodeStatus != null">
AND io.inCodeStatus = #{inCodeStatus}
</if>
<if test="invoiceRegStatus != null and invoiceRegStatus == 1">
AND io_order_invoice.id IS NULL
</if>
<if test="invoiceRegStatus != null and invoiceRegStatus == 2">
AND io_order_invoice.id IS not NULL
</if>
<if test="relKey != null">
AND io.relKey like concat('%', #{relKey}, '%')
</if>

Loading…
Cancel
Save