| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fzzy.igds.constant.InoutConstant; |
| | | import com.fzzy.igds.mapper.InoutNoticeInMapper; |
| | | import com.fzzy.igds.mapper.InoutNoticeOutMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import com.fzzy.work.data.OrderStatus; |
| | | import com.fzzy.work.data.WorkStatus; |
| | | import com.fzzy.work.data.WorkBizType; |
| | | import com.fzzy.work.data.WorkOrderParam; |
| | | import com.fzzy.work.domain.WorkOrder; |
| | |
| | | public class WorkOrderService { |
| | | @Resource |
| | | private WorkOrderMapper workOrderMapper; |
| | | |
| | | @Resource |
| | | private InoutNoticeInMapper noticeInMapper; |
| | | @Resource |
| | | private InoutNoticeOutMapper noticeOutMapper; |
| | | |
| | | |
| | | public void addData(WorkOrder data) { |
| | | if(null == data.getId()) data.setId(ContextUtil.generateOrderId("GD")); |
| | | if (null == data.getId()) data.setId(ContextUtil.generateOrderId("GD")); |
| | | |
| | | if(null == data.getCompanyId()) data.setCompanyId(ContextUtil.getCompanyId()); |
| | | if (null == data.getCompanyId()) data.setCompanyId(ContextUtil.getCompanyId()); |
| | | |
| | | if(null == data.getCreateBy()){ |
| | | if (null == data.getCreateBy()) { |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | data.setCreateBy(user.getUserName()); |
| | | data.setCreateById(user.getLoginName()); |
| | |
| | | |
| | | public List<SysDictData> triggerStatus() { |
| | | List<SysDictData> list = new ArrayList<SysDictData>(); |
| | | for (OrderStatus w : OrderStatus.values()) { |
| | | for (WorkStatus w : WorkStatus.values()) { |
| | | list.add(new SysDictData(w.getMsg(), w.getCode())); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public List<SysDictData> triggerType() { |
| | | List<SysDictData> list = new ArrayList<SysDictData>(); |
| | | for (WorkBizType w : WorkBizType.values()) { |
| | | list.add(new SysDictData(w.getMsg(), w.getCode())); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public List<SysDictData> triggerBizType() { |
| | | List<SysDictData> list = new ArrayList<SysDictData>(); |
| | | for (WorkBizType w : WorkBizType.values()) { |
| | | list.add(new SysDictData(w.getMsg(), w.getCode())); |
| | |
| | | } |
| | | |
| | | |
| | | public WorkOrder selectById(String orderId) { |
| | | if (null == orderId) return null; |
| | | return workOrderMapper.selectById(orderId); |
| | | } |
| | | |
| | | public void complete(WorkOrder work) { |
| | | //更新工单状态 |
| | | workOrderMapper.updateStatus(work.getId(), work.getStatus()); |
| | | |
| | | //更新入库通知单状态 |
| | | if (work.getBizType().equals(WorkBizType.TYPE_10.getCode())) { |
| | | noticeInMapper.auditComplete(work.getBusinessId(), work.getStatus()); |
| | | } |
| | | |
| | | //更新入库通知单状态 |
| | | if (work.getBizType().equals(WorkBizType.TYPE_20.getCode())) { |
| | | noticeOutMapper.auditComplete(work.getBusinessId(), work.getStatus()); |
| | | } |
| | | } |
| | | } |