| | |
| | | private ProjectPlanService planService; |
| | | @Autowired |
| | | private FlowStatusService flowStatusService; |
| | | @Autowired |
| | | private CstmrService cstmrService; |
| | | |
| | | @RequestMapping(value = "/item/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<Item> wrapper = new EntityWrapper<>(); |
| | | HashSet<String> excludeField = new HashSet<>(); |
| | | |
| | | allLike(Item.class,excludeField,wrapper, (String) param.get("id")); |
| | | allLike(Item.class, param.keySet(), wrapper, condition); |
| | | // allLike(Item.class,excludeField,wrapper, (String) param.get("id")); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | hostEq(wrapper); |
| | |
| | | @RequestMapping(value = "/item/add/auth") |
| | | @ManagerAuth |
| | | public R add(Item item) { |
| | | |
| | | /** |
| | | * 控管 |
| | | */ |
| | | if (Cools.isEmpty(item)) { |
| | | return R.error("参数为空,请联系管理员"); |
| | | } |
| | | |
| | | //item.setType("1"); |
| | | // if (!item.getType().equals("1")) { |
| | | // throw new CoolException("目前仅支持集成项目"); |
| | |
| | | if (item.getRealMonth() < 0){ |
| | | throw new CoolException("实施周期不可为负数"); |
| | | } |
| | | if (Cools.isEmpty(item.getCstmrUuid())) { |
| | | throw new CoolException("请选择客户"); |
| | | } |
| | | Cstmr cstmr = cstmrService.selectOne(new EntityWrapper<Cstmr>() |
| | | .eq("id",Long.parseLong(item.getUuid()))); |
| | | if (Cools.isEmpty(cstmr)) { |
| | | throw new CoolException("找不到该客户,请检查"); |
| | | } |
| | | |
| | | item.setCustMan(cstmr.getName()); |
| | | item.setCustMobile(cstmr.getTel()); |
| | | item.setCustAdress(cstmr.getAddr()); |
| | | item.setHostId(getHostId()); |
| | | item.setCreateBy(getUserId()); |
| | | item.setCreateTime(new Date()); |