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

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,7 +625,6 @@ 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);
@ -627,10 +632,29 @@ public class SpsSyncDownloadController {
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) { 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); orderEntity.setId(null);
orderDao.insert(orderEntity); orderDao.insert(orderEntity);
//更新码详情 //更新码详情
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) { if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
List<IoCodeEntity> warehouseEntityList = syncDataResponse.getCodeEntities(); List<IoCodeEntity> warehouseEntityList = syncDataResponse.getCodeEntities();
@ -711,9 +735,6 @@ public class SpsSyncDownloadController {
if (CollUtil.isNotEmpty(syncDataResponse.getCodeEntities())) if (CollUtil.isNotEmpty(syncDataResponse.getCodeEntities()))
logs = logs + "单据条码信息:" + syncDataResponse.getCodeEntities().size() + "条\n"; logs = logs + "单据条码信息:" + syncDataResponse.getCodeEntities().size() + "条\n";
remark.append(logs); remark.append(logs);
} catch (Exception e) {
e.printStackTrace();
}
} }
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>
<choose>
<when test="(orderBy!=null ) and (sort=='desc' or sort=='asc')">
order by ${orderBy} ${sort}
</when>
<otherwise>
ORDER BY updateTime DESC 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