| | |
| | | import com.ld.igds.inout.mapper.InoutCheckMapper; |
| | | import com.ld.igds.inout.mapper.InoutRecordMapper; |
| | | import com.ld.igds.inout.service.InoutService; |
| | | import com.ld.igds.models.Depot; |
| | | import com.ld.igds.models.InoutPrice; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.util.DateUtil; |
| | |
| | | if (null != result) { |
| | | return result; |
| | | } |
| | | |
| | | |
| | | List<InoutData> list = inoutMapper.inoutProgressQuery(param); |
| | | if (null == list || list.size() == 0) |
| | | return null; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public String inoutStop(InoutParam param) { |
| | | public String inoutStop(InoutParam param) throws Exception { |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | param.setCompanyId(ContextUtil.getDefaultCompanyId()); |
| | | } |
| | | |
| | | |
| | | param.setProgress(InoutConstant.PROGRESS_RECORD); |
| | | param.setRecordStatus(InoutConstant.RECORD_STATUS_DEL); |
| | | |
| | | |
| | | // 缓存中删除 |
| | | delFromCache(param.getDeptId(), param.getType(), param.getId()); |
| | | |
| | | param.setProgress(InoutConstant.PROGRESS_RECORD); |
| | | param.setRecordStatus(InoutConstant.RECORD_STATUS_ERROR); |
| | | |
| | | inoutMapper.inoutStop(param); |
| | | |
| | |
| | | data.setUserName(""); |
| | | } |
| | | |
| | | inoutMapper.insertData(data); |
| | | InoutData newData; |
| | | if (EntityUtils.isEntity(data)) { |
| | | newData = new InoutData(); |
| | | BeanUtils.copyProperties(data, newData, new String[]{"checkItems", "files"}); |
| | | }else{ |
| | | newData = data; |
| | | } |
| | | |
| | | updateInoutCache(data); |
| | | inoutMapper.insertData(newData); |
| | | |
| | | |
| | | updateInoutCache(newData); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("------------出入库执行保存出错---{}", e); |
| | |
| | | if (null != param.getUserId()) { |
| | | param.setUserId("%" + param.getUserId() + "%"); |
| | | } |
| | | |
| | | if(null != param.getRecordStatus() && InoutConstant.RECORD_STATUS_NORMAL.equals(param.getRecordStatus())){ |
| | | param.setRecordStatus(null); |
| | | } |
| | | |
| | | List<InoutData> records = inoutMapper.pageRecordData(page, param); |
| | | //判断入库重量是否为空,为空则赋值结算重量 |
| | |
| | | @Override |
| | | public String quickComplete(InoutData data) throws Exception { |
| | | if (null == data.getCompanyId()) { |
| | | data.setCompanyId(ContextUtil.getCompanyId()); |
| | | data.setCompanyId(ContextUtil.getDefaultCompanyId()); |
| | | } |
| | | if (null == data.getCompleteTime()) { |
| | | data.setCompleteTime(new Date()); |
| | |
| | | if (null == data.getEmptyWeightTime()) { |
| | | data.setEmptyWeightTime(new Date()); |
| | | } |
| | | |
| | | |
| | | //调整时间差 |
| | | if (InoutConstant.TYPE_IN.equals(data.getType())) { |
| | |
| | | // 设置流程结束 |
| | | data.setProgress(InoutConstant.PROGRESS_RECORD); |
| | | |
| | | |
| | | if (null == data.getFoodType()) { |
| | | // 根据仓库信息获取缓存 |
| | | Depot depot = commonService.getCacheDepot(data.getCompanyId(), data.getDepotId()); |
| | | data.setFoodType(depot.getFoodType()); |
| | | } |
| | | |
| | | //执行更新 |
| | | inoutMapper.updateData(data); |
| | | |
| | | //更新缓存 |
| | | updateInoutCache(data); |
| | | |
| | | return null; |
| | |
| | | } else { |
| | | setInoutCache(data.getDeptId(), data); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | data.setCompanyId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | int num = inoutCheckMapper.updateSampleData(data); |
| | | inoutCheckMapper.updateSampleData(data); |
| | | |
| | | return null; |
| | | } |
| | |
| | | @Override |
| | | public String updateCheckData(InoutData data) { |
| | | data.setUpdateTime(new Date()); |
| | | int num = inoutCheckMapper.updateCheckData(data); |
| | | |
| | | inoutCheckMapper.updateCheckData(data); |
| | | |
| | | //更新缓存 |
| | | updateInoutCache(data); |