Commit 93ab03db authored by hanbing's avatar hanbing

[update] 禅道 023、026、028 bug修复

parent f99cb8d9
......@@ -15,6 +15,7 @@ import net.wanji.utc.po.ManufacturerApiInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -57,10 +58,12 @@ public class ManufacturerApiController {
@ApiOperation(value = "接口添加或修改", notes = "接口添加或修改", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject insertOrUpdate(@RequestBody @Validated ManufacturerApiInfoInsertOrUpdateDTO inVO) {
manufacturerApiInfoService.insertOrUpdate(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success();
try {
manufacturerApiInfoService.insertOrUpdate(inVO);
} catch (DuplicateKeyException e) {
throw new DuplicateKeyException("接口代码、接口名称、接口地址不可重复");
}
return JsonViewObject.newInstance().success();
}
@AspectLog(description = "接口删除", operationType = BaseEnum.OperationTypeEnum.QUERY)
......
......@@ -14,6 +14,7 @@ import net.wanji.utc.dto.systemadmin.ManufacturerListDTO;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -64,10 +65,12 @@ public class ManufacturerController {
@ApiOperation(value = "厂商添加或修改", notes = "厂商添加或修改", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject insertOrUpdate(@RequestBody @Validated ManufacturerInsertOrUpdateDTO inVO) {
manufacturerService.insertOrUpdate(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success();
try {
manufacturerService.insertOrUpdate(inVO);
} catch (DuplicateKeyException e) {
throw new DuplicateKeyException("厂商代码、厂商名称、厂商简称、平台地址、维护单位不可重复");
}
return JsonViewObject.newInstance().success();
}
@AspectLog(description = "厂商删除", operationType = BaseEnum.OperationTypeEnum.DELETE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment