| | |
| | | import com.bstek.dorado.annotation.DataProvider; |
| | | import com.bstek.dorado.annotation.DataResolver; |
| | | import com.bstek.dorado.annotation.Expose; |
| | | import com.fzzy.igds.data.BaseResp; |
| | | import com.fzzy.igds.domain.SnapConf; |
| | | import com.fzzy.igds.service.SnapConfService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | |
| | | * 快拍配置列表 |
| | | */ |
| | | @DataProvider |
| | | public List<SnapConf> selectList(SnapConf param) { |
| | | if (null == param) { |
| | | param = new SnapConf(); |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | return snapConfService.selectList(param); |
| | | public List<SnapConf> selectList(String deptId) { |
| | | return snapConfService.selectList(deptId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public SnapConf getConfActHour() { |
| | | SnapConf param = new SnapConf(); |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | List<SnapConf> list = snapConfService.selectList(param); |
| | | public SnapConf getConfActHour(String deptId) { |
| | | |
| | | List<SnapConf> list = snapConfService.selectList(deptId); |
| | | if (null == list || list.isEmpty()) { |
| | | return new SnapConf(); |
| | | SnapConf conf = new SnapConf(); |
| | | conf.setDeptId(deptId); |
| | | return conf; |
| | | } |
| | | return list.get(0); |
| | | } |
| | |
| | | * @param items |
| | | */ |
| | | @DataResolver |
| | | public void updateConf(List<SnapConf> items) { |
| | | public String updateConf(List<SnapConf> items) { |
| | | if (null == items || items.isEmpty()) { |
| | | return; |
| | | return "数据为空,保存失败"; |
| | | } |
| | | for (SnapConf conf : items) { |
| | | if (StringUtils.isEmpty(conf.getId())) { |
| | |
| | | snapConfService.updateData(conf); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | |
| | | * @param conf |
| | | */ |
| | | @Expose |
| | | public void updateActHour(SnapConf conf) { |
| | | public String updateActHour(SnapConf conf) { |
| | | |
| | | if (null == conf.getCompanyId()) { |
| | | conf.setCompanyId(ContextUtil.getCompanyId()); |
| | |
| | | if (null == conf.getDeptId()) { |
| | | conf.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | //同步更新所有的执行时间一致 |
| | | snapConfService.updateActHour(conf); |
| | | |
| | | if (null == conf.getId()) { |
| | | snapConfService.insertData(conf); |
| | | }else { |
| | | //同步更新所有的执行时间一致 |
| | | snapConfService.updateActHour(conf); |
| | | } |
| | | return null; |
| | | } |
| | | } |