Commit 58b96fc6 authored by yht15023815643's avatar yht15023815643

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents 3ac28478 59aecc57
...@@ -204,6 +204,7 @@ tenant: ...@@ -204,6 +204,7 @@ tenant:
- cb_scene_expense_month - cb_scene_expense_month
- cb_subject - cb_subject
- cb_project_other - cb_project_other
- s_materiel_project
# MyBatisPlus配置 # MyBatisPlus配置
# https://baomidou.com/config/ # https://baomidou.com/config/
......
...@@ -56,6 +56,36 @@ ...@@ -56,6 +56,36 @@
<artifactId>elasticsearch-java</artifactId> <artifactId>elasticsearch-java</artifactId>
<version>8.7.0</version> <version>8.7.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.61</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>com.zjyj</groupId>
<artifactId>cloudt-rest-client</artifactId>
<version>2.8.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>com.tencentcloudapi</groupId>--> <!-- <groupId>com.tencentcloudapi</groupId>-->
......
package com.dsk.component;
import cn.hutool.core.date.DatePattern;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.common.exception.ServiceException;
import com.dsk.common.utils.DateUtils;
import com.dsk.cscec.domain.CbProjectRecord;
import com.dsk.cscec.domain.CbQuantitySummary;
import com.dsk.cscec.domain.CbSubject;
import com.dsk.cscec.domain.SMaterielProject;
import com.dsk.cscec.mapper.CbSubjectMapper;
import com.dsk.cscec.service.CbProjectRecordService;
import com.dsk.cscec.service.ICbQuantitySummaryService;
import com.dsk.cscec.service.ISMaterielProjectService;
import com.glodon.cloudt.rest.client.RestServiceClient;
import com.glodon.cloudt.rest.client.data.HmacRestAuthInfo;
import com.glodon.cloudt.rest.client.data.RestResponseInfo;
import com.glodon.cloudt.rest.client.exception.AuthenticateException;
import com.glodon.cloudt.rest.client.exception.InvalidUriException;
import com.glodon.cloudt.rest.client.exception.NoAuthenticateException;
import com.glodon.cloudt.rest.client.impl.HmacRestServiceClient;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 物料相关组件
*
* @Author lcl
* @Data 2024/3/14 15:56
*/
@Component
public class MaterielComponent {
@Resource
private ISMaterielProjectService materielProjectService;
@Resource
private ICbQuantitySummaryService quantitySummaryService;
@Resource
private CbProjectRecordService projectRecordService;
@Resource
private CbSubjectMapper subjectMapper;
/**
* 物料项目定时拉取
*/
@Scheduled(cron = "0 0 1 20 * ? ")
public void materielProjectPull() {
String apiURI = "/api/inspection/v1.0/project/getTenantHasCodeProject";
String resStr = materielRequest(apiURI);
JSONObject jsonObject = JSONObject.parseObject(resStr);
if (!ObjectUtils.isEmpty(jsonObject.getString("data"))) {
List<SMaterielProject> list = JSON.parseArray(jsonObject.getString("data"), SMaterielProject.class);
materielProjectService.saveOrUpdateBatch(list);
}
}
/**
* 物料数据定时拉取
*/
@Scheduled(cron = "0 0 2 20 * ? ")
public void materielDataPull() {
String beginTimestamp = DatePattern.PURE_DATETIME_MS_FORMAT.format(DateUtils.addMonths(new Date(), -1));
String apiURI = "/gys/inspection-api-service/integrate-v2/getSLlist?beginTimestamp=" + beginTimestamp;
String resStr = materielRequest(apiURI);
JSONObject jsonObject = JSONObject.parseObject(resStr);
JSONObject data = JSONObject.parseObject(jsonObject.getString("data"));
JSONArray bills = JSONObject.parseArray(data.getString("Bills"));
if(ObjectUtils.isEmpty(bills)) return;
List<CbQuantitySummary> list = new ArrayList<>();
for (int i = 0; i < bills.size(); i++) {
JSONObject obj = bills.getJSONObject(i);
JSONArray bdcls = JSONObject.parseArray(obj.getString("BDCL"));
for (int j = 0; j < bdcls.size(); j++) {
JSONObject bean = bdcls.getJSONObject(j);
//材料code
String code = bean.getString("CLLBBM").substring(bean.getString("CLLBBM").lastIndexOf(".") + 1);
CbSubject subject = subjectMapper.selectOne(Wrappers.<CbSubject>lambdaQuery().eq(CbSubject::getCode, code));
//获取项目id 通过第三方项目id->ipm编码->系统项目id
String projectId = bean.getString("projectId");
if (ObjectUtils.isEmpty(projectId)) {
continue;
}
SMaterielProject materielProject = materielProjectService.getById(projectId);
if (ObjectUtils.isEmpty(materielProject) || ObjectUtils.isEmpty(materielProject.getSyncCode())) {
continue;
}
CbProjectRecord one = projectRecordService.getOne(Wrappers.<CbProjectRecord>lambdaQuery()
.eq(CbProjectRecord::getIpmProjectNo, materielProject.getSyncCode())
.orderByDesc(CbProjectRecord::getCbStage));
if(ObjectUtils.isEmpty(one)){
continue;
}
CbQuantitySummary cb = new CbQuantitySummary();
cb.setProjectId(one.getId());
cb.setCbStage(one.getCbStage());
cb.setCbSubjectName(bean.getString("CLLBMC"));
cb.setCbSubjectNo(subject.getCbSubjectNo());
cb.setCbName(bean.getString("CLMC"));
cb.setUnit(bean.getString("JLDW"));
cb.setQuantity(bean.getDouble("SJSL"));
list.add(cb);
}
}
quantitySummaryService.batchInsert(list);
System.out.println(list);
}
private String materielRequest(String apiURI) {
try {
/** ------------ 授权认证 --------------*/
//第3步:创建客户端实例
RestServiceClient serviceClient = HmacRestServiceClient.getInstance();
//第4步:加载/验证授权文件
//4.1构建认证信息
HmacRestAuthInfo restAuthInfo = new HmacRestAuthInfo();
//4.2设置授权文件路径
// restAuthInfo.setLicPath("src/main/resource/auth/auth.lic");
restAuthInfo.setLicStream(this.getClass().getResourceAsStream("/auth/auth.lic"));
//4.3权限认证
serviceClient.authenticate(restAuthInfo);
/** ------------ 拼接请求地址 --------------*/
//第5步:获取授权文件关联的GYS平台地址hostAddress
String hostAddress = serviceClient.getRestRootAddress();
//第6步:设置请求接口的URI地址apiURI(以获取集成项目列表信息为例)
//第7步:拼装完整的请求网址
String fullURL = hostAddress + apiURI;
//第8步:请求数据准备(本例中为从GYS平台获取数据,无需进行请求数据的准备)
//第9步:发送请求,用来推送/获取数据
RestResponseInfo restResponseInfo = serviceClient.get(fullURL);
/** ------------ 处理请求返回结果 --------------*/
if (restResponseInfo.isSuccess()) {
//请求成功:
//第10步:处理请求结果(第三方系统自行处理)
return restResponseInfo.getStringContent();
} else {
//请求失败:
//第11步:拼接完整的上报请求失败地址
String faultLogApiURI = "/gys/tl/services/trace/api-fault-log";
String faultLogFullURL = hostAddress + faultLogApiURI;
//第12步:构建上报请求失败数据
JSONObject faultLog = new JSONObject();
faultLog.put("requestUrl", fullURL);
faultLog.put("requestMethod", "GET");
faultLog.put("requestBody", "");
faultLog.put("statusCode", restResponseInfo.getErrorCode());
faultLog.put("response", restResponseInfo.getStringContent());
faultLog.put("description", restResponseInfo.getErrorMessage());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");//时间戳格式,到秒
LocalDateTime dateTime = LocalDateTime.now();
String searchKey = formatter.format(dateTime);
faultLog.put("searchKey", searchKey); //能表征本次请求记录的标识,方便进行问题排查
//第13步:上报请求失败数据
serviceClient.post(faultLogFullURL, faultLog.toJSONString());
}
} catch (AuthenticateException e) {
e.printStackTrace();
} catch (InvalidUriException e) {
e.printStackTrace();
} catch (NoAuthenticateException e) {
e.printStackTrace();
}
throw new ServiceException("物料接口调用失败!");
}
}
...@@ -53,5 +53,7 @@ public class CbSubject implements Serializable { ...@@ -53,5 +53,7 @@ public class CbSubject implements Serializable {
private Date createTime; private Date createTime;
private Integer sort; private Integer sort;
private String code;
} }
package com.dsk.cscec.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
* 物料项目类
*
* @Author lcl
* @Data 2024/3/15 9:15
*/
@Data
@TableName("s_materiel_project")
public class SMaterielProject {
/**
* 第三方项目id
*/
@TableId(value = "id")
private Long id;
/**
* 项目名称
*/
private String name;
private String ownerDeptName;
/**
* 项目对应的组织id
*/
private Long ownerOrg;
/**
* 项目对应的父组织id
*/
private Long parentId;
private String shortName;
/**
* 项目(建设)状态 0:未开工; 1:在建; 2:停工; 3:完工; 4:验收
*/
private Integer status;
/**
* 同步编码(ipm项目编码:project_code)
*/
private String syncCode;
/**
* 1:表示普通项目;3:表示搅拌站
*/
private Integer type;
}
package com.dsk.cscec.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.cscec.domain.SMaterielProject;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SMaterielProjectMapper extends BaseMapper<SMaterielProject> {
}
package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.cscec.domain.SMaterielProject;
public interface ISMaterielProjectService extends IService<SMaterielProject> {
}
...@@ -59,27 +59,36 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM ...@@ -59,27 +59,36 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
List<Map<String, Object>> resultList = new ArrayList<>(); List<Map<String, Object>> resultList = new ArrayList<>();
List<Map<String, Object>> list = baseMapper.selectSubject(bo); List<Map<String, Object>> list = baseMapper.selectSubject(bo);
if (!ObjectUtils.isEmpty(list)) { if (!ObjectUtils.isEmpty(list)) {
Map<String, Map<String, Map<String, List<Map<String, Object>>>>> map = list.stream() Map<String, Map<String, Map<String, Map<String, List<Map<String, Object>>>>>> map = list.stream()
.collect( .collect(
Collectors.groupingBy(item -> item.get("one").toString(), Collectors.groupingBy(item -> item.get("one").toString(),
Collectors.groupingBy(item -> item.get("two").toString(), Collectors.groupingBy(item -> item.get("two").toString(),
Collectors.groupingBy(item -> item.get("three").toString())))); Collectors.groupingBy(item -> item.get("three").toString(),
Collectors.groupingBy(item -> item.get("four").toString()
)))));
Map<String, Object> resMap = new HashMap<>(); Map<String, Object> resMap = new HashMap<>();
List<Map<String, Object>> resList = new ArrayList<>(); List<Map<String, Object>> resList = new ArrayList<>();
resMap.put("name", "房建类成本科目"); resMap.put("name", "房建类成本科目");
resMap.put("sort", 1); resMap.put("sort", 1);
for (Map.Entry<String, Map<String, Map<String, List<Map<String, Object>>>>> entry : map.entrySet()) { for (Map.Entry<String,Map<String, Map<String, Map<String, List<Map<String, Object>>>>>> entry : map.entrySet()) {
Map<String, Object> oneMap = new HashMap<>(); Map<String, Object> oneMap = new HashMap<>();
List<Map<String, Object>> oneList = new ArrayList<>(); List<Map<String, Object>> oneList = new ArrayList<>();
oneMap.put("name", entry.getKey()); oneMap.put("name", entry.getKey());
oneMap.put("sort", cbSubjectMapper.selectOne(Wrappers.<CbSubject>lambdaQuery().eq(CbSubject::getCbSubjectName, entry.getKey())).getSort()); oneMap.put("sort", cbSubjectMapper.selectOne(Wrappers.<CbSubject>lambdaQuery().eq(CbSubject::getCbSubjectName, entry.getKey())).getSort());
for (Map.Entry<String, Map<String, List<Map<String, Object>>>> twoEntry : entry.getValue().entrySet()) { for (Map.Entry<String,Map<String, Map<String, List<Map<String, Object>>>>> twoEntry : entry.getValue().entrySet()) {
Map<String, Object> twoMap = new HashMap<>(); Map<String, Object> twoMap = new HashMap<>();
List<Map<String, Object>> twoList = new ArrayList<>(); List<Map<String, Object>> twoList = new ArrayList<>();
twoMap.put("name", twoEntry.getKey()); twoMap.put("name", twoEntry.getKey());
for (Map.Entry<String, List<Map<String, Object>>> threeEntry : twoEntry.getValue().entrySet()) { for (Map.Entry<String, Map<String,List<Map<String, Object>>>> threeEntry : twoEntry.getValue().entrySet()) {
Map<String, Object> threeMap = new HashMap<>(); Map<String, Object> threeMap = new HashMap<>();
List<Map<String, Object>> threeList = new ArrayList<>();
threeMap.put("name", threeEntry.getKey()); threeMap.put("name", threeEntry.getKey());
for (Map.Entry<String, List<Map<String, Object>>> fourEntry : threeEntry.getValue().entrySet()) {
Map<String, Object> fourMap = new HashMap<>();
fourMap.put("name", fourEntry.getKey());
threeList.add(fourMap);
}
threeMap.put("children", threeList);
twoList.add(threeMap); twoList.add(threeMap);
} }
twoMap.put("children", twoList); twoMap.put("children", twoList);
......
package com.dsk.cscec.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.cscec.domain.SMaterielProject;
import com.dsk.cscec.mapper.SMaterielProjectMapper;
import com.dsk.cscec.service.ISMaterielProjectService;
import org.springframework.stereotype.Service;
/**
* @Author lcl
* @Data 2024/3/15 10:00
*/
@Service
public class SMaterielProjectServiceImpl extends ServiceImpl<SMaterielProjectMapper, SMaterielProject> implements ISMaterielProjectService{
}
Fsj/9hmISdE3AkSo8tpwb2an4K+BGCrN5xafwa0p3ej89iE7bllHhR1WU25d+UVI23K9ib+YYOoYqdPpodi1tm5G1AELKEEOhXAb5cAohVJ7Z7a7ABEw4hf39qLy3AjCTWsn8XBJmszNvx9gPZ+6mUGgqOEnuwNa+smkEtV24QXqPfB+wugDXLOMB6GK/GLRzDe5vbbLEWHzoKCbZloAgnMJqfjlBrgfekQRPwwASfsreQsWCeOcuh7ValPaj7/s9fuaDqg3nSTUXZwnORiteC2BH6PJa41hKVDRGgOEZMtXROcD01LizyjbstdQE0EnCJsk3P76zvzaY2w547NCmyqwhl9sCmpoB+CbAVctDR2DXnVg22Y2QdHDe0eoa66dFR/FCZaD1/LTM/xbIGZaZ3kJyP8XzQYtrzq5Go6WkpMUSOeRcjJ4JlNPU7oN67P4AAHiG6sI5n6hZTr+6InpPoCMvqPbcyNanrc+Eo7h3ToqF0XyU9uzblgcZbRtCuvmERvoZ/siTQhl/bTntG71NsA2WT3SnWsAf0MrwlkJqnwErn1ynit5nfeStDeX2+vfL16UCvDDnCG1JU2GcbYYK3dAkPXlADD6lp//s2TJuRzeeBlGfp88rSDS5EmcwSmn1F1ZoVipP7M92vmWq4bO1sowqEaHJmXmMP99WfUiW9KYGZa223CJONINBFEH1IlDrzJ1yh79uE2KxP3E9n00RX6SjZ/TbJWVTgBP5t9oXeASFIMqetdP8ZfgjwsiL0J1ag1uYMbbbmS8nJDL13O2sII6YTPDQ2qcW/9a2Iy/MwILHENplZpWZn1ifmZifsqASVlenVnjy2brnoGXLFS0hbynVRAzt44MDHonOzHsvZ4e4ZfXU55YoBNJRPe6oLgRUCxPsA2LjXWgH5YNa9pJya0XQeI69h876z+w6fg2dFGabJdB+2dE/JTOw2J8gbfjG9N9Lf8FawtLAr5GIEFLzXpr/QusnmYzuIbXN0fxn/7f6DLArS9uABaiuNVDjDrCVuMGNyrgtIgo8rIShuZjU+7uIE3xsD6srnZ7EvV1fA+SATk+XgWNmgMaiPriRDj2y1mTOIXRWtLGHFaCi2w6yA==
\ No newline at end of file
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<mapper namespace="com.dsk.cscec.mapper.CbQuantitySummaryMapper"> <mapper namespace="com.dsk.cscec.mapper.CbQuantitySummaryMapper">
<insert id="batchInsert" parameterType="com.dsk.cscec.domain.CbQuantitySummary"> <insert id="batchInsert" parameterType="com.dsk.cscec.domain.CbQuantitySummary">
INSERT INTO cscec_bms.cb_quantity_summary INSERT INTO cscec_bms.cb_quantity_summary
(project_id, `number`, cb_stage, cb_subject_name, company_no, org_no, cb_name, job_content, (project_id, `number`, cb_stage, cb_subject_name, cb_subject_no, company_no, org_no, cb_name, job_content,
calculation_rule, unit, material_description, guide_price, bid_unit_price, unit_price_difference, quantity, calculation_rule, unit, material_description, guide_price, bid_unit_price, unit_price_difference, quantity,
combined_price, combined_price_tax, brand_name, bid_source, remark, cb_project_file_id) combined_price, combined_price_tax, brand_name, bid_source, remark, cb_project_file_id)
VALUES VALUES
<foreach collection="list" item="item" separator="," > <foreach collection="list" item="item" separator="," >
(#{item.projectId}, #{item.number}, #{item.cbStage}, #{item.cbSubjectName}, #{item.companyNo}, #{item.orgNo}, #{item.cbName}, (#{item.projectId}, #{item.number}, #{item.cbStage}, #{item.cbSubjectName}, #{item.cbSubjectNo}, #{item.companyNo}, #{item.orgNo}, #{item.cbName},
#{item.jobContent},#{item.calculationRule},#{item.unit},#{item.materialDescription},#{item.guidePrice}, #{item.jobContent},#{item.calculationRule},#{item.unit},#{item.materialDescription},#{item.guidePrice},
#{item.bidUnitPrice},#{item.unitPriceDifference},#{item.quantity},#{item.combinedPrice},#{item.combinedPriceTax}, #{item.bidUnitPrice},#{item.unitPriceDifference},#{item.quantity},#{item.combinedPrice},#{item.combinedPriceTax},
#{item.brandName},#{item.bidSource},#{item.remark},#{item.cbProjectFileId}) #{item.brandName},#{item.bidSource},#{item.remark},#{item.cbProjectFileId})
...@@ -17,13 +17,46 @@ ...@@ -17,13 +17,46 @@
<select id="selectSubject" resultType="java.util.Map"> <select id="selectSubject" resultType="java.util.Map">
select select
cs1.cb_subject_name as one, cs2.cb_subject_name as two, cs3.cb_subject_name as three cs1.cb_subject_name as one, cs2.cb_subject_name as two, cs3.cb_subject_name as three , '' as four
from cb_subject cs1 from cb_subject cs1
join cb_subject cs2 on (cs2.cb_subject_no like concat(cs1.cb_subject_no,'%') and cs2.`level` = 2 ) join cb_subject cs2 on (cs2.cb_subject_no like concat(cs1.cb_subject_no,'%') and cs2.`level` = 2 )
join cb_subject cs3 on (cs3.cb_subject_no like concat(cs2.cb_subject_no,'%') and cs3.`level` = 3 ) join cb_subject cs3 on (cs3.cb_subject_no like concat(cs2.cb_subject_no,'%') and cs3.`level` = 3 )
join cb_quantity_summary cqs on (cqs.cb_subject_name = cs3.cb_subject_name and cqs.del_falg = 0 and cqs.project_id = #{projectId} and cqs.cb_stage = #{cbStage} ) join cb_quantity_summary cqs on (cqs.cb_subject_name = cs3.cb_subject_name and cqs.del_falg = 0 and cqs.project_id = #{projectId} and cqs.cb_stage = #{cbStage} )
where cs1.`level` = 1 where cs1.`level` = 1 and cs1.cb_subject_no != 'CL'
group by cs1.cb_subject_name,cs2.cb_subject_name,cs3.cb_subject_name group by cs1.cb_subject_name,cs2.cb_subject_name,cs3.cb_subject_name
union all
select
cs1.cb_subject_name as one, cs2.cb_subject_name as two, '' as three, '' as four
from cb_subject cs1
join cb_subject cs2 on (cs2.cb_subject_no like concat(cs1.cb_subject_no,'%') and cs2.`level` = 2 )
join cb_quantity_summary cqs on (cqs.cb_subject_no = cs2.cb_subject_no and cqs.del_falg = 0 and cqs.project_id = #{projectId} and cqs.cb_stage = #{cbStage} )
where cs1.`level` = 1 and cs1.cb_subject_no = 'CL'
group by cs1.cb_subject_name,cs2.cb_subject_name
union all
select
cs1.cb_subject_name as one, cs2.cb_subject_name as two, cs3.cb_subject_name as three, '' as four
from cb_subject cs1
join cb_subject cs2 on (cs2.cb_subject_no like concat(cs1.cb_subject_no,'%') and cs2.`level` = 2 )
join cb_subject cs3 on (cs3.cb_subject_no like concat(cs2.cb_subject_no,'%') and cs3.`level` = 3 )
join cb_quantity_summary cqs on (cqs.cb_subject_no = cs3.cb_subject_no and cqs.del_falg = 0 and cqs.project_id = #{projectId} and cqs.cb_stage = #{cbStage} )
where cs1.`level` = 1 and cs1.cb_subject_no = 'CL'
group by cs1.cb_subject_name,cs2.cb_subject_name,cs3.cb_subject_name
union all
select
cs1.cb_subject_name as one, cs2.cb_subject_name as two, cs3.cb_subject_name as three, cs4.cb_subject_name as four
from cb_subject cs1
join cb_subject cs2 on (cs2.cb_subject_no like concat(cs1.cb_subject_no,'%') and cs2.`level` = 2 )
join cb_subject cs3 on (cs3.cb_subject_no like concat(cs2.cb_subject_no,'%') and cs3.`level` = 3 )
join cb_subject cs4 on (cs4.cb_subject_no like concat(cs3.cb_subject_no,'%') and cs4.`level` = 4 )
join cb_quantity_summary cqs on (cqs.cb_subject_no = cs4.cb_subject_no and cqs.del_falg = 0 and cqs.project_id = #{projectId} and cqs.cb_stage = #{cbStage} )
where cs1.`level` = 1 and cs1.cb_subject_no = 'CL'
group by cs1.cb_subject_name,cs2.cb_subject_name,cs3.cb_subject_name,cs4.cb_subject_name
</select> </select>
<select id="selectOtherSubjectCount" resultType="java.lang.Integer"> <select id="selectOtherSubjectCount" resultType="java.lang.Integer">
......
...@@ -59,6 +59,7 @@ export default { ...@@ -59,6 +59,7 @@ export default {
}, },
//可访问data属性 //可访问data属性
created() { created() {
console.log(this.tabs,"||||||||")
this.initSlidingBar(); this.initSlidingBar();
}, },
//计算集 //计算集
......
...@@ -173,6 +173,10 @@ export default { ...@@ -173,6 +173,10 @@ export default {
let startTime = '' let startTime = ''
let endTime = new Date() let endTime = new Date()
switch (value) { switch (value) {
case '昨日':
startTime = new Date(endTime.getTime() - 3600 * 1000 * 24 * 1)
timeStr = [this.formatDate(startTime), this.formatDate(endTime)]
break;
case '今日': case '今日':
startTime = new Date(endTime.getTime()) startTime = new Date(endTime.getTime())
timeStr = [this.formatDate(startTime), this.formatDate(endTime)] timeStr = [this.formatDate(startTime), this.formatDate(endTime)]
......
<!-- 表格组件 -->
<template>
<div class="infoTable-container">
<h2 v-if="title !== '' && isSubTitle" class="infoTable-title">
{{ title }}
</h2>
<el-form class="infoTable-form" label-position="left">
<template v-for="(item, index) in list">
<el-form-item :style="item.span?{width: `${100/(24/item.span)}%`}:{}" :label="item.name" :label-width="labelWidth?labelWidth+'px':'130px'" :key="index" :class="[
{ 'infoTable-form-view': item.style },
{ 'infoTable-form-item': !item.style },
{ 'infoTable-form-row': item.rowstyle }
]">
<div>
<template v-if="item.slot === true">
<slot :name="item.prop" :data="obj"></slot>
</template>
<span v-else> {{ obj[item.prop] ?obj[item.prop] !==""?item.formatter?item.formatter(obj[item.prop]):obj[item.prop]:'-' :'-' }}</span>
</div>
</el-form-item>
</template>
</el-form>
<!--<div v-else class="no-data">-->
<!--<div class="no-data-box" v-if="show">-->
<!--<img :src="noData" alt="暂时没有找到相关数据" />-->
<!--<span>暂时没有找到相关数据</span>-->
<!--</div>-->
<!--</div>-->
</div>
</template>
<script>
export default {
name: "InfoTable",
components: {
},
props: {
list: {
type: Array,
default: () => [],
},
title: {
type: String,
default: "",
},
obj: {
type: Object,
default: () => { }
},
labelWidth: {
type: Number,
default: null
},
isSubTitle: {
type: Boolean,
default: false,
},
},
data() {
return {
show:false,
// 当前移入单元格内容
noData: require("@/assets/images/detail/noData.png")
};
},
created() {
},
mounted(){
this.show = true;
},
methods: {
},
};
</script>
<style lang="scss" scoped>
.infoTable-container {
.infoTable-title {
font-size: 16px;
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
font-weight: bold;
padding-left: 8px;
border-left: 2px solid #58637B;
color: #000000;
text-shadow: 0px 0px 10px rgba(0, 37, 106, 0.10000000149011612);
margin: 0 0 16px 0;
}
.infoTable-form {
display: flex;
flex-wrap: wrap;
border-left: 1px solid #e5e9f5;
border-top: 1px solid #e5e9f5;
border-collapse: collapse;
.infoTable-form-item {
width: 50%;
flex: auto;
margin-bottom: 0px;
border-right: 1px solid #e5e9f5;
border-bottom: 1px solid #e5e9f5;
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
font-size: 13px;
}
.infoTable-form-view {
width: 100%;
flex: auto;
margin-bottom: 0px;
border-right: 1px solid #e5e9f5;
border-bottom: 1px solid #e5e9f5;
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
font-size: 13px;
}
.infoTable-form-row {
width: 33%;
flex: auto;
margin-bottom: 0px;
border-right: 1px solid #e5e9f5;
border-bottom: 1px solid #e5e9f5;
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
font-size: 13px;
}
::v-deep .el-form-item__label {
height: 100%;
background-color: #F0F3FA;
padding: 8px 12px 8px 12px;
font-size: 13px;
font-weight: normal;
color: rgba(35,35,35,0.8);
display: flex;
align-items: center;
line-height: normal;
}
::v-deep .el-form-item__content {
padding-left: 12px;
font-size: 13px;
color: #232323;
}
::v-deep .el-form-item__content {
border-left: 1px solid #e5e9f5;
height: 100%;
display: flex;
align-items: center;
}
::v-deep .el-col {
border-bottom: 1px solid #e5e9f5;
}
}
.no-data {
font-size: 14px;
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
font-weight: 400;
color: #999999;
text-shadow: 0px 0px 10px rgba(0, 37, 106, 0.10000000149011612);
max-width: 1200px;
height: 328px;
display: flex;
justify-content: center;
align-items: center;
background: #ffffff;
border-radius: 0px 0px 0px 0px;
opacity: 1;
border: 1px solid #eeeeee;
.no-data-box {
display: flex;
flex-direction: column;
align-items: center;
img {
width: 64px;
height: 79px;
margin-bottom: 16px;
}
}
}
::v-deep .el-form-item__content {
line-height: 22px;
padding: 6px 4px;
}
}
</style>
...@@ -289,7 +289,7 @@ export default { ...@@ -289,7 +289,7 @@ export default {
includeNowMonth(time) { includeNowMonth(time) {
return this.originMonthList.find(item => item.expenseDate == time); return this.originMonthList.find(item => item.expenseDate == time);
}, },
// 按项目汇总 按成本科目汇总 // 按项目汇总 按成本科目汇总
currentCategoryChange(category) { currentCategoryChange(category) {
if (category == this.currentCategory) return; if (category == this.currentCategory) return;
this.currentCategory = category; this.currentCategory = category;
...@@ -386,6 +386,10 @@ export default { ...@@ -386,6 +386,10 @@ export default {
const result = await getCostSummaryMenuTreeApi(params); const result = await getCostSummaryMenuTreeApi(params);
if (result.code == 200 && result.data instanceof Array) { if (result.code == 200 && result.data instanceof Array) {
const _tempArray = result.data; const _tempArray = result.data;
if(_tempArray.length === 0){
this.currentCategory=2
return this.init(this.comProjectDetailInfo);
}
const _tempMenu = { const _tempMenu = {
id: 0, id: 0,
cbName: this.currentCategory == 1 ? "成本汇总" : "房建类成本科目", cbName: this.currentCategory == 1 ? "成本汇总" : "房建类成本科目",
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</div> </div>
</template> </template>
<script> <script>
import InfoTable from '../../../../component/infoTable'; import InfoTable from '../../../component/infoTable';
import { getCbProjectInfo } from "@/api/projectCostLedger"; import { getCbProjectInfo } from "@/api/projectCostLedger";
export default { export default {
name: "projectInformation", name: "projectInformation",
......
...@@ -92,7 +92,17 @@ ...@@ -92,7 +92,17 @@
<el-table-column label="税金类型" width="130" prop="taxType"> <el-table-column label="税金类型" width="130" prop="taxType">
<template slot-scope="scope">{{scope.row.taxType || '--'}}</template> <template slot-scope="scope">{{scope.row.taxType || '--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="本月工程量" width="130" prop="projectVolume">
<template slot-scope="scope">
<template v-if="isinput">
<el-input v-model="scope.row.projectVolume "></el-input>
</template>
<template v-else>{{scope.row.projectVolume || '--'}}</template>
</template>
</el-table-column>
<el-table-column label="截止本月工程量" width="130" prop="currentProjectVolume">
<template slot-scope="scope">{{scope.row.suncurrentProjectVolume || '--'}}</template>
</el-table-column>
<el-table-column label="本月成本发生比例" width="150" prop="monthCostRate"> <el-table-column label="本月成本发生比例" width="150" prop="monthCostRate">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="isinput"> <template v-if="isinput">
...@@ -102,34 +112,28 @@ ...@@ -102,34 +112,28 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="成本合价" width="130" prop="costEffective"> <el-table-column label="成本合价" width="130" prop="costEffective">
<template slot-scope="scope">{{scope.row.costEffective || '--'}}</template>
</el-table-column>
<el-table-column label="本月工程量" width="130" prop="projectVolume">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="isinput"> <template v-if="isinput">
<el-input v-model="scope.row.projectVolume "></el-input> <el-input v-model="scope.row.costEffective "></el-input>
</template> </template>
<template v-else>{{scope.row.projectVolume || '--'}}</template> <template v-else>{{scope.row.costEffective || '--'}}</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="截止本月工程量" width="130" prop="currentProjectVolume"> <!--<el-table-column label="本月推送工程量" width="130" prop="submitProjectVolume">-->
<template slot-scope="scope">{{scope.row.suncurrentProjectVolume || '--'}}</template> <!--<template slot-scope="scope">{{scope.row.submitProjectVolume || '&#45;&#45;'}}</template>-->
</el-table-column> <!--</el-table-column>-->
<el-table-column label="本月推送工程量" width="130" prop="submitProjectVolume">
<template slot-scope="scope">{{scope.row.submitProjectVolume || '--'}}</template>
</el-table-column>
<el-table-column label="备注" width="130" prop="remarks"> <el-table-column label="备注" width="130" prop="remarks">
<template slot-scope="scope">{{scope.row.remarks || '--'}}</template> <template slot-scope="scope">{{scope.row.remarks || '--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="是否推送" width="130"> <!--<el-table-column label="是否推送" width="130">-->
<template slot-scope="scope">{{scope.row.pushTime?'是':'否'}}</template> <!--<template slot-scope="scope">{{scope.row.pushTime?'是':'否'}}</template>-->
</el-table-column> <!--</el-table-column>-->
<el-table-column label="操作" width="130" fixed="right"> <!--<el-table-column label="操作" width="130" fixed="right">-->
<template slot-scope="scope"> <!--<template slot-scope="scope">-->
<span class="wordprimary" @click="pushwork(scope.row)">推送工程量</span> <!--<span class="wordprimary" @click="pushwork(scope.row)">推送工程量</span>-->
</template> <!--</template>-->
</el-table-column> <!--</el-table-column>-->
</el-table> </el-table>
</div> </div>
...@@ -532,6 +536,18 @@ ...@@ -532,6 +536,18 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
.meafixed-table{
// 解决拖拽表格滚动条,错位问题
::v-deep .el-table__header-wrapper{
padding-right: 16px!important; // 滚动条宽度
}
::v-deep .el-table--border th.el-table__cell.gutter:last-of-type {
display: block!important;
width: 16px!important;
}
}
::v-deep .tored{ ::v-deep .tored{
/*background: rgb(255,236,236) !important;*/ /*background: rgb(255,236,236) !important;*/
} }
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
:tableLoading="tableLoading" :tableLoading="tableLoading"
:tableData="tableData1" :tableData="tableData1"
:forData="forData1" :forData="forData1"
:indexFixed="true"
:MaxPage=500 :MaxPage=500
:tableDataTotal="tableDataTotal1" :tableDataTotal="tableDataTotal1"
:queryParams="queryParams" :queryParams="queryParams"
...@@ -96,7 +97,7 @@ export default { ...@@ -96,7 +97,7 @@ export default {
{label: '占比', prop: 'proportion', slot: true}, {label: '占比', prop: 'proportion', slot: true},
], ],
forData1: [ forData1: [
{label: '清单内容', prop: 'itemContent',minWidth:'220'}, {label: '清单内容', prop: 'itemContent',minWidth:'220', fixed: "left"},
{label: '工作内容、做法/规格型号/施工现场配置说明', prop: 'workContent',minWidth:'302'}, {label: '工作内容、做法/规格型号/施工现场配置说明', prop: 'workContent',minWidth:'302'},
{label: '单位', prop: 'unit',minWidth:'115'}, {label: '单位', prop: 'unit',minWidth:'115'},
{label: '不含税单价', prop: 'unitPriceExcludingTax',minWidth:'115'}, {label: '不含税单价', prop: 'unitPriceExcludingTax',minWidth:'115'},
......
...@@ -83,46 +83,54 @@ export default { ...@@ -83,46 +83,54 @@ export default {
{ {
value: "basicEngineeringInformation", value: "basicEngineeringInformation",
name: "工程项目信息", name: "工程项目信息",
disabled:false,
id: v4() id: v4()
}, },
{ {
value: "directCost", value: "directCost",
name: "直接费成本", name: "直接费成本",
disabled:false,
cbType: 0, cbType: 0,
id: v4() id: v4()
}, },
{ {
value: "feedSummary", value: "feedSummary",
name: "工料汇总", name: "工料汇总",
disabled:false,
cbType: 1, cbType: 1,
id: v4() id: v4()
}, },
{ {
name: "措施项目", name: "措施项目",
value: "measureItem", value: "measureItem",
disabled:false,
cbType: 2, cbType: 2,
id: v4() id: v4()
}, },
{ {
name: "其他项目", name: "其他项目",
value: "otherItems", value: "otherItems",
disabled:false,
cbType: 3, cbType: 3,
id: v4() id: v4()
}, },
{ {
name: "现场经费", name: "现场经费",
value: "fieldExpenses", value: "fieldExpenses",
disabled:false,
cbType: 4, cbType: 4,
id: v4() id: v4()
}, },
{ {
name: "成本汇总", name: "成本汇总",
value: "cost", value: "cost",
disabled:false,
cbType: 5, cbType: 5,
id: v4() id: v4()
}, },
{ {
name: "盈亏分析对比", name: "盈亏分析对比",
disabled:false,
value: "profitAndLoss", value: "profitAndLoss",
cbType: 1, cbType: 1,
id: v4() id: v4()
......
...@@ -171,25 +171,47 @@ ...@@ -171,25 +171,47 @@
<span>{{protitle}}</span> <span>{{protitle}}</span>
</div> </div>
<el-form class="popform" label-width="97px" :model="queryParam" :rules="rules" ref="ruleForm"> <el-form class="popform" label-width="97px" :model="queryParam" :rules="rules" ref="ruleForm">
<el-form-item label="项目名称" class="row"> <el-form-item label="成本计划" class="row">
<el-input type="text" v-model="queryParam.projectName" placeholder="请输入完整的项目名称"></el-input> <el-select placeholder="请选择成本计划" v-model="cbjh">
</el-form-item> <el-option v-for="(item,index) in cbjhlist" :label="item.label" :value="item.value" :key="index"></el-option>
<el-form-item label="IPM项目编码" class="row">
<el-input type="text" placeholder="请输入IPM项目编码" v-model="queryParam.ipmProjectNo">
<template slot="append"><div class="pro-getbtn" @click="getipmProjectNo">获取数据</div></template>
</el-input>
</el-form-item>
<el-form-item label="文件名称" class="row">
<el-input type="text" placeholder="请输入文件名称" v-model="queryParam.projectFileName"></el-input>
</el-form-item>
<el-form-item label="成本阶段" class="row" prop="cbStage">
<el-checkbox v-model="ischeck" v-if="isedit" class="checkcb"></el-checkbox>
<el-select placeholder="请选择成本阶段" v-model="queryParam.cbStage" :disabled="!ischeck">
<el-option v-for="(item,index) in cbStagelist" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<template v-if="cbjh === '已有成本计划'">
<el-form-item label="项目名称" class="row">
<el-input type="text" v-model="queryParam.projectName" placeholder="请输入完整的项目名称"></el-input>
</el-form-item>
<el-form-item label="IPM项目编码" class="row">
<el-input type="text" placeholder="请输入IPM项目编码" v-model="queryParam.ipmProjectNo">
<template slot="append"><div class="pro-getbtn" @click="getipmProjectNo">获取数据</div></template>
</el-input>
</el-form-item>
<el-form-item label="文件名称" class="row">
<el-input type="text" placeholder="请输入文件名称" v-model="queryParam.projectFileName"></el-input>
</el-form-item>
<el-form-item label="成本阶段" class="row" prop="cbStage">
<el-checkbox v-model="ischeck" v-if="isedit" class="checkcb"></el-checkbox>
<el-select placeholder="请选择成本阶段" v-model="queryParam.cbStage" :disabled="!ischeck">
<el-option v-for="(item,index) in cbStagelist" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
</el-select>
</el-form-item>
</template>
<template v-if="cbjh === '暂无成本计划'">
<el-form-item label="项目名称" class="row">
<el-input type="text" v-model="queryParam.projectName" placeholder="请输入完整的项目名称"></el-input>
</el-form-item>
<el-form-item label="IPM项目编码" class="row">
<el-input type="text" placeholder="请输入IPM项目编码" v-model="queryParam.ipmProjectNo">
<template slot="append"><div class="pro-getbtn" @click="getipmProjectNo">获取数据</div></template>
</el-input>
</el-form-item>
</template>
</el-form > </el-form >
<div class="popbot"> <div class="popbot" v-if="cbjh === '暂无成本计划'">
<div class="btn btn_cancel h32" @click="dialogVisible = false">取消</div>
<div class="btn btn_primary h32" v-if="isedit && !ischeck" @click="savepro">创建项目</div>
</div>
<div class="popbot" v-else>
<div class="btn btn_cancel h32" @click="dialogVisible = false">取消</div> <div class="btn btn_cancel h32" @click="dialogVisible = false">取消</div>
<div class="btn btn_primary h32" v-if="isedit && !ischeck" @click="savepro">保存</div> <div class="btn btn_primary h32" v-if="isedit && !ischeck" @click="savepro">保存</div>
<div class="btn btn_primary h32" v-if="isedit && ischeck" @click="changepro">下一步,导入数据</div> <div class="btn btn_primary h32" v-if="isedit && ischeck" @click="changepro">下一步,导入数据</div>
...@@ -279,6 +301,17 @@ ...@@ -279,6 +301,17 @@
dialogVisible:false, dialogVisible:false,
cbStagelist:[], cbStagelist:[],
ztStagelist:[], ztStagelist:[],
cbjhlist:[
{
value: '已有成本计划',
label: '已有成本计划'
},
{
value: '暂无成本计划',
label: '暂无成本计划'
},
],
cbjh:'',
//新建项目参数 //新建项目参数
queryParam:{ queryParam:{
projectName:'',//项目名称 projectName:'',//项目名称
......
This diff is collapsed.
...@@ -831,7 +831,7 @@ ...@@ -831,7 +831,7 @@
}); });
}, },
iptAdaptive(uid, multiple = false, name) { iptAdaptive(uid, multiple = false, name) {
multiple ? this.multipleAdaptiveHandle(uid, name) : this.iptAdaptiveHandle(uid, name); multiple ? this.multipleAdaptiveHandle(uid, name) : this.iptAdaptiveHandle(uid, name);
}, },
//单选 //单选
async iptAdaptiveHandle(uid, name) { async iptAdaptiveHandle(uid, name) {
......
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