|
@@ -16,16 +16,23 @@
|
|
|
*/
|
|
|
package org.springblade.business.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springblade.business.entity.ContractTreeDrawings;
|
|
|
+import org.springblade.core.secure.BladeUser;
|
|
|
+import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springblade.business.service.IContractTreeDrawingsService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
/**
|
|
|
* 节点图纸控制器
|
|
|
*
|
|
@@ -50,10 +57,19 @@ public class ContractTreeDrawingsController extends BladeController {
|
|
|
@ApiOperation(value = "保存或修改节点上传的图纸记录")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "primaryKeyId", value = "节点primaryKeyId", required = true),
|
|
|
- @ApiImplicitParam(name = "fileUrl", value = "文件url", required = true)
|
|
|
+ @ApiImplicitParam(name = "fileUrl", value = "文件url", required = true),
|
|
|
+ @ApiImplicitParam(name = "id", value = "文件url")
|
|
|
})
|
|
|
- public R<Boolean> saveOrUpdateContractTreeDrawings(@RequestParam String primaryKeyId, @RequestParam String fileUrl){
|
|
|
- return null;
|
|
|
+ public R<Boolean> saveOrUpdateContractTreeDrawings(@RequestParam String primaryKeyId, @RequestParam String fileUrl, @RequestParam String id){
|
|
|
+ //当前提交用户
|
|
|
+ BladeUser user = AuthUtil.getUser();
|
|
|
+ return StringUtils.isNotEmpty(id) ?
|
|
|
+ R.data(this.contractTreeDrawingsService.update(Wrappers.<ContractTreeDrawings>lambdaUpdate()
|
|
|
+ .set(ContractTreeDrawings::getFileUrl, fileUrl).set(ContractTreeDrawings::getUpdateUser, user.getUserId())
|
|
|
+ .set(ContractTreeDrawings::getUpdateTime, new Date())
|
|
|
+ .eq(ContractTreeDrawings::getId, id)))
|
|
|
+ :
|
|
|
+ R.data(this.contractTreeDrawingsService.save(new ContractTreeDrawings(primaryKeyId, fileUrl, user.getUserId(), user.getDeptId())));
|
|
|
}
|
|
|
|
|
|
}
|