|
|
@@ -5,6 +5,8 @@ import java.util.List;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
@@ -126,11 +128,19 @@ public class AttendanceDetailProvider extends GenericProvider implements IAttend
|
|
|
@Override
|
|
|
public APIResult<Void> remove(
|
|
|
@ApiParam(name = "ids", value = "考勤明细表ID数组", required = true)
|
|
|
- @RequestBody(required = true) String[] ids) {
|
|
|
+ @RequestBody(required = true) String ids) {
|
|
|
APIResult<Void> result = new APIResult<Void>();
|
|
|
try {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(ids);
|
|
|
+ JSONArray idsArray = jsonObject.getJSONArray("ids");
|
|
|
+ if (idsArray == null || idsArray.size() == 0) {
|
|
|
+ result.setMessage("ids参数不能为空");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ String[] idArray = idsArray.toArray(new String[0]);
|
|
|
+
|
|
|
AttendanceDetail domain = attendanceDetailRepository.newInstance();
|
|
|
- domain.deleteByIds(ids);
|
|
|
+ domain.deleteByIds(idArray);
|
|
|
result.setMessage("删除考勤明细表成功");
|
|
|
} catch (Exception e) {
|
|
|
setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
|