|
|
@@ -1,5 +1,6 @@
|
|
|
package com.uas.kanban.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.kanban.annotation.NotEmpty;
|
|
|
import com.uas.kanban.base.BaseService;
|
|
|
import com.uas.kanban.dao.KanbanDao;
|
|
|
@@ -11,6 +12,7 @@ import com.uas.kanban.service.KanbanHistoryService;
|
|
|
import com.uas.kanban.service.KanbanService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -32,6 +34,23 @@ public class KanbanHistoryServiceImpl extends BaseService<KanbanHistory> impleme
|
|
|
@Autowired
|
|
|
private KanbanService kanbanService;
|
|
|
|
|
|
+ @Override
|
|
|
+ public int updatePart(@NotEmpty("json") String json) throws IllegalArgumentException, OperationException {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(json);
|
|
|
+ Object code = jsonObject.remove("code");
|
|
|
+ if (ObjectUtils.isEmpty(code)) {
|
|
|
+ throw new IllegalArgumentException("未指定 code");
|
|
|
+ }
|
|
|
+ Object description = jsonObject.remove("description");
|
|
|
+ if (ObjectUtils.isEmpty(description)) {
|
|
|
+ throw new IllegalArgumentException("未指定 description");
|
|
|
+ }
|
|
|
+ if (!jsonObject.isEmpty()) {
|
|
|
+ throw new OperationException("只支持修改 description");
|
|
|
+ }
|
|
|
+ return super.updatePart(json);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<KanbanHistory> findByKanbanCode(@NotEmpty("kanbanCode") String kanbanCode) {
|
|
|
return kanbanHistoryDao.findByKanbanCode(kanbanCode);
|