| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.RespCodeEnum; |
| | | import com.fzzy.igds.data.IgdsBaseParam; |
| | | import com.fzzy.igds.data.InoutParam; |
| | | import com.fzzy.igds.data.NoticeParam; |
| | | import com.fzzy.igds.data.PageResponse; |
| | | import com.fzzy.igds.domain.InoutConf; |
| | | import com.fzzy.igds.domain.InoutRecord; |
| | | import com.fzzy.igds.domain.InoutSysConf; |
| | | import com.fzzy.igds.domain.*; |
| | | import com.fzzy.igds.service.DicAreaService; |
| | | import com.fzzy.igds.service.InoutConfService; |
| | | import com.fzzy.igds.service.InoutNoticeService; |
| | | import com.fzzy.igds.service.InoutRecordService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.SystemUtil; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 出入库业务处理 |
| | |
| | | private InoutConfService inoutConfService; |
| | | @Resource |
| | | private InoutRecordService inoutRecordService; |
| | | @Resource |
| | | private DicAreaService dicAreaService; |
| | | @Resource |
| | | private InoutNoticeService inoutNoticeService; |
| | | |
| | | /** |
| | | * 根据用户请求信息,根据当前客户电脑IP,获取出入库称重上次选择的地磅 |
| | |
| | | //化验人及时间 |
| | | data.setCheckUser(user.getUserName()); |
| | | data.setCheckTime(new Date()); |
| | | data.setCheckStatus(Constant.STATUS_PASS); |
| | | data.setCheckStatus(Constant.STATUS_CHECK); |
| | | |
| | | int num = inoutRecordService.updateInoutRecord(data); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 分页查询数据 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<List<InoutRecord>> listWeightData(InoutParam param) { |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | param.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | //设置称重流程标记 |
| | | param.setWeightTag("WEIGHT"); |
| | | |
| | | List<InoutRecord> inoutRecords = inoutRecordService.listInout(param); |
| | | |
| | | if (null == inoutRecords || inoutRecords.isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "获取到数据信息为空"); |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, inoutRecords); |
| | | } |
| | | |
| | | /** |
| | | * 查询数据 |
| | | * @param param |
| | | * @return |
| | |
| | | } |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, result); |
| | | } |
| | | |
| | | /** |
| | | * 分页获取区划信息 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<Page<DicArea>> pageDicArea(IgdsBaseParam param) { |
| | | |
| | | Page<DicArea> corePage = new Page<>(param.getPage(), param.getLimit()); |
| | | |
| | | dicAreaService.listPageData(corePage, param.getKey()); |
| | | |
| | | if (null == corePage.getRecords() || corePage.getRecords().isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "获取到数据信息为空"); |
| | | } |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, corePage); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<List<InoutNoticeIn>> listNoticeIn(NoticeParam param) { |
| | | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | if (org.apache.commons.lang3.StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(user.getCompanyId()); |
| | | } |
| | | param.setDeptId(ContextUtil.subDeptId(user)); |
| | | |
| | | List<InoutNoticeIn> list = inoutNoticeService.getNoticeIn(param.getCompanyId(), param.getDeptId(),Constant.COMPLETE_STATUS_NONE); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "查询结果为空!"); |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, list); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<List<InoutNoticeOut>> listNoticeOut(NoticeParam param) { |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | if (org.apache.commons.lang3.StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(user.getCompanyId()); |
| | | } |
| | | param.setDeptId(ContextUtil.subDeptId(user)); |
| | | |
| | | List<InoutNoticeOut> list = inoutNoticeService.getNoticeOut(param.getCompanyId(), param.getDeptId(),Constant.COMPLETE_STATUS_NONE); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "查询结果为空!"); |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, list); |
| | | } |
| | | } |