Commit cc3a5d29 authored by wei's avatar wei 🎱

合同终止接口。科研类国防科技口收入合同创建即发布状态

parent e342e9d7
...@@ -150,6 +150,14 @@ public class Constants { ...@@ -150,6 +150,14 @@ public class Constants {
* 已发布 * 已发布
*/ */
public static final String PBULISHED = "published"; public static final String PBULISHED = "published";
/**
* 已发布
*/
public static final String RELEASE = "release";
/**
* 已终止
*/
public static final String TERMINATION = "Termination";
/** /**
* 已过时 * 已过时
*/ */
...@@ -410,6 +418,10 @@ public class Constants { ...@@ -410,6 +418,10 @@ public class Constants {
* 外部技术联系单 * 外部技术联系单
*/ */
public static final String EXT_CONTACT = "ExtContactList"; public static final String EXT_CONTACT = "ExtContactList";
/**
* 科研类国防科技口收入合同
*/
public static final String EXT_D_T_INCOME_CONTRACT = "ExtDtIncomeContract";
/** /**
* excel 操作符 * excel 操作符
......
...@@ -38,6 +38,12 @@ public class ExtExpenditureContractController<V extends ExtExpenditureContractVO ...@@ -38,6 +38,12 @@ public class ExtExpenditureContractController<V extends ExtExpenditureContractVO
return ApiResult.ok(extExpenditureContractService.startWorkflow(id), "操作完成"); return ApiResult.ok(extExpenditureContractService.startWorkflow(id), "操作完成");
} }
@ApiOperation("合同终止")
@PostMapping(value = "/termination")
public ApiResult termination(@RequestParam("id") Long id) {
return ApiResult.ok(extExpenditureContractService.termination(id), "操作完成");
}
@ApiOperation(value = "生成word签字", notes = "生成word签字", httpMethod = "POST") @ApiOperation(value = "生成word签字", notes = "生成word签字", httpMethod = "POST")
@PostMapping(value = "/generateContractWordSign") @PostMapping(value = "/generateContractWordSign")
public void generateContractWordSign(@RequestParam("documentId") Long contractId, public void generateContractWordSign(@RequestParam("documentId") Long contractId,
......
...@@ -38,6 +38,12 @@ public class ExtInComeContractController<V extends ExtInComeContractVO, S extend ...@@ -38,6 +38,12 @@ public class ExtInComeContractController<V extends ExtInComeContractVO, S extend
return ApiResult.ok(extInComeContractService.startWorkflow(id), "操作完成"); return ApiResult.ok(extInComeContractService.startWorkflow(id), "操作完成");
} }
@ApiOperation("合同终止")
@PostMapping(value = "/termination")
public ApiResult termination(@RequestParam("id") Long id) {
return ApiResult.ok(extInComeContractService.termination(id), "操作完成");
}
@ApiOperation(value = "生成word签字", notes = "生成word签字", httpMethod = "POST") @ApiOperation(value = "生成word签字", notes = "生成word签字", httpMethod = "POST")
@PostMapping(value = "/generateContractWordSign") @PostMapping(value = "/generateContractWordSign")
public void generateContractWordSign(@RequestParam("documentId") Long contractId, public void generateContractWordSign(@RequestParam("documentId") Long contractId,
......
...@@ -4,7 +4,6 @@ import com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO; ...@@ -4,7 +4,6 @@ import com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO;
import com.yonde.dcs.plan.core.service.shadow.ExtExpenditureContractServiceShadow; import com.yonde.dcs.plan.core.service.shadow.ExtExpenditureContractServiceShadow;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO; import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO; import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO;
import org.apache.poi.ss.formula.functions.T;
import java.util.List; import java.util.List;
...@@ -44,4 +43,6 @@ public interface ExtExpenditureContractService<V extends ExtExpenditureContractV ...@@ -44,4 +43,6 @@ public interface ExtExpenditureContractService<V extends ExtExpenditureContractV
*/ */
// TODO: xpc 将WfTaskDefinitionVO改为DxWfActivityVO // TODO: xpc 将WfTaskDefinitionVO改为DxWfActivityVO
String getEndDate(List<DxWfProcessTaskVO> dxWfProcessTaskVO, String activityName); String getEndDate(List<DxWfProcessTaskVO> dxWfProcessTaskVO, String activityName);
ExtExpenditureContractVO termination(Long id);
} }
...@@ -18,4 +18,6 @@ public interface ExtInComeContractService<V extends ExtInComeContractVO> extends ...@@ -18,4 +18,6 @@ public interface ExtInComeContractService<V extends ExtInComeContractVO> extends
ExtInComeContractVO findExtInComeContractObjFileLinks(Long contractId); ExtInComeContractVO findExtInComeContractObjFileLinks(Long contractId);
List<ExtInComeContractVO> getResearchCategory(String subTypeName); List<ExtInComeContractVO> getResearchCategory(String subTypeName);
ExtInComeContractVO termination(Long id);
} }
...@@ -261,6 +261,18 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV ...@@ -261,6 +261,18 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
return " "; return " ";
} }
@Override
public ExtExpenditureContractVO termination(Long id) {
ExtExpenditureContractVO extExpenditureContractVO = this.get(id);
if (extExpenditureContractVO == null) {
throw new DxBusinessException("500", "获取不到对象");
}
if (!extExpenditureContractVO.getState().equals(Constants.RELEASE)) {
throw new DxBusinessException("500", "该对象不是已发布状态");
}
return this.changeStatus(extExpenditureContractVO.getId(), Constants.TERMINATION, true);
}
/** /**
* 获取用户名称及用户id(4.1新) * 获取用户名称及用户id(4.1新)
*/ */
......
package com.yonde.dcs.plan.core.service.impl; package com.yonde.dcs.plan.core.service.impl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO; import com.yonde.dcs.plan.common.constants.Constants;
import com.yonde.dcs.plan.common.vo.ExtInComeContractVO;
import com.yonde.dcs.plan.core.repository.ExtInComeContractRepository;
import com.yonde.dcs.plan.core.service.ExtInComeContractService;
import com.yonde.dcs.plan.entity.po.ExtInComeContract;
import com.yonde.dex.basedata.data.search.SearchItem; import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems; import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition; import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl; import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.exception.DxBusinessException; import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.dao.service.DxDaoPluginExpander;
import com.yonde.dex.dao.service.util.DxPageUtils; import com.yonde.dex.dao.service.util.DxPageUtils;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign; import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import io.swagger.annotations.ApiOperation;
import java.util.ArrayList; import java.util.Collection;
import java.util.List; import java.util.List;
import com.yonde.dcs.plan.common.vo.ExtInComeContractVO;
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.yonde.dcs.plan.core.service.ExtInComeContractService;
import com.yonde.dcs.plan.core.repository.ExtInComeContractRepository;
import com.yonde.dcs.plan.entity.po.ExtInComeContract;
import javax.annotation.Resource;
/** /**
* @description: ExtInComeContract-ServiceImpl * @description: ExtInComeContract-ServiceImpl
* @author: dexadmin * @author: dexadmin
* @version: V * @version: V
* @date: 2024-9-24 16:48:58 * @date: 2024-9-24 16:48:58
**/ **/
@Slf4j @Slf4j
@Service(ExtInComeContractServiceImpl.BEAN_NAME) @Service(ExtInComeContractServiceImpl.BEAN_NAME)
public class ExtInComeContractServiceImpl<V extends ExtInComeContractVO> implements ExtInComeContractService<V>{ public class ExtInComeContractServiceImpl<V extends ExtInComeContractVO> implements
ExtInComeContractService<V>, DxDaoPluginExpander<V> {
public static final String BEAN_NAME = "extInComeContractServiceImpl"; public static final String BEAN_NAME = "extInComeContractServiceImpl";
...@@ -44,6 +42,18 @@ public class ExtInComeContractServiceImpl<V extends ExtInComeContractVO> impleme ...@@ -44,6 +42,18 @@ public class ExtInComeContractServiceImpl<V extends ExtInComeContractVO> impleme
@Autowired @Autowired
private WfcProcessFeign wfcProcessFeign; private WfcProcessFeign wfcProcessFeign;
@Override
public void postSave(Collection<V> target) {
// 科研类国防科技口收入合同 直接改为已发布
for (V v : target) {
String subTypeName = v.getSubTypeName();
if (Constants.EXT_D_T_INCOME_CONTRACT.equals(subTypeName)) {
// 改为已发布
this.changeStatus(v.getId(), Constants.RELEASE, true);
}
}
}
@Override @Override
public ExtInComeContractVO startWorkflow(Long id) { public ExtInComeContractVO startWorkflow(Long id) {
ExtInComeContractVO extInComeContractVO = this.get(id); ExtInComeContractVO extInComeContractVO = this.get(id);
...@@ -90,6 +100,18 @@ public class ExtInComeContractServiceImpl<V extends ExtInComeContractVO> impleme ...@@ -90,6 +100,18 @@ public class ExtInComeContractServiceImpl<V extends ExtInComeContractVO> impleme
} }
return Lists.newArrayList(); return Lists.newArrayList();
} }
@Override
public ExtInComeContractVO termination(Long id) {
ExtInComeContractVO extInComeContractVO = this.get(id);
if (extInComeContractVO == null) {
throw new DxBusinessException("500", "获取不到对象");
}
if (!extInComeContractVO.getState().equals(Constants.RELEASE)) {
throw new DxBusinessException("500", "该对象不是已发布状态");
}
return this.changeStatus(extInComeContractVO.getId(), Constants.TERMINATION, true);
}
} }
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