|
@@ -22,6 +22,8 @@ import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.system.entity.DictBiz;
|
|
import org.springblade.system.entity.DictBiz;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
|
+import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -39,6 +41,8 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
|
|
|
private final IContractReturnedInfoService returnedInfoService;
|
|
private final IContractReturnedInfoService returnedInfoService;
|
|
|
|
|
|
|
|
+ private final JdbcTemplate jdbcTemplate;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 添加合同信息
|
|
* 添加合同信息
|
|
*/
|
|
*/
|
|
@@ -48,6 +52,9 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
Long id = SnowFlakeUtil.getId();
|
|
Long id = SnowFlakeUtil.getId();
|
|
dto.setId(id);
|
|
dto.setId(id);
|
|
BeanUtils.copyProperties(dto,contractInfo);
|
|
BeanUtils.copyProperties(dto,contractInfo);
|
|
|
|
+ if (dto.getStartTime() != null && dto.getEndTime() != null){
|
|
|
|
+ jdbcTemplate.execute("update c_control_project_info set start_time = '"+dto.getStartTime() + "', end_time = '"+ dto.getEndTime() +"' where id = "+ dto.getProjectId());
|
|
|
|
+ }
|
|
baseMapper.insert(contractInfo);
|
|
baseMapper.insert(contractInfo);
|
|
returnedInfoService.saveOrUpdateBatchReturned(dto);
|
|
returnedInfoService.saveOrUpdateBatchReturned(dto);
|
|
|
|
|
|
@@ -94,6 +101,9 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
public void updateContractInfo(ControlContractInfoDTO dto) {
|
|
public void updateContractInfo(ControlContractInfoDTO dto) {
|
|
ControlContractInfo contractInfo = new ControlContractInfo();
|
|
ControlContractInfo contractInfo = new ControlContractInfo();
|
|
BeanUtils.copyProperties(dto,contractInfo);
|
|
BeanUtils.copyProperties(dto,contractInfo);
|
|
|
|
+ if (dto.getStartTime() != null && dto.getEndTime() != null){
|
|
|
|
+ jdbcTemplate.execute("update c_control_project_info set start_time = '"+dto.getStartTime() + "', end_time = '"+ dto.getEndTime() +"' where id = "+ dto.getProjectId());
|
|
|
|
+ }
|
|
this.updateById(contractInfo);
|
|
this.updateById(contractInfo);
|
|
returnedInfoService.saveOrUpdateBatchReturned(dto);
|
|
returnedInfoService.saveOrUpdateBatchReturned(dto);
|
|
}
|
|
}
|