|
@@ -310,6 +310,46 @@ public class KuaishouItemCollectSamplesController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ @PutMapping("/updateTask")
|
|
|
|
+ public JSONObject updateTask(@RequestBody KuaishouItemCollectSamples kuaishouItemCollectSamples) {
|
|
|
|
+ JSONObject returnJson = new JSONObject();
|
|
|
|
+ try {
|
|
|
|
+ Long id = kuaishouItemCollectSamples.getId();
|
|
|
|
+ if (Check.isNull(id)) {
|
|
|
|
+ throw new Exception("id不能为空");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String collectSampleDesc = kuaishouItemCollectSamples.getCollectSampleDesc();
|
|
|
|
+ if (Check.isNull(collectSampleDesc)) {
|
|
|
|
+ kuaishouItemCollectSamples.setCollectSampleDesc("转审上传作业");
|
|
|
|
+ }
|
|
|
|
+ int i = kuaishouItemCollectSamplesService.updateKuaishouItemCollectSamples(kuaishouItemCollectSamples);
|
|
|
|
+ if (i > 0) {
|
|
|
|
+ List<Integer> statusList = new ArrayList<>();
|
|
|
|
+ statusList.add(4);
|
|
|
|
+ statusList.add(5);
|
|
|
|
+ for (int j = 0; j < statusList.size(); j++) {
|
|
|
|
+ Integer status = statusList.get(j);
|
|
|
|
+ KuaishouItemCollectSampleLog sampleLog = new KuaishouItemCollectSampleLog();
|
|
|
|
+ sampleLog.setUserId(kuaishouItemCollectSamples.getUserId());
|
|
|
|
+ sampleLog.setUserName(kuaishouItemCollectSamples.getUserName());
|
|
|
|
+ sampleLog.setSampleId(id);
|
|
|
|
+ sampleLog.setCollectSampleStatus(status);
|
|
|
|
+ sampleLog.setCreateTime(new Date());
|
|
|
|
+ sampleLog.setUpdateTime(new Date());
|
|
|
|
+ kuaishouItemCollectSamplesService.insertLog(sampleLog);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ returnJson.put("code", 0);
|
|
|
|
+ returnJson.put("message", "修改成功");
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ returnJson.put("code", 500);
|
|
|
|
+ returnJson.put("message", e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ return returnJson;
|
|
|
|
+ }
|
|
|
|
+
|
|
@GetMapping("/updateCourierNumber")
|
|
@GetMapping("/updateCourierNumber")
|
|
public JSONObject updateCourierNumber(Long id, String courierNumber, String companyCode) {
|
|
public JSONObject updateCourierNumber(Long id, String courierNumber, String companyCode) {
|
|
JSONObject returnJson = new JSONObject();
|
|
JSONObject returnJson = new JSONObject();
|
|
@@ -678,6 +718,57 @@ public class KuaishouItemCollectSamplesController extends BaseController {
|
|
os.flush();
|
|
os.flush();
|
|
os.close();
|
|
os.close();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @PostMapping("/batchProcess")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public JSONObject batchProcess(@RequestBody JSONObject requestJson) {
|
|
|
|
+ JSONObject returnJson = new JSONObject();
|
|
|
|
+ try {
|
|
|
|
+ JSONArray ids = requestJson.getJSONArray("ids");
|
|
|
|
+ if (Check.isNull(ids)) {
|
|
|
|
+ throw new Exception("请传入需要审核的领样ID");
|
|
|
|
+ }
|
|
|
|
+ Integer status = requestJson.getInteger("status");
|
|
|
|
+ if (Check.isNull(status)) {
|
|
|
|
+ throw new Exception("请传入审核状态");
|
|
|
|
+ }
|
|
|
|
+ Long userId = requestJson.getLong("userId");
|
|
|
|
+ if (Check.isNull(userId)) {
|
|
|
|
+ throw new Exception("请传入审核人id");
|
|
|
|
+ }
|
|
|
|
+ String userName = requestJson.getString("userName");
|
|
|
|
+ if (Check.isNull(userName)) {
|
|
|
|
+ throw new Exception("请传入审核人姓名");
|
|
|
|
+ }
|
|
|
|
+ kuaishouItemCollectSamplesService.batchProcess(ids, status);
|
|
|
|
+ List<KuaishouItemCollectSampleLog> logs = new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < ids.size(); i++) {
|
|
|
|
+ Long id = ids.getLong(i);
|
|
|
|
+ KuaishouItemCollectSampleLog sampleLog = new KuaishouItemCollectSampleLog();
|
|
|
|
+ sampleLog.setUserId(userId);
|
|
|
|
+ sampleLog.setUserName(userName);
|
|
|
|
+ sampleLog.setSampleId(id);
|
|
|
|
+ sampleLog.setCollectSampleStatus(status);
|
|
|
|
+ sampleLog.setCreateTime(new Date());
|
|
|
|
+ sampleLog.setUpdateTime(new Date());
|
|
|
|
+ logs.add(sampleLog);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!Check.isNull(logs)) {
|
|
|
|
+ kuaishouItemCollectSamplesService.batchAddLogs(logs);
|
|
|
|
+ }
|
|
|
|
+ returnJson.put("code", 0);
|
|
|
|
+ returnJson.put("message", "批量审核通过");
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ returnJson.put("code", 500);
|
|
|
|
+ returnJson.put("message", e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ return returnJson;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|