供应商注册无更新时间,新增排序规则,倒序正序,仓库问题

master
anthonywj 2 years ago
parent ff1f825b39
commit 2a7fe6c1e9

@ -361,6 +361,7 @@ public class RegisterController {
basicUnitMaintainEntity1.setAddr(userRegisterEntity.getArea() + userRegisterEntity.getDetailAddr());
basicUnitMaintainEntity1.setContact(userRegisterEntity.getRealName());
basicUnitMaintainEntity1.setMobile(userRegisterEntity.getMobile());
basicUnitMaintainEntity1.setUpdateTime(new Date());
basicUnitMaintainService.insertBasicUnitMaintain(basicUnitMaintainEntity1);
customerId = Long.parseLong(basicUnitMaintainEntity1.getErpId());
registerCheckRequest.setCompanyId(basicUnitMaintainEntity1.getErpId());

@ -31,7 +31,9 @@ import com.glxp.api.entity.thrsys.*;
import com.glxp.api.req.sync.SpsSyncDataRequest;
import com.glxp.api.req.sync.SyncUpLoadRequest;
import com.glxp.api.res.sync.*;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.basic.IBasicBusTypeChangeService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.inout.IoAddInoutService;
import com.glxp.api.service.inout.IoCheckInoutService;
import com.glxp.api.service.inout.IoOrderService;
@ -603,6 +605,10 @@ public class SpsSyncDownloadController {
IoOrderDetailResultDao orderDetailResultDao;
@Resource
IoOrderInvoiceMapper orderInvoiceMapper;
@Resource
IBasicBussinessTypeService basicBussinessTypeService;
@Resource
InvWarehouseService invWarehouseService;
//接收中继服务、UDI管理系统上传单据
@AuthRuleAnnotation("sps/sync/order/upload")
@ -619,101 +625,116 @@ public class SpsSyncDownloadController {
basicDownloadService.insertDownloadStatus(basicDownloadStatusEntity);
StringBuffer remark = new StringBuffer();
if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities())) {
try {
List<IoOrderEntity> orderEntities = syncDataResponse.getOrderEntities();
for (IoOrderEntity orderEntity : orderEntities) {
orderEntity.setUpdateTime(null);
orderEntity.setFromType(ConstantStatus.FROM_UDISP);
orderEntity.setProcessStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
IoOrderEntity temp = orderService.findById(orderEntity.getBillNo());
if (temp == null) {
orderEntity.setId(null);
orderDao.insert(orderEntity);
//更新码详情
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
List<IoCodeEntity> warehouseEntityList = syncDataResponse.getCodeEntities();
for (IoCodeEntity warehouseEntity : warehouseEntityList) {
if (warehouseEntity.getOrderId().equals(orderEntity.getBillNo())) {
IoCodeTempEntity codeTempEntity = new IoCodeTempEntity();
BeanUtils.copyProperties(warehouseEntity, codeTempEntity);
codeTempEntity.setId(null);
codeMappert.insert(codeTempEntity);
}
List<IoOrderEntity> orderEntities = syncDataResponse.getOrderEntities();
for (IoOrderEntity orderEntity : orderEntities) {
orderEntity.setUpdateTime(null);
orderEntity.setFromType(ConstantStatus.FROM_UDISP);
orderEntity.setProcessStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
IoOrderEntity temp = orderService.findById(orderEntity.getBillNo());
if (temp == null) {
// 过滤使用出库单,转换成一级库出库单(条件:往来类型为客户信息,出入库类型为出库,仓库类型为入账库,是否更改库存为是
BasicBussinessTypeEntity basicBussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
if (basicBussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_INPUT
&& basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)
&& basicBussinessTypeEntity.isInStock() && basicBussinessTypeEntity.getActionType() == 1) {
// orderEntity.getInvCode()
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(orderEntity.getInvCode());
InvWarehouseEntity parentInv = invWarehouseService.findOneLevel(invWarehouseEntity.getParentCode());
if (parentInv == null)
parentInv = invWarehouseEntity;
orderEntity.setInvCode(parentInv.getCode());
orderEntity.setDeptCode(parentInv.getParentId());
orderEntity.setFromCorp("科室使用出库");
}
orderEntity.setId(null);
orderDao.insert(orderEntity);
//更新码详情
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
List<IoCodeEntity> warehouseEntityList = syncDataResponse.getCodeEntities();
for (IoCodeEntity warehouseEntity : warehouseEntityList) {
if (warehouseEntity.getOrderId().equals(orderEntity.getBillNo())) {
IoCodeTempEntity codeTempEntity = new IoCodeTempEntity();
BeanUtils.copyProperties(warehouseEntity, codeTempEntity);
codeTempEntity.setId(null);
codeMappert.insert(codeTempEntity);
}
}
}
//更新业务详情
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailBizEntities())) {
List<IoOrderDetailBizEntity> orderDetailBizEntities = syncDataResponse.getOrderDetailBizEntities();
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
if (bizEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
bizEntity.setId(null);
orderDetailBizDao.insert(bizEntity);
}
//更新业务详情
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailBizEntities())) {
List<IoOrderDetailBizEntity> orderDetailBizEntities = syncDataResponse.getOrderDetailBizEntities();
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
if (bizEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
bizEntity.setId(null);
orderDetailBizDao.insert(bizEntity);
}
}
}
//更新码详情
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = syncDataResponse.getOrderDetailCodeEntities();
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
if (codeEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
codeEntity.setId(null);
orderDetailCodeDao.insert(codeEntity);
}
//更新码详情
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = syncDataResponse.getOrderDetailCodeEntities();
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
if (codeEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
codeEntity.setId(null);
orderDetailCodeDao.insert(codeEntity);
}
}
}
//更新结果详情
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailResultEntities())) {
List<IoOrderDetailResultEntity> orderDetailResultEntities = syncDataResponse.getOrderDetailResultEntities();
for (IoOrderDetailResultEntity detailResultEntity : orderDetailResultEntities) {
if (detailResultEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
detailResultEntity.setId(null);
orderDetailResultDao.insert(detailResultEntity);
}
//更新结果详情
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailResultEntities())) {
List<IoOrderDetailResultEntity> orderDetailResultEntities = syncDataResponse.getOrderDetailResultEntities();
for (IoOrderDetailResultEntity detailResultEntity : orderDetailResultEntities) {
if (detailResultEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
detailResultEntity.setId(null);
orderDetailResultDao.insert(detailResultEntity);
}
}
}
//更新发票信息
if (CollUtil.isNotEmpty(syncDataResponse.getOrderInvoiceEntities())) {
List<IoOrderInvoiceEntity> orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities();
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
orderInvoiceEntity.setId(IdUtil.getSnowflakeNextId());
orderInvoiceMapper.insert(orderInvoiceEntity);
}
//更新发票信息
if (CollUtil.isNotEmpty(syncDataResponse.getOrderInvoiceEntities())) {
List<IoOrderInvoiceEntity> orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities();
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
orderInvoiceEntity.setId(IdUtil.getSnowflakeNextId());
orderInvoiceMapper.insert(orderInvoiceEntity);
}
}
}
orderEntity = orderService.findByBillNo(orderEntity.getBillNo());
addInoutService.dealProcess(orderEntity);
orderEntity = orderService.findByBillNo(orderEntity.getBillNo());
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATS_ERROR && !ioCheckInoutService.checkManual(orderEntity.getBillNo())) {
ioCheckInoutService.check(orderEntity.getBillNo());
}
orderEntity = orderService.findByBillNo(orderEntity.getBillNo());
addInoutService.dealProcess(orderEntity);
orderEntity = orderService.findByBillNo(orderEntity.getBillNo());
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATS_ERROR && !ioCheckInoutService.checkManual(orderEntity.getBillNo())) {
ioCheckInoutService.check(orderEntity.getBillNo());
}
}
String logs = "";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities()))
logs = logs + "单据:" + syncDataResponse.getOrderEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailBizEntities()))
logs = logs + "业务详情:" + syncDataResponse.getOrderDetailBizEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities()))
logs = logs + "单据扫码详情:" + syncDataResponse.getOrderDetailCodeEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailResultEntities()))
logs = logs + "单据结果详情:" + syncDataResponse.getOrderDetailResultEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getCodeEntities()))
logs = logs + "单据条码信息:" + syncDataResponse.getCodeEntities().size() + "条\n";
remark.append(logs);
} catch (Exception e) {
e.printStackTrace();
}
String logs = "";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities()))
logs = logs + "单据:" + syncDataResponse.getOrderEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailBizEntities()))
logs = logs + "业务详情:" + syncDataResponse.getOrderDetailBizEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities()))
logs = logs + "单据扫码详情:" + syncDataResponse.getOrderDetailCodeEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailResultEntities()))
logs = logs + "单据结果详情:" + syncDataResponse.getOrderDetailResultEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getCodeEntities()))
logs = logs + "单据条码信息:" + syncDataResponse.getCodeEntities().size() + "条\n";
remark.append(logs);
}
String fileFullPath = null;
try {

@ -96,4 +96,7 @@ public interface InvWarehouseService {
List<InvWarehouseEntity> selectLowWarehouseAll(String pCode);
InvWarehouseEntity findOneLevel(String code);
}

@ -255,4 +255,21 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
public List<InvWarehouseEntity> selectLowWarehouseAll(String pCode) {
return invWarehouseDao.selectLowWarehouseAll(pCode);
}
@Override
public InvWarehouseEntity findOneLevel(String code) {
int index = 1;
while (index < 6) { //仓库层级一般不会超过5级
InvWarehouseEntity invWarehouseEntity = findByInvSubByCode(code);
if (invWarehouseEntity != null) {
if (StrUtil.isEmpty(invWarehouseEntity.getParentCode()))
return invWarehouseEntity;
else {
code = invWarehouseEntity.getParentCode();
index++;
}
}
}
return null;
}
}

@ -121,7 +121,8 @@ public class IoAddInoutService {
basicCorpEntity.setOutType(ConstantStatus.CORP_SICK_SICK);
basicCorpEntity.setName(orderEntity.getFromCorp());
basicCorpEntity.setId(IdUtil.getSnowflakeNextId());
basicCorpService.insertBasicUnitMaintain(basicCorpEntity);
basicCorpEntity.setUpdateTime(new Date());
basicCorpService.insert(basicCorpEntity);
}
orderEntity.setFromCorp(basicCorpEntity.getErpId());

@ -20,4 +20,7 @@ public class ListPageRequest {
@Max(value = 500, message = "分页参数不能大于500")
private Integer limit;
private String orderBy;
private String sort;
}

@ -30,7 +30,18 @@
and receiveStatus = #{receiveStatus}
</if>
</where>
ORDER BY updateTime DESC
<choose>
<when test="(orderBy!=null ) and (sort=='desc' or sort=='asc')">
order by ${orderBy} ${sort}
</when>
<otherwise>
ORDER BY updateTime DESC
</otherwise>
</choose>
</select>

@ -336,6 +336,7 @@ CALL Pro_Temp_ColumnWork('thr_bustype_origin', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_user', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_user_bustype', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_user_bustype', 'userId', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_dept', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_warehouse', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_warehouse_bustype', 'id', 'bigint', 2);

Loading…
Cancel
Save