Commit ab6830cc4e694ded7934d19c9951ba375273770a
1 parent
b99aa68d11
Exists in
master
and in
6 other branches
添加打印次数接口
Showing 2 changed files with 26 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyOrderController.java
View file @
ab6830c
| ... | ... | @@ -112,6 +112,19 @@ |
| 112 | 112 | return map; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | + /** | |
| 116 | + * 添加打印次数 | |
| 117 | + * | |
| 118 | + * @param sampleReportId | |
| 119 | + * @return | |
| 120 | + */ | |
| 121 | + @RequestMapping(method = RequestMethod.POST,value = "/addPrintSize") | |
| 122 | + @ResponseBody | |
| 123 | + @TokenRequired | |
| 124 | + public BaseResponse addPrintSize( @RequestParam(value = "sampleReportId") String sampleReportId) { | |
| 125 | + return applyOrderFacade.addPrintSize(sampleReportId); | |
| 126 | + } | |
| 127 | + | |
| 115 | 128 | @RequestMapping(method = RequestMethod.GET, value = "/sieveapply") |
| 116 | 129 | @ResponseBody |
| 117 | 130 | @TokenRequired |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java
View file @
ab6830c
| ... | ... | @@ -1944,6 +1944,19 @@ |
| 1944 | 1944 | return unencryptedStr; |
| 1945 | 1945 | } |
| 1946 | 1946 | |
| 1947 | + public BaseResponse addPrintSize(String sampleReportId) { | |
| 1948 | + Query query = Query.query(Criteria.where("sampleReportId").is(sampleReportId)); | |
| 1949 | + SieveResultModel resultModel = mongoTemplate.findOne(query, SieveResultModel.class); | |
| 1950 | + Update update = new Update(); | |
| 1951 | + update.set("printSize", resultModel.getPrintSize().intValue()+ 1); | |
| 1952 | + Boolean hasReport = resultModel.getHasReport(); | |
| 1953 | + if (hasReport != null && hasReport == false) { | |
| 1954 | + update.set("hasReport", true); | |
| 1955 | + } | |
| 1956 | + mongoTemplate.updateFirst(query, update, SieveResultModel.class); | |
| 1957 | + BaseResponse baseResponse = new BaseResponse(); | |
| 1958 | + return baseResponse; | |
| 1959 | + } | |
| 1947 | 1960 | |
| 1948 | 1961 | |
| 1949 | 1962 | /*拼json使用*/ |