|
@@ -8,6 +8,7 @@ import lombok.AllArgsConstructor;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
+import org.springblade.business.dto.MileagePartDto;
|
|
|
import org.springblade.business.entity.Mileage;
|
|
|
import org.springblade.business.entity.MileagePart;
|
|
|
import org.springblade.business.entity.Mileagexy;
|
|
@@ -21,6 +22,7 @@ import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.CollectionUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.core.tool.utils.StringUtil;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -72,8 +74,11 @@ public class MileageController {
|
|
|
|
|
|
|
|
|
@PostMapping("/part/update")
|
|
|
- public R<String> upDate ( MileagePart part){
|
|
|
+ public R<String> upDate (@RequestBody MileagePartDto part){
|
|
|
MileagePart old = partService.getById(part.getId());
|
|
|
+ if(old==null){
|
|
|
+ return R.fail("对象不存在");
|
|
|
+ }
|
|
|
//同步更新片段信息
|
|
|
if(!old.getPrefix().equals(part.getPrefix())){
|
|
|
this.partService.updatePart(old.getProjectId(),old.getPrefix(),part.getPrefix());
|
|
@@ -87,6 +92,9 @@ public class MileageController {
|
|
|
|
|
|
@PostMapping("/part/del")
|
|
|
public R<String> partDel(String ids){
|
|
|
+ if(StringUtil.isBlank(ids)){
|
|
|
+ return R.fail("对象不存在");
|
|
|
+ }
|
|
|
return R.status(partService.removeByIds(Func.toLongList(ids)));
|
|
|
}
|
|
|
|