|
|
@@ -22,11 +22,13 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springblade.business.entity.HideProcess;
|
|
|
import org.springblade.business.entity.InformationQuery;
|
|
|
import org.springblade.business.service.IImageClassificationFileService;
|
|
|
import org.springblade.business.service.IInformationQueryService;
|
|
|
import org.springblade.business.vo.MaterialProgressVO;
|
|
|
import org.springblade.business.vo.QueryProcessDataVO;
|
|
|
+import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
@@ -41,10 +43,7 @@ import org.springblade.system.entity.Menu;
|
|
|
import org.springblade.system.entity.RoleMenu;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Iterator;
|
|
|
@@ -490,7 +489,7 @@ public class MaterialProgressController extends BladeController {
|
|
|
}
|
|
|
if (countList.size() > 0) {
|
|
|
//设置参数
|
|
|
- this.setParameter(countList, reVO, classifyType);
|
|
|
+ this.setParameter(countList, reVO, classifyType,contractId);
|
|
|
}
|
|
|
filtetDataByRole(contract, reVO,1);
|
|
|
return R.data(reVO);
|
|
|
@@ -501,7 +500,7 @@ public class MaterialProgressController extends BladeController {
|
|
|
List<WbsTreeContract> submitNodeList = this.wbsTreeContractClient.queryContractSubmitWbsTreeByContractId(contractId);
|
|
|
if (submitNodeList != null && submitNodeList.size() > 0) {
|
|
|
//设置参数
|
|
|
- this.setParameter(submitNodeList, reVO, classifyType);
|
|
|
+ this.setParameter(submitNodeList, reVO, classifyType,contractId);
|
|
|
filtetDataByRole(contract, reVO,1);
|
|
|
return R.data(reVO);
|
|
|
}
|
|
|
@@ -513,7 +512,7 @@ public class MaterialProgressController extends BladeController {
|
|
|
/**
|
|
|
* 设置参数
|
|
|
*/
|
|
|
- private void setParameter(List<WbsTreeContract> submitNodeList, MaterialProgressVO reVO, String classifyType) {
|
|
|
+ private void setParameter(List<WbsTreeContract> submitNodeList, MaterialProgressVO reVO, String classifyType,String contractId) {
|
|
|
classifyType = StringUtils.isEmpty(classifyType) ? "1" : classifyType;
|
|
|
//汇总四个填报类型的总数
|
|
|
List<String> process = new ArrayList<>(), workStartReports = new ArrayList<>(), evaluation = new ArrayList<>(), completion = new ArrayList<>();
|
|
|
@@ -541,11 +540,47 @@ public class MaterialProgressController extends BladeController {
|
|
|
if (completion.size() > 0) {
|
|
|
completionAmount = this.informationQueryService.count(Wrappers.<InformationQuery>query().select("distinct wbs_id").in("wbs_id", completion).eq("classify", classifyType));
|
|
|
}
|
|
|
+ String sql="select * from m_hide_process where contract_id= "+contractId+" and classify_type= "+classifyType;
|
|
|
+ List<HideProcess> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(HideProcess.class));
|
|
|
+ String hideTypes="";
|
|
|
+ if(!list.isEmpty()){
|
|
|
+ hideTypes= list.stream().map(HideProcess::getHideType).map(String::valueOf).collect(Collectors.joining(","));
|
|
|
+ }
|
|
|
+ reVO.setProcessMaterialList("开工报告", workStartReports.size(), workStartReportsAmount,hideTypes.contains("1")?1:0,1);
|
|
|
+ reVO.setProcessMaterialList("工序资料", process.size(), processAmount,hideTypes.contains("2")?1:0,2);
|
|
|
+ reVO.setProcessMaterialList("评定资料", evaluation.size(), evaluationAmount,hideTypes.contains("3")?1:0,3);
|
|
|
+ reVO.setProcessMaterialList("中间交工", completion.size(), completionAmount,hideTypes.contains("4")?1:0,4);
|
|
|
+ }
|
|
|
|
|
|
- reVO.setProcessMaterialList("开工报告", workStartReports.size(), workStartReportsAmount);
|
|
|
- reVO.setProcessMaterialList("工序资料", process.size(), processAmount);
|
|
|
- reVO.setProcessMaterialList("评定资料", evaluation.size(), evaluationAmount);
|
|
|
- reVO.setProcessMaterialList("中间交工", completion.size(), completionAmount);
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param contractId
|
|
|
+ * @param classifyType 1施工2监理
|
|
|
+ * @param hideType 1开工报告 2工序资料 3评定资料 4中间交工
|
|
|
+ * @param type 0显示 1隐藏
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/hideProcessMaterial")
|
|
|
+ @ApiOperation(value = "隐藏进度")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ private R hideProcessMaterial(Long contractId,Integer classifyType,Integer hideType,Integer type){
|
|
|
+ classifyType = StringUtils.isEmpty(String.valueOf(classifyType)) ? 1 : classifyType;
|
|
|
+ if(type==0){
|
|
|
+ String sql="select * from m_hide_process where contract_id= "+contractId+" and classify_type= "+classifyType+" and hide_type= "+hideType;
|
|
|
+ List<HideProcess> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(HideProcess.class));
|
|
|
+ if(!list.isEmpty()){
|
|
|
+ String delete="delete from m_hide_process where id="+list.get(0).getId();
|
|
|
+ jdbcTemplate.execute(delete);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ String sql="select * from m_hide_process where contract_id= "+contractId+" and classify_type= "+classifyType+" and hide_type= "+hideType;
|
|
|
+ List<HideProcess> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(HideProcess.class));
|
|
|
+ if(list.isEmpty()){
|
|
|
+ String insertSql="insert into m_hide_process(id,contract_id,classify_type,hide_type) values("+ SnowFlakeUtil.getId()+","+contractId+","+classifyType+","+hideType+")";
|
|
|
+ jdbcTemplate.execute(insertSql);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.success("操作成功");
|
|
|
}
|
|
|
|
|
|
/**
|