| | |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormInventory; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description 盘点 |
| | |
| | | private LWhGoodsService lWhGoodsService; |
| | | @Autowired |
| | | private FinSysTenantServiceImpl finSysTenantService; |
| | | @Autowired |
| | | @Lazy |
| | | private LWhFormInventoryCoreService lWhFormInventoryCoreService; |
| | | |
| | | |
| | | private static final String QUERY_LIST = "select * from l_wh_form_inventory where 1=1 "; |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存盘点信息 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/31 |
| | | */ |
| | | public int updateInventoryInfo(LWhFormInventoryParam dto, Integer state) { |
| | | public int updateInventoryInfo(LWhFormInventoryParam dto, Integer state, S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | //1.根据盘点单id查询盘点单 |
| | | LWhFormInventory lWhFormInventory = this.get(new LWhFormInventory(dto.getId())); |
| | | if (lWhFormInventory == null) { |
| | | log.error("根据盘点单id查询盘点单失败"); |
| | | return 0; |
| | | } |
| | | //2.修改盘点单 |
| | | //添加盘点单物品 |
| | | List<FormInventoryGoodsVO> inventoryGoodsList = dto.getInventoryGoodsList(); |
| | | if (CollectionUtils.isEmpty(inventoryGoodsList)) { |
| | | log.error("盘点单物品为空"); |
| | | return 0; |
| | | } |
| | | int i = this.inventoryGoodsService.updateInventoryGoods(inventoryGoodsList); |
| | | System.out.println(i); |
| | | //修改盘点单 |
| | | if (state == 2) { |
| | | //完成盘点时设置完成盘点时间 |
| | | lWhFormInventory.setStopTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | |
| | | //完成盘点时设置完成盘点时间 |
| | | String inOutFormByInventoryId = lWhFormInventoryCoreService.createInOutFormByInventoryId(dto.getId(), currentUser, sysInfo); |
| | | if (!StringUtils.isEmpty(inOutFormByInventoryId)) { |
| | | log.error(inOutFormByInventoryId); |
| | | return 0; |
| | | } |
| | | } |
| | | lWhFormInventory.setStates(state); |
| | | lWhFormInventory.setInventoryDate(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | int flag1 = this.update(lWhFormInventory); |
| | |
| | | log.error("修改盘点单失败"); |
| | | return 0; |
| | | } |
| | | //3.添加盘点单物品 |
| | | List<FormInventoryGoodsVO> inventoryGoodsList = dto.getInventoryGoodsList(); |
| | | if (CollectionUtils.isEmpty(inventoryGoodsList)) { |
| | | log.error("盘点单物品为空"); |
| | | return 0; |
| | | } |
| | | this.inventoryGoodsService.updateInventoryGoods(inventoryGoodsList); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | |
| | | formInventoryDetailVO.getInventoryResult() == null ? null : (formInventoryDetailVO.getInventoryResult() == 2 ? "盘盈" : "盘亏")); |
| | | formInventoryDetailVO.setInventoryType( |
| | | formInventoryDetailVO.getInventoryResult() == null ? null : (formInventoryDetailVO.getInventoryResult() == 2 ? "盘盈入库" : "盘亏出库")); |
| | | formInventoryDetailVO.setWarehouseFormCode(formInventoryDetailVO.getWarehouseFormCode()); |
| | | result.add(formInventoryDetailVO); |
| | | }); |
| | | pageUtil.setDatas(result); |