|
|
@@ -38,6 +38,8 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
|
|
|
/**
|
|
|
* 新增第三方机构
|
|
|
* @param t
|
|
|
+ * @param calculation 0 其他 1软著 2专利
|
|
|
+ * @param patentType 专利名称 0实用新型 1发明专利 2外观专利 3 其他
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/addCompany" , method = RequestMethod.POST)
|
|
|
@@ -53,6 +55,7 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"名称","名称"));
|
|
|
return res;
|
|
|
}
|
|
|
+ //0 系统 1软著 2专利
|
|
|
if (calculation==1) {
|
|
|
thirdPartyCompanyService.calculationUnitPrice(t);
|
|
|
}else if (calculation==2) {
|
|
|
@@ -76,7 +79,8 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateCompany" , method = RequestMethod.POST)
|
|
|
- public Result updateCompany(@Valid ThirdPartyCompany t,BindingResult bindingResult) {
|
|
|
+ public Result updateCompany(@Valid ThirdPartyCompany t,BindingResult bindingResult,
|
|
|
+ Integer calculation,Integer patentType) {
|
|
|
Result res =new Result();
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
@@ -91,11 +95,17 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"名称","名称"));
|
|
|
return res;
|
|
|
}
|
|
|
+ //0 系统 1软著 2专利
|
|
|
+ if (calculation==1) {
|
|
|
+ thirdPartyCompanyService.calculationUnitPrice(t);
|
|
|
+ }else if (calculation==2) {
|
|
|
+ thirdPartyCompanyService.calculationPatentUnitPrice(t,patentType);
|
|
|
+ }
|
|
|
if (!res.getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- res.data(thirdPartyCompanyService.updateCompany(t));
|
|
|
+ res.data(thirdPartyCompanyService.updateCompany(t,calculation));
|
|
|
return res;
|
|
|
}
|
|
|
|