| | |
| | | package com.ld.igds.inout.view; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | import com.ld.igds.inout.manager.InoutManager; |
| | | import com.ld.igds.inout.manager.InoutReportManager; |
| | | import com.ld.igds.inout.service.InoutService; |
| | | import com.ld.igds.models.DicTrigger; |
| | | import com.ld.igds.util.ContextUtil; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 出入库详单页面管理 |
| | |
| | | @Component |
| | | public class InoutDataPR { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private InoutService inoutService; |
| | | @Autowired |
| | | @Resource |
| | | private InoutReportManager inoutReportManager; |
| | | @Autowired |
| | | @Resource |
| | | private InoutManager inoutManager; |
| | | |
| | | |
| | | |
| | | // ${dorado.getDataProvider("inoutDataPR#triggerRecordStatus1").getResult()} |
| | | @DataProvider |
| | | public List<DicTrigger> triggerRecordStatus1() { |
| | | List<DicTrigger> list = new ArrayList<DicTrigger>(); |
| | | list.add(new DicTrigger(InoutConstant.RECORD_STATUS_DEL, "作废单")); |
| | | list.add(new DicTrigger(InoutConstant.RECORD_STATUS_NORMAL, "正常单")); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * inoutDataPR#pageInoutData |
| | |
| | | * @throws Exception |
| | | */ |
| | | @DataProvider |
| | | public void pageInoutData(Page<InoutData> page, InoutParam param) |
| | | throws Exception { |
| | | public void pageInoutData(Page<InoutData> page, InoutParam param) throws Exception { |
| | | // 调用核心包中方法,需要做对象转换 |
| | | param.setPage(page.getPageNo()); |
| | | param.setLimit(page.getPageSize()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 inoutDataPR#delInoutData |
| | | */ |
| | | @DataResolver |
| | | public String delInoutData(InoutData data) throws Exception { |
| | | return inoutManager.delInoutData(data, false); |
| | | } |
| | | |
| | | /** |
| | | * inoutDataPR#errorInoutData 出入库数据执行 异常终止 |
| | | * |
| | | * @param data |
| | |
| | | * @throws Exception |
| | | */ |
| | | @DataResolver |
| | | @Transactional |
| | | public String errorInoutData(InoutData data) throws Exception { |
| | | return inoutManager.errorInoutData(data); |
| | | } |
| | |
| | | if (InoutConstant.RECORD_STATUS_DEL.equals(data.getRecordStatus())) { |
| | | return "删除的数据不支持打印!"; |
| | | } |
| | | if (InoutConstant.RECORD_STATUS_ERROR.equals(data.getRecordStatus())) { |
| | | return "异常终止的数据不支持打印!"; |
| | | } |
| | | if (!InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) { |
| | | return "未完成的数据不支持打印!"; |
| | | } |
| | |
| | | if (InoutConstant.RECORD_STATUS_DEL.equals(data.getRecordStatus())) { |
| | | return null; |
| | | } |
| | | if (InoutConstant.RECORD_STATUS_ERROR.equals(data.getRecordStatus())) { |
| | | return null; |
| | | } |
| | | if (!InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) { |
| | | return null; |
| | | } |
| | |
| | | if (InoutConstant.RECORD_STATUS_DEL.equals(data.getRecordStatus())) { |
| | | return "删除的数据不支持打印!"; |
| | | } |
| | | if (InoutConstant.RECORD_STATUS_ERROR.equals(data.getRecordStatus())) { |
| | | return "异常终止的数据不支持打印!"; |
| | | } |
| | | return inoutReportManager.inCheckBill(data); |
| | | } |
| | | |
| | |
| | | @Expose |
| | | public InoutData initAddData(String type) { |
| | | IUser user = ContextUtil.getLoginUser(); |
| | | |
| | | InoutData data = new InoutData(); |
| | | data.setCompanyId(user.getCompanyId()); |
| | | data.setRegisterTime(new Date()); |
| | |
| | | */ |
| | | @DataProvider |
| | | public InoutData initDataByHand(String type) { |
| | | |
| | | IUser user = ContextUtil.getLoginUser(); |
| | | |
| | | InoutData data = new InoutData(); |
| | | data.setCompanyId(user.getCompanyId()); |
| | | data.setRegisterTime(new Date()); |
| | | data.setCompleteTime(new Date()); |
| | | data.setType(type); |
| | | data.setIntelCard("0000"); |
| | | data.setRegisterUser(user.getCname()); |
| | | data.setDeptId(ContextUtil.subDeptId(user)); |
| | | data.setCheckUser(user.getCname()); |