Browse Source

台账导入

master
songguoqiang 6 months ago
parent
commit
d241585ed4
  1. 4
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/ItemAccountsController.java
  2. 2
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/itemaccounts/ItemAccountsMapper.java
  3. 8
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/service/itemaccounts/ItemAccountsServiceImpl.java

4
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/ItemAccountsController.java

@ -124,9 +124,9 @@ public class ItemAccountsController {
ItemDO itemDO = itemService.getByNumber(vo.getItemNumber()); ItemDO itemDO = itemService.getByNumber(vo.getItemNumber());
vo.setItemName(itemDO.getName()); vo.setItemName(itemDO.getName());
LocationDO locationDO = locationService.getByNumber(vo.getLocationNumber()); LocationDO locationDO = locationService.getByNumber(vo.getLocationNumber());
vo.setLocationName(locationDO.getName()); vo.setLocationName(locationDO==null?"":locationDO.getName());
LocationAreaDO locationAreaDO = locationAreaService.getByNumber(vo.getAreaNumber()); LocationAreaDO locationAreaDO = locationAreaService.getByNumber(vo.getAreaNumber());
vo.setAreaName(locationAreaDO.getName()); vo.setAreaName(locationAreaDO==null?"":locationAreaDO.getName());
Boolean b = itemAccountsService.qtyZore(vo.getItemNumber()); Boolean b = itemAccountsService.qtyZore(vo.getItemNumber());
vo.setDisplay(b); vo.setDisplay(b);
} }

2
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/itemaccounts/ItemAccountsMapper.java

@ -222,7 +222,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> {
//库存事务 //库存事务
result = updateById(itemAccountsDO); result = updateById(itemAccountsDO);
TransactionDO transactionDO = new TransactionDO(); TransactionDO transactionDO = new TransactionDO();
transactionDO.setQty(itemAccountsDO.getQty()); transactionDO.setQty(param.getQty());
transactionDO.setType(itemAccountsDO.getType()); transactionDO.setType(itemAccountsDO.getType());
list.add(transactionDO); list.add(transactionDO);
} }

8
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/service/itemaccounts/ItemAccountsServiceImpl.java

@ -390,7 +390,7 @@ public class ItemAccountsServiceImpl implements ItemAccountsService {
errorList.add(convert); errorList.add(convert);
} }
ItemAccountsDO itemAccountsDO = validateItemAndTypeAndLocation(item.getItemNumber(), item.getType(), item.getLocationNumber());//查询重复数据 ItemAccountsDO itemAccountsDO = validateItemAndTypeAndLocation(item.getItemNumber(), item.getType(), item.getLocationNumber());//查询重复数据
if(mode != 2){// 如果存在,判断是否允许更新 if(mode != 2 && itemAccountsDO!=null){// 如果存在,判断是否允许更新
ItemAccountsDO itemAccountsDO1 = ItemAccountsConvert.INSTANCE.convert1(item); ItemAccountsDO itemAccountsDO1 = ItemAccountsConvert.INSTANCE.convert1(item);
itemAccountsDO1.setId(itemAccountsDO.getId()); itemAccountsDO1.setId(itemAccountsDO.getId());
//itemAccountsMapper.updateById(itemAccountsDO1); //itemAccountsMapper.updateById(itemAccountsDO1);
@ -434,6 +434,7 @@ public class ItemAccountsServiceImpl implements ItemAccountsService {
transactionCreateReqVO.setOperator(null); transactionCreateReqVO.setOperator(null);
transactionCreateReqVO.setCreator(getLoginUserId().toString()); transactionCreateReqVO.setCreator(getLoginUserId().toString());
transactionCreateReqVO.setAssociatedNumber(null); transactionCreateReqVO.setAssociatedNumber(null);
transactionCreateReqVO.setType(item.getType());
if(itemAccountsDO1.getType().equals(ItemAccountStatusEnum.NEW.getCode())){//新到货 if(itemAccountsDO1.getType().equals(ItemAccountStatusEnum.NEW.getCode())){//新到货
transactionCreateReqVO.setInventoryAction(TransactionEnum.NEW_IN.getCode()); transactionCreateReqVO.setInventoryAction(TransactionEnum.NEW_IN.getCode());
transactionCreateReqVO.setDescribes("备件导入新到货入库");//描述 transactionCreateReqVO.setDescribes("备件导入新到货入库");//描述
@ -446,10 +447,10 @@ public class ItemAccountsServiceImpl implements ItemAccountsService {
transactionCreateReqVO.setInventoryAction(TransactionEnum.IN_IN.getCode()); transactionCreateReqVO.setInventoryAction(TransactionEnum.IN_IN.getCode());
transactionCreateReqVO.setDescribes("备件导入账外入库");//描述 transactionCreateReqVO.setDescribes("备件导入账外入库");//描述
} }
transactionCreateReqVO.setType(itemAccountsDO1.getType()); //transactionCreateReqVO.setType(itemAccountsDO1.getType());
list.add(transactionCreateReqVO); list.add(transactionCreateReqVO);
} }
transactionService.create(list);
} catch (Exception e) { } catch (Exception e) {
ItemAccountsErrorVO convert = ItemAccountsConvert.INSTANCE.convert(item); ItemAccountsErrorVO convert = ItemAccountsConvert.INSTANCE.convert(item);
convert.setImportStatus("失败"); convert.setImportStatus("失败");
@ -461,6 +462,7 @@ public class ItemAccountsServiceImpl implements ItemAccountsService {
if(!errorList.isEmpty() && !updatePart) { if(!errorList.isEmpty() && !updatePart) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//不需要捕获异常 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//不需要捕获异常
} }
transactionService.create(list);
return errorList; return errorList;
} }

Loading…
Cancel
Save