| | |
| | | import com.ld.igds.data.Page; |
| | | import com.ld.igds.data.PageResponse; |
| | | import com.ld.igds.file.CoreFileService; |
| | | import com.ld.igds.file.dto.FileData; |
| | | import com.ld.igds.inout.InoutConstant; |
| | | import com.ld.igds.inout.dto.InoutCheckData; |
| | | import com.ld.igds.inout.dto.InoutCheckParam; |
| | |
| | | import com.ld.igds.models.InoutSysConf; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.util.DateUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | |
| | | * |
| | | * @author |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class InoutManager { |
| | | |
| | |
| | | private CheckStandardManager checkStandardManager; |
| | | @Resource |
| | | private InoutEventControlManager inoutEventControl; |
| | | @Resource |
| | | private CoreFileService coreFileService; |
| | | |
| | | /** |
| | | * 直接从数据库查询,不考虑信息状态 |
| | |
| | | return data; |
| | | } |
| | | |
| | | private InoutData updateFiles(InoutData data) throws Exception { |
| | | List<FileData> files = data.getFiles(); |
| | | if (null == files) { |
| | | return data; |
| | | } |
| | | |
| | | for (FileData fileData : files) { |
| | | fileData.setFileId(ContextUtil.getUUID()); |
| | | fileData.setCompanyId(data.getCompanyId()); |
| | | fileData.setBizId(data.getId()); |
| | | fileData.setCreateTime(new Date()); |
| | | coreFileService.addRecord(fileData); |
| | | } |
| | | |
| | | return data; |
| | | } |
| | | |
| | | /** |
| | | * 从缓存中获取下一流程 |
| | |
| | | if (null != msg) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg); |
| | | } |
| | | |
| | | |
| | | data.setCompleteTime(param.getCompleteTime()); |
| | | data.setProgress(InoutConstant.PROGRESS_RECORD); |
| | | inoutService.updateInoutCache(data); |
| | | // 流程完成收事件 |
| | | inoutEventControl.onInoutComplete(data); |
| | | |
| | |
| | | if (InoutConstant.TYPE_IN.equals(data.getType())) { |
| | | this.updateCheckItems(data, true); |
| | | } |
| | | this.updateFiles(data); |
| | | |
| | | return null; |
| | | } |
| | |
| | | data.setCheckTime(new Date()); |
| | | } |
| | | curData.setCheckStatus(data.getCheckStatus()); |
| | | curData.setFoodYear(data.getFoodYear()); |
| | | |
| | | |
| | | // 获取下一个流程状态 |
| | |
| | | curData.setPrice(data.getPrice()); |
| | | curData.setRemarks(data.getRemarks()); |
| | | curData.setCheckItems(data.getCheckItems()); |
| | | curData.setCheckTime(data.getCheckTime()); |
| | | curData.setDepotId(data.getDepotId()); |
| | | |
| | | if (StringUtils.isEmpty(data.getCheckUser())) { |
| | | curData.setCheckUser(ContextUtil.getLoginUserCName()); |
| | |
| | | } |
| | | } |
| | | |
| | | public void initInoutWeight(List<InoutConf> listInoutConf,String sort) { |
| | | inoutEventControl.initInoutWeight(listInoutConf,sort); |
| | | public void initInoutWeight(List<InoutConf> listInoutConf, String sort) { |
| | | inoutEventControl.initInoutWeight(listInoutConf, sort); |
| | | } |
| | | |
| | | } |