| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.consum.base.pojo.query.LWhLedgerQry; |
| | | import com.consum.base.service.*; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.consum.base.pojo.response.FormInventoryDetailVO; |
| | | import com.consum.base.pojo.response.FormInventoryGoodsVO; |
| | | import com.consum.base.pojo.response.FormInventoryVO; |
| | | import com.consum.base.service.BaseWarehouseService; |
| | | import com.consum.base.service.FinSysTenantService; |
| | | import com.consum.base.service.LWhFormInventoryGoodsService; |
| | | import com.consum.base.service.LWhFormInventoryService; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.base.service.core.LWhFormInventoryCoreService; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenant; |
| | |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Description 盘点 |
| | |
| | | @Autowired |
| | | @Lazy |
| | | private LWhFormInventoryCoreService lWhFormInventoryCoreService; |
| | | @Resource |
| | | private FinWarehouseLedgerServiceImpl finWarehouseLedgerService; |
| | | |
| | | private static final String QUERY_LIST = "select * from l_wh_form_inventory where 1=1 "; |
| | | |
| | |
| | | return list; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Integer isAddInventory(LWhFormInventoryQry param, FinSysTenantUser sysInfo) { |
| | | // isAddInventory |
| | | StringBuilder sql = new StringBuilder(QUERY_LIST); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | // 机构 |
| | | sql.append("and AGENCY_ID =:agencyId "); |
| | | paramts.put("agencyId", sysInfo.getTenantId()); |
| | | // 状态 |
| | | sql.append("and states !=:states "); |
| | | paramts.put("states", "2"); |
| | | List<LWhFormInventory> select = select(sql.toString(), paramts, new LWhFormInventory()); |
| | | if (!CollectionUtil.isEmpty(select)) { |
| | | return 0; |
| | | } |
| | | LWhLedgerQry query = new LWhLedgerQry(); |
| | | query.setAgencyId(new Long(sysInfo.getTenantId())); |
| | | query.setPageSize(100); |
| | | query.setPageNum(1); |
| | | query.setStates(new Short("1")); |
| | | GenericPager pager = finWarehouseLedgerService.ledgerList(query); |
| | | if(pager==null || CollectionUtil.isEmpty(pager.getDatas())){ |
| | | return -1; |
| | | } |
| | | return 1; |
| | | } |
| | | } |