|
@@ -22,32 +22,25 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.business.entity.EntrustInfo;
|
|
|
-import org.springblade.business.entity.InformationQuery;
|
|
|
-import org.springblade.business.entity.Task;
|
|
|
-import org.springblade.business.entity.TaskParallel;
|
|
|
import org.springblade.business.mapper.EntrustInfoMapper;
|
|
|
import org.springblade.business.service.IEntrustInfoService;
|
|
|
-import org.springblade.business.service.IInformationQueryService;
|
|
|
import org.springblade.business.vo.EntrustDataInfoVO;
|
|
|
import org.springblade.business.vo.EntrustInfoVO;
|
|
|
import org.springblade.business.vo.LoadDataInfoVO;
|
|
|
import org.springblade.business.vo.TrialSampleDataInfoVO;
|
|
|
-import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
-import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
import org.springblade.manager.feign.ExcelTabClient;
|
|
|
import org.springblade.manager.feign.WbsTreePrivateClient;
|
|
|
-import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.*;
|
|
|
-import java.util.stream.Collectors;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 委托单信息表 服务实现类
|
|
@@ -63,7 +56,6 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
|
private final WbsTreePrivateClient wbsTreePrivateClient;
|
|
|
private final EntrustInfoMapper entrustInfoMapper;
|
|
|
- private final IInformationQueryService informationQueryService;
|
|
|
|
|
|
@Override
|
|
|
public IPage<EntrustInfoVO> selectEntrustInfoPage(IPage<EntrustInfoVO> page, EntrustInfoVO entrustInfo) {
|
|
@@ -156,6 +148,7 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if ((wb.get("dynamic_dict") + "").equals("501")) { //委托单--委托单编号
|
|
|
for(String dataEkey : dataInfo.keySet()){
|
|
|
if(dataEkey.indexOf(ekey)>=0){
|
|
@@ -165,10 +158,7 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
|
|
|
}
|
|
|
}
|
|
|
entrustInfo.setEntrustName(wbsTreePrivate.getNodeName());
|
|
|
- if(dataInfo.containsKey("id")){
|
|
|
- entrustInfo.setId(Long.parseLong(dataInfo.get("id").toString()));
|
|
|
- }
|
|
|
- this.saveOrUpdate(entrustInfo);
|
|
|
+ this.saveOrUpdate(entrustInfo);
|
|
|
dataInfo.put("groupId",entrustInfo.getId());
|
|
|
dataInfo.put("pkeyId", dataInfo.getString("nodeErTreeId"));
|
|
|
excelTabClient.saveEntrustTabData(dataInfo);
|
|
@@ -214,49 +204,4 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
|
|
|
}
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
-
|
|
|
- @Override
|
|
|
- @Transactional
|
|
|
- public R annul(String id) {
|
|
|
- if (ObjectUtil.isEmpty(SecureUtil.getUserId()) || SecureUtil.getUserId() == -1L) {
|
|
|
- throw new ServiceException("未获取到当前用户信息");
|
|
|
- }
|
|
|
- String[] ids = id.split(",");
|
|
|
- List<String>formDataIds=new ArrayList<>();
|
|
|
- if(ids.length>0){
|
|
|
- for (String i : ids) {
|
|
|
- EntrustInfo entrustInfo = entrustInfoMapper.selectById(Long.parseLong(i));
|
|
|
- if(entrustInfo.getStatus()!=2&&entrustInfo.getStatus()!=3){
|
|
|
- throw new ServiceException("该委托单不能废除"+entrustInfo.getEntrustNo());
|
|
|
- }
|
|
|
- entrustInfo.setEntrustEPdf(null);
|
|
|
- entrustInfo.setStatus(1);
|
|
|
- entrustInfoMapper.updateById(entrustInfo);
|
|
|
- }
|
|
|
- List<InformationQuery> queryList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getId, Arrays.asList(ids)));
|
|
|
- if (queryList.size() == 0) {
|
|
|
- //试验填报数据
|
|
|
- queryList = new ArrayList<>(this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, Arrays.asList(ids))));
|
|
|
- //重新绑定trialSelfInspectionRecordId使用map
|
|
|
- //试验记录 和 委托单 ids重新赋值映射为数据源ids
|
|
|
- formDataIds = queryList.stream().map(InformationQuery::getId).map(String::valueOf).collect(Collectors.toList());
|
|
|
- }
|
|
|
- if(formDataIds.size()>0){
|
|
|
- for (String formDataId : formDataIds) {
|
|
|
- String sql="Select * from u_task where form_data_id="+formDataId +" and status!=3 and is_deleted=0";
|
|
|
- Task task = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(Task.class));
|
|
|
- if(task!=null){
|
|
|
- String updateTaskParallel="update u_task_parallel set status=3 where process_instance_id='" + task.getProcessInstanceId() + "'";
|
|
|
- String updateTask="update u_task set status=3 where id="+task.getId()+" and status!=3 and is_deleted=0";
|
|
|
- jdbcTemplate.update(updateTaskParallel);
|
|
|
- jdbcTemplate.update(updateTask);
|
|
|
- }
|
|
|
- String updateinformationQuery="update u_information_query set status=3,e_visa_pdf_url= null where id="+formDataId;
|
|
|
- jdbcTemplate.update(updateinformationQuery);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- return R.success("操作成功");
|
|
|
- }
|
|
|
}
|