| | |
| | | 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.InoutData; |
| | | import com.ld.igds.inout.dto.InoutGateDto; |
| | | import com.ld.igds.inout.dto.InoutParam; |
| | | import com.ld.igds.inout.dto.*; |
| | | import com.ld.igds.inout.service.InoutService; |
| | | import com.ld.igds.m.service.InoutCommonService; |
| | | import com.ld.igds.models.Depot; |
| | |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.util.DateUtil; |
| | | import com.ld.igds.util.NumberUtil; |
| | | import com.ld.igds.util.RespUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据条件获取扦样数据 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<Page<InoutCheckData>> pageSampleData(InoutCheckParam param) { |
| | | |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | param.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | //若查询条件为已扦样,则流程置空;若未扦样,则流程不处理,仍为扦样化验流程(CHECK) |
| | | if ("SAMPLE".equals(param.getSampleStatus())) { |
| | | param.setProgress(null); |
| | | } |
| | | |
| | | //获取扦样数据 |
| | | Page<InoutCheckData> sampleList = inoutService.pageSampleData(param); |
| | | |
| | | |
| | | if (null == sampleList.getRecords() || sampleList.getRecords().isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), |
| | | "获取到数据信息为空"); |
| | | } |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, sampleList); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public PageResponse<InoutCheckData> updateSampleData(InoutCheckData data) throws Exception { |
| | | |
| | | // 获取业务数据信息 |
| | | InoutParam param = new InoutParam(); |
| | | param.setCompanyId(data.getCompanyId()); |
| | | param.setId(data.getId()); |
| | | InoutData curData = inoutService.inoutProgressQuery(param); |
| | | if (null == curData) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "没有获取到入库业务数据信息,更新失败", data); |
| | | } |
| | | if (InoutConstant.PROGRESS_RECORD.equals(curData.getProgress())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "当前流程已经结束,不支持修改"); |
| | | } |
| | | |
| | | //扦样信息 |
| | | curData.setSampleTime(data.getSampleTime()); |
| | | curData.setSampleType(data.getSampleType()); |
| | | curData.setSampleUser(data.getSampleUser()); |
| | | |
| | | String msg = inoutService.updateSampleData(curData); |
| | | |
| | | if (null != msg) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), msg); |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功"); |
| | | } |
| | | |
| | | } |