| | |
| | | matCode.setModiTime(new Date()); |
| | | matCode.setAppeUser(getUserId()); |
| | | matCode.setAppeTime(new Date()); |
| | | // matCode.setMatNo(UUID.randomUUID().toString().replaceAll("-", "")); |
| | | matCodeService.insert(matCode); |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(value = ManagerAuth.Auth.NONE, memo = "产品代号数据导出") |
| | | public void export(@RequestParam(required = false) String fileName, |
| | | @RequestParam(required = false) Integer rowCount, |
| | | @RequestParam(required = false) String ids, |
| | | HttpServletResponse response) throws Exception { |
| | | List<MatCode> list = matCodeService.selectList(new EntityWrapper<>()); |
| | | List<MatCode> list = null; |
| | | if(!Cools.isEmpty(ids)){ |
| | | list = matCodeService.selectList(new EntityWrapper<MatCode>().last("where mat_no in (" + ids + ")")); |
| | | }else{ |
| | | list = matCodeService.selectList(new EntityWrapper<>()); |
| | | } |
| | | // List<MatCode> list = matCodeService.selectList(new EntityWrapper<>()); |
| | | List<MatCodeExcel> excels = new ArrayList<>(); |
| | | for (MatCode matCode : list) { |
| | | MatCodeExcel excel = VersionUtils.getExcel(matCode); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping("/matType/auth") |
| | | public R type(){ |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (int i = 1; i < 4; i++) { |
| | | Map<String, Object> item = new HashMap<>(); |
| | | item.put("id",i+""); |
| | | if (i == 1){ |
| | | item.put("value","原材料"); |
| | | } |
| | | if (i == 2){ |
| | | item.put("value","成品"); |
| | | } |
| | | if (i == 3){ |
| | | item.put("value","半成品"); |
| | | } |
| | | result.add(item); |
| | | } |
| | | |
| | | return R.ok(result); |
| | | } |
| | | } |