Commit 8a6681c3 authored by wei's avatar wei 🎱

更新移交单关联关系属性信息

parent 67bc9f68
package com.inet.dcs.document.core.controller;
import org.springframework.stereotype.Controller;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import java.util.List;
import com.inet.dcs.document.common.vo.ExtTransferDocLinkVO;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;
import com.inet.dcs.document.common.vo.archivesOtherVO.ExtFilesUpdateVO;
import com.inet.dcs.document.core.controller.shadow.ExtTransferDocLinkControllerShadow;
import com.inet.dcs.document.core.service.ExtTransferDocLinkService;
import com.yonde.dex.basedata.entity.api.ApiResult;
import com.inet.dcs.document.core.controller.shadow.ExtTransferDocLinkControllerShadow;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* @description: ExtTransferDocLink-Controller
* @author: dexadmin
* @version: V
* @date: 2024-10-29 10:30:50
**/
* @description: ExtTransferDocLink-Controller
* @author: dexadmin
* @version: V
* @date: 2024-10-29 10:30:50
**/
@Api(tags = "ExtTransferDocLink管理服务")
@RequestMapping("/ExtTransferDocLink")
@ResponseBody()
@Controller(ExtTransferDocLinkController.BEAN_NAME)
public class ExtTransferDocLinkController<V extends ExtTransferDocLinkVO, S extends ExtTransferDocLinkService<V>> extends ExtTransferDocLinkControllerShadow<V, S> {
@Autowired
private ExtTransferDocLinkService extTransferDocLinkService;
@ApiOperation(value = "更新移交单关联关系属性信息", notes = "更新移交单关联关系属性信息")
@PostMapping(value = "/saveExtTransferDocLink")
public ApiResult saveExtTransferDocLink(@RequestBody ExtTransferDocLinkVO extTransferDocLinkVO) {
extTransferDocLinkService.saveExtTransferDocLink(extTransferDocLinkVO);
return ApiResult.ok(ApiResult.SUCCESS, "更新移交单关联关系属性信息成功");
}
}
......@@ -2,12 +2,19 @@ package com.inet.dcs.document.core.service;
import com.inet.dcs.document.common.vo.ExtTransferDocLinkVO;
import com.inet.dcs.document.core.service.shadow.ExtTransferDocLinkServiceShadow;
/**
* @description: ExtTransferDocLink-service
* @author: dexadmin
* @version: V
* @date: 2024-10-29 10:30:50
**/
* @description: ExtTransferDocLink-service
* @author: dexadmin
* @version: V
* @date: 2024-10-29 10:30:50
**/
public interface ExtTransferDocLinkService<V extends ExtTransferDocLinkVO> extends ExtTransferDocLinkServiceShadow<V> {
/**
* 更新关联表信息
*
* @param extTransferDocLinkVO
*/
void saveExtTransferDocLink(ExtTransferDocLinkVO extTransferDocLinkVO);
}
package com.inet.dcs.document.core.service.impl;
import org.springframework.stereotype.Service;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import com.inet.dcs.document.common.vo.ExtTransferDocLinkVO;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import com.inet.dcs.document.core.service.ExtTransferDocLinkService;
import com.inet.dcs.document.core.repository.ExtTransferDocLinkRepository;
import com.inet.dcs.document.core.service.ExtTransferDocLinkService;
import com.inet.dcs.document.core.util.SearchUtil;
import com.inet.dcs.document.entity.po.ExtTransferDocLink;
import javax.annotation.Resource;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.exception.DxBusinessException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @description: ExtTransferDocLink-ServiceImpl
* @author: dexadmin
* @version: V
* @date: 2024-10-29 10:30:50
**/
* @description: ExtTransferDocLink-ServiceImpl
* @author: dexadmin
* @version: V
* @date: 2024-10-29 10:30:50
**/
@Slf4j
@Service(ExtTransferDocLinkServiceImpl.BEAN_NAME)
public class ExtTransferDocLinkServiceImpl<V extends ExtTransferDocLinkVO> implements ExtTransferDocLinkService<V>{
public class ExtTransferDocLinkServiceImpl<V extends ExtTransferDocLinkVO> implements ExtTransferDocLinkService<V> {
public static final String BEAN_NAME = "extTransferDocLinkServiceImpl";
......@@ -29,6 +33,30 @@ public class ExtTransferDocLinkServiceImpl<V extends ExtTransferDocLinkVO> imple
@Autowired
ExtTransferDocLinkRepository<ExtTransferDocLink> extTransferDocLinkRepository;
@Override
public void saveExtTransferDocLink(ExtTransferDocLinkVO extTransferDocLinkVO) {
String archiveNumber = extTransferDocLinkVO.getArchiveNumber();
SearchQueryCondition queryCondition = SearchQueryCondition.builder()
.searchItems(SearchItems.builder()
.item(new SearchItem("archiveNumber", SearchItem.Operator.EQ, archiveNumber, null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
List<ExtTransferDocLinkVO> extTransferDocLinkVOList = (List<ExtTransferDocLinkVO>) this.findRecursion(queryCondition).getContent();
if (CollectionUtils.isNotEmpty(extTransferDocLinkVOList)) {
throw new DxBusinessException("500", "文档号已存在");
}
Long id = extTransferDocLinkVO.getId();
SearchQueryCondition query = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, id);
ExtTransferDocLinkVO extTransferDocLink = this.findRecursion(query).getContent().get(0);
extTransferDocLink.setBelongingCaseFile(extTransferDocLinkVO.getBelongingCaseFile());
extTransferDocLink.setVolumeNumber(extTransferDocLinkVO.getVolumeNumber());
extTransferDocLink.setStoragePeriod(extTransferDocLinkVO.getStoragePeriod());
extTransferDocLink.setArchiveNumber(extTransferDocLinkVO.getArchiveNumber());
extTransferDocLink.setOperator(OperatorType.MODIFY);
this.saveRecursion((V) extTransferDocLink);
}
}
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