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

master
anthonywj 2 years ago
parent ff1f825b39
commit 2a7fe6c1e9

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

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

@ -255,4 +255,21 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
public List<InvWarehouseEntity> selectLowWarehouseAll(String pCode) { public List<InvWarehouseEntity> selectLowWarehouseAll(String pCode) {
return invWarehouseDao.selectLowWarehouseAll(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.setOutType(ConstantStatus.CORP_SICK_SICK);
basicCorpEntity.setName(orderEntity.getFromCorp()); basicCorpEntity.setName(orderEntity.getFromCorp());
basicCorpEntity.setId(IdUtil.getSnowflakeNextId()); basicCorpEntity.setId(IdUtil.getSnowflakeNextId());
basicCorpService.insertBasicUnitMaintain(basicCorpEntity); basicCorpEntity.setUpdateTime(new Date());
basicCorpService.insert(basicCorpEntity);
} }
orderEntity.setFromCorp(basicCorpEntity.getErpId()); orderEntity.setFromCorp(basicCorpEntity.getErpId());

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

@ -30,7 +30,18 @@
and receiveStatus = #{receiveStatus} and receiveStatus = #{receiveStatus}
</if> </if>
</where> </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> </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', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_user_bustype', '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_dept', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_warehouse', 'id', 'bigint', 2); CALL Pro_Temp_ColumnWork('auth_warehouse', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_warehouse_bustype', 'id', 'bigint', 2); CALL Pro_Temp_ColumnWork('auth_warehouse_bustype', 'id', 'bigint', 2);

Loading…
Cancel
Save