中医院接口调整,平潭医院接口修改,日志打印等

dev
anthonywj 1 year ago
parent 475d1b4469
commit 659e0879ea

@ -1,6 +1,7 @@
package com.glxp.mipsdl.aspect;
import cn.hutool.core.exceptions.ExceptionUtil;
import com.alibaba.fastjson2.JSONObject;
import com.glxp.mipsdl.service.system.SysErpLogService;
import lombok.extern.slf4j.Slf4j;
@ -38,7 +39,7 @@ public class LogAspect {
}
@Around("execute()")
public Object doAround(ProceedingJoinPoint point) throws Throwable {
public Object doAround(ProceedingJoinPoint point) {
Date createTime = new Date();
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
@ -69,7 +70,13 @@ public class LogAspect {
long beginTime = System.currentTimeMillis();
log.info("请求URI:{},方法:{},参数:{}", uri, method, params);
Object proceed = point.proceed();
Object proceed = null;
try {
proceed = point.proceed();
} catch (Throwable throwable) {
throwable.printStackTrace();
log.error(ExceptionUtil.stacktraceToString(throwable));
}
String result = JSONObject.toJSONString(proceed);
log.info("请求结束,返回参数:{}", result);
@ -99,7 +106,7 @@ public class LogAspect {
val = f.get(object);
map.put(f.getName(), val);
} catch (Exception e) {
log.error(e.getMessage(), e);
log.error(ExceptionUtil.stacktraceToString(e));
}
}
return map;

@ -153,7 +153,7 @@ public class PhxyyClient implements BaseHttpClient {
BeanUtil.copyProperties(udiwmsOrderRequest, phOrderRequest);
//查询单据和详情信息,组装第三方系统接口参数
IoOrderEntity orderEntity = orderDao.selectOne(new LambdaQueryWrapper<IoOrderEntity>().eq(IoOrderEntity::getBillNo, udiwmsOrderRequest.getBillNo()));
IoOrderEntity orderEntity = orderDao.selectOne(new LambdaQueryWrapper<IoOrderEntity>().eq(IoOrderEntity::getBillNo, udiwmsOrderRequest.getBillNo()).last("limit 1"));
phOrderRequest.setBillDate(DateUtil.formatDateTime(orderEntity.getCreateTime()));
//查询对应的第三方单据类型
ThrSystemBusApiEntity thrSystemBusApiEntity = thrSystemBusApiDao.selectOne(new LambdaQueryWrapper<ThrSystemBusApiEntity>().eq(ThrSystemBusApiEntity::getCode, udiwmsOrderRequest.getBillType()));
@ -189,8 +189,8 @@ public class PhxyyClient implements BaseHttpClient {
BasicCorpEntity basicCorpEntity = basicCorpDao.selectByErpId(orderEntity.getFromCorp());
if (null != basicCorpEntity) {
udiwmsOrderRequest.setCorpId(basicCorpEntity.getThirdId());
udiwmsOrderRequest.setCorpName(basicCorpEntity.getName());
phOrderRequest.setCorpId(basicCorpEntity.getThirdId());
phOrderRequest.setCorpName(basicCorpEntity.getName());
} else {
String msg = "查询单据对应的第三方往来单位信息异常";
orderUploadLogService.updateLocalErr(orderEntity, msg);
@ -316,6 +316,15 @@ public class PhxyyClient implements BaseHttpClient {
item.setFirstSalesInvNo(fphm);
item.setInvoiceDate(fprq);
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT) && StrUtil.isEmpty(fphm)) {
uploadLog.setStatus(3);
String errMsg = "提交失败,错误信息:" + stockOrderDetailEntity.getCoName() + "发票缺失,请补齐后重新提交";
uploadLog.setResult(errMsg);
orderUploadLogService.insertOrUpdate(uploadLog);
return ResultVOUtils.error(500, errMsg);
}
ThrProductsEntity thrProductsEntity = thrProductsDao.selectOne(new QueryWrapper<ThrProductsEntity>().eq("code", udiRelevanceEntity.getMainId()).last("limit 1"));
if (StrUtil.isEmpty(udiRelevanceEntity.getMainId()) || thrProductsEntity == null || StrUtil.isEmpty(thrProductsEntity.getCode())) {
uploadLog.setStatus(3);

@ -191,7 +191,9 @@ public class PtxhyyClient extends CommonHttpClient {
List<IoOrderDetailBizEntity> detailBizEntities = orderDetailBizDao.selectList(new LambdaQueryWrapper<IoOrderDetailBizEntity>().eq(IoOrderDetailBizEntity::getOrderIdFk, orderEntity.getBillNo()));
//单据金额
BigDecimal djje = detailBizEntities.stream().map(IoOrderDetailBizEntity::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal djje = detailBizEntities.stream()
.filter(x -> x.getPrice() != null).
map(IoOrderDetailBizEntity::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
List<IoOrderInvoiceEntity> ioOrderInvoiceEntities = IoOrderInvoiceEntity.builder().build()
.selectList(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class).eq(IoOrderInvoiceEntity::getOrderIdFk, orderEntity.getBillNo()).groupBy(IoOrderInvoiceEntity::getInvoiceEncode));
int fbbz = 0;
@ -258,7 +260,9 @@ public class PtxhyyClient extends CommonHttpClient {
}
}
// .udim(udim)
BigDecimal wzje = i.getPrice().multiply(BigDecimal.valueOf(i.getCount().intValue()));
BigDecimal wzje = null;
if (i.getPrice() != null)
wzje = i.getPrice().multiply(BigDecimal.valueOf(i.getCount().intValue()));
PtxhyyOrderDetailRequest detailRequest = PtxhyyOrderDetailRequest.builder()
.wzxh(i.getProductId())
.cjxh(i.getManufactoryCode())

@ -19,10 +19,7 @@ import com.glxp.mipsdl.dao.auth.AuthWarehouseDao;
import com.glxp.mipsdl.dao.auth.AuthWarehouseUserMapper;
import com.glxp.mipsdl.dao.basic.BasicBussinessTypeDao;
import com.glxp.mipsdl.dao.basic.BasicCorpDao;
import com.glxp.mipsdl.dao.inout.IoCodeDao;
import com.glxp.mipsdl.dao.inout.IoOrderDao;
import com.glxp.mipsdl.dao.inout.IoOrderDetailBizDao;
import com.glxp.mipsdl.dao.inout.IoOrderUploadLogDao;
import com.glxp.mipsdl.dao.inout.*;
import com.glxp.mipsdl.dao.thrsys.ThrInvWarehouseDao;
import com.glxp.mipsdl.dao.thrsys.ThrSystemBusApiDao;
import com.glxp.mipsdl.entity.auth.AuthUserEntity;
@ -48,6 +45,7 @@ import com.glxp.mipsdl.service.auth.AuthWarehouseService;
import com.glxp.mipsdl.service.thrsys.ThrCorpService;
import com.glxp.mipsdl.service.thrsys.ThrSystemDetailService;
import com.glxp.mipsdl.util.DateUtil;
import com.glxp.mipsdl.util.IntUtil;
import com.glxp.mipsdl.util.ResultVOUtils;
import com.glxp.mipsdl.util.SubmitOrderUtil;
import lombok.extern.slf4j.Slf4j;
@ -100,6 +98,10 @@ public class ZzzyyClient implements BaseHttpClient {
private ThrCorpService thrCorpService;
@Resource
private IoOrderDetailBizDao orderDetailBizDao;
@Resource
private IoOrderDetailCodeDao orderDetailCodeDao;
@Resource
private IoOrderUploadLogDao orderUploadLogDao;
@Resource
@ -447,6 +449,7 @@ public class ZzzyyClient implements BaseHttpClient {
}
}
/**
*
*
@ -456,11 +459,21 @@ public class ZzzyyClient implements BaseHttpClient {
*/
private void setOrderDetailList(List<IoCodeEntity> ioCodeEntities, List<UdiwmsOrderDetailRequest> orderDetailRequests, List<IoOrderDetailBizEntity> detailBizEntities) {
for (IoOrderDetailBizEntity detailBizEntity : detailBizEntities) {
UdiwmsOrderDetailRequest item = submitOrderUtil.buildProductInfo(detailBizEntity);
if (item != null) {
//封装条码信息
submitOrderUtil.setCodeList(ioCodeEntities, detailBizEntity, item);
orderDetailRequests.add(item);
IoOrderDetailCodeEntity orderDetailCodeEntity = orderDetailCodeDao
.selectOne(new QueryWrapper<IoOrderDetailCodeEntity>()
.eq("orderIdFk", detailBizEntity.getOrderIdFk())
.eq("bindRlFk", detailBizEntity.getBindRlFk())
.eq(StrUtil.isNotEmpty(detailBizEntity.getBatchNo()), "batchNo", detailBizEntity.getBatchNo())
.isNull(StrUtil.isEmpty(detailBizEntity.getBatchNo()), "batchNo").last("LIMIT 1"));
if (orderDetailCodeEntity != null && IntUtil.value(orderDetailCodeEntity.getReCount()) > 0) {
detailBizEntity.setCount(orderDetailCodeEntity.getReCount());
UdiwmsOrderDetailRequest item = submitOrderUtil.buildProductInfo(detailBizEntity);
if (item != null) {
//封装条码信息
submitOrderUtil.setCodeList(ioCodeEntities, detailBizEntity, item);
orderDetailRequests.add(item);
}
}
}
}

@ -1,7 +1,7 @@
spring:
datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_ph?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
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
username: root
password: 123456
hikari:

Loading…
Cancel
Save