包头bug修改

This commit is contained in:
guoshengxiong 2025-03-11 19:44:30 +08:00
parent 6046447662
commit c6b5c073eb
8 changed files with 146 additions and 14 deletions

View File

@ -1,12 +1,20 @@
package com.zhgd.xmgl.modules.baotou.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.constant.Cts;
import com.zhgd.xmgl.modules.baotou.entity.PouringOrderLedger;
import com.zhgd.xmgl.modules.baotou.service.IPouringOrderLedgerService;
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
import com.zhgd.xmgl.util.EasyPoiUtil;
import com.zhgd.xmgl.util.Fileutils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -15,12 +23,18 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.simpleframework.xml.core.Validate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -37,6 +51,9 @@ import java.util.Map;
public class PouringOrderLedgerController {
@Autowired
private IPouringOrderLedgerService pouringOrderLedgerService;
@Lazy
@Autowired
private ISystemUserService systemUserService;
/**
* 分页列表查询
@ -80,7 +97,6 @@ public class PouringOrderLedgerController {
return Result.ok();
}
/**
* 编辑
*
@ -158,4 +174,76 @@ public class PouringOrderLedgerController {
return Result.success(pouringOrderLedgerService.getCountDetails(param));
}
@OperLog(operModul = "混凝土浇筑申请记录管理", operType = "", operDesc = "导出pdf文件")
@ApiOperation(value = "导出pdf文件", notes = "导出pdf文件", httpMethod = "GET")
@ApiImplicitParam(name = "id", value = "id", paramType = "query", required = true, dataType = "String")
@GetMapping("exportPdf")
public void exportPdf(HttpServletResponse response, @RequestParam(name = "id", required = true) String id) throws IOException {
Map<String, Object> map = new HashMap<>();
PouringOrderLedger fire = pouringOrderLedgerService.queryById(id);
map.put("castingNumber", fire.getCastingNumber());
map.put("device", fire.getDevice());
map.put("projectGroupId", fire.getProjectGroupId());
map.put("supervisor", fire.getSupervisor());
map.put("epcPcContractor", fire.getEpcPcContractor());
map.put("castingLocation", fire.getCastingLocation());
map.put("pouringBeginTime", DateUtil.format(fire.getPouringBeginTime(), "MM月dd日HH时"));
map.put("pouringEndTime", DateUtil.format(fire.getPouringEndTime(), "MM月dd日HH时"));
map.put("detail", fire.getDetail());
map.put("constructionWorker", fire.getConstructionWorker());
map.put("constructionDate", DateUtil.format(fire.getConstructionDate(), "yyyy年MM月dd日"));
map.put("projectSn", fire.getProjectSn());
map.put("createTime", fire.getCreateTime());
map.put("updateTime", fire.getUpdateTime());
map.put("status", fire.getStatus());
map.put("mixProportion", fire.getMixProportion());
map.put("designSlump", fire.getDesignSlump());
map.put("estimatedPouringVolume", fire.getEstimatedPouringVolume());
map.put("constructionShiftSupervisor", fire.getConstructionShiftSupervisor());
map.put("designStrength", fire.getDesignStrength());
map.put("constructionJointReservePosition", fire.getConstructionJointReservePosition());
map.put("manpowerMachineReadiness", fire.getManpowerMachineReadiness());
map.put("supplyStation", fire.getSupplyStation());
map.put("professionalSupervisionEngineer", fire.getProfessionalSupervisionEngineer());
map.put("professionalSupervisionEngineerDate", DateUtil.format(fire.getProfessionalSupervisionEngineerDate(), "yyyy年MM月dd日"));
map.put("contractModel", fire.getContractModel());
map.put("epcProfessionalEngineer", fire.getEpcProfessionalEngineer());
map.put("supervisionProfessionalEngineer", fire.getSupervisionProfessionalEngineer());
map.put("projectTeamProfessionalEngineer", fire.getProjectTeamProfessionalEngineer());
map.put("epcContractor", fire.getEpcContractor());
map.put("constructionContractor", fire.getConstructionContractor());
map.put("actualPouringVolume", fire.getActualPouringVolume());
map.put("remark", fire.getRemark());
map.put("projectGroupName", fire.getProjectGroupName());
map.put("concreteSupplierName", fire.getConcreteSupplierName());
map.put("epcPcContractorName", fire.getEpcPcContractorName());
map.put("deviceName", fire.getDeviceName());
map.put("supervisorName", fire.getSupervisorName());
// map.put("constructionWorkerName", fire.getConstructionWorkerName());
map.put("constructionShiftSupervisorName", fire.getConstructionShiftSupervisorName());
map.put("professionalSupervisionEngineerName", fire.getProfessionalSupervisionEngineerName());
// map.put("epcProfessionalEngineerName", fire.getEpcProfessionalEngineerName());
// map.put("supervisionProfessionalEngineerName", fire.getSupervisionProfessionalEngineerName());
// map.put("projectTeamProfessionalEngineerName", fire.getProjectTeamProfessionalEngineerName());
map.put("epcContractorName", fire.getEpcContractorName());
map.put("constructionContractorName", fire.getConstructionContractorName());
map.put("epcProfessionalEngineerDate", DateUtil.format(fire.getEpcProfessionalEngineerDate(), "yyyy年MM月dd日"));
map.put("supervisionProfessionalEngineerDate", DateUtil.format(fire.getSupervisionProfessionalEngineerDate(), "yyyy年MM月dd日"));
map.put("projectTeamProfessionalEngineerDate", DateUtil.format(fire.getProjectTeamProfessionalEngineerDate(), "yyyy年MM月dd日"));
Map<Long, SystemUser> userMap = systemUserService.list(new LambdaQueryWrapper<SystemUser>()
.eq(SystemUser::getSn, fire.getProjectSn()).last(Cts.IGNORE_DATA_SCOPE_CONDITION)).stream().collect(Collectors.toMap(SystemUser::getUserId, Function.identity()));
map.put("constructionWorkerName", EasyPoiUtil.getImgFromUser(userMap.get(fire.getConstructionWorker()), 50, 25));
map.put("epcProfessionalEngineerName", EasyPoiUtil.getImgFromUser(userMap.get(fire.getEpcProfessionalEngineer()), 50, 25));
map.put("supervisionProfessionalEngineerName", EasyPoiUtil.getImgFromUser(userMap.get(fire.getSupervisionProfessionalEngineer()), 50, 25));
map.put("projectTeamProfessionalEngineerName", EasyPoiUtil.getImgFromUser(userMap.get(fire.getProjectTeamProfessionalEngineer()), 50, 25));
String url;
// url = "C:\\Users\\Administrator\\Desktop\\混凝土浇筑申请记录模板.docx";
url = Fileutils.getExportTemplateFile("excel/work/混凝土浇筑申请记录模板.docx").getAbsolutePath();
File tempFile = File.createTempFile(IdUtil.simpleUUID(), ".docx");
EasyPoiUtil.exportNewLineWord(map, url, tempFile);
EasyPoiUtil.wordToPdfExport(response, tempFile);
}
}

View File

@ -116,16 +116,28 @@ public class PouringOrderLedger implements Serializable {
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value="专业监理工程师日期")
private java.util.Date professionalSupervisionEngineerDate ;
private java.util.Date professionalSupervisionEngineerDate;
@Excel(name = "合同模式", width = 15, replace = {"EPC_1", "E+P+C_2"})
@ApiModelProperty("合同模式1EPC;2E+P+C")
private Integer contractModel;
@ApiModelProperty(value="EPC专业工程师")
@ApiModelProperty(value = "EPC专业工程师")
private java.lang.Long epcProfessionalEngineer;
@ApiModelProperty(value = "监理专业工程师")
private java.lang.Long supervisionProfessionalEngineer;
@ApiModelProperty(value = "项目组专业工程师")
private java.lang.Long projectTeamProfessionalEngineer;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "EPC专业工程师日期")
private Date epcProfessionalEngineerDate;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "监理专业工程师日期")
private Date supervisionProfessionalEngineerDate;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "项目组专业工程师日期")
private Date projectTeamProfessionalEngineerDate;
@ApiModelProperty(value = "EPC承包商")
private java.lang.Long epcContractor;

View File

@ -100,9 +100,28 @@
left join enterprise_info ei4 on ei4.id = t.epc_contractor
left join enterprise_info ei5 on ei5.id = t.construction_contractor
left join device_unit du on du.id=t.device
where t.project_sn = #{projectSn} and t.contract_model = 1
where t.project_sn = #{projectSn}
<if test="device != null and device != ''">
and t.device = #{device}
</if>
<if test="projectGroupId != null and projectGroupId != ''">
and t.project_group_id = #{projectGroupId}
</if>
<if test="epcContractor != null and epcContractor != ''">
and t.epc_contractor = #{epcContractor}
</if>
<if test="constructionContractor != null and constructionContractor != ''">
and t.construction_contractor = #{constructionContractor}
</if>
<if test="supplyStation != null and supplyStation != ''">
and t.supply_station = #{supplyStation}
</if>
<if test="groupby != null and groupby != ''">
${groupby}
</if>
</select>
</mapper>

View File

@ -102,7 +102,7 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
List<String> split = StrUtil.split(recordIds, ",");
queryWrapper.in(RefUtil.fieldNameUlc(PlanRecord::getId), split);
}
queryWrapper.orderByAsc(RefUtil.fieldNameUlc(PlanRecord::getPlannedStart));
queryWrapper.orderByAsc(RefUtil.fieldNameUlc(PlanRecord::getSort));
return queryWrapper;
}
@ -142,6 +142,12 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
if (planRecord.getPbsId() == null) {
throw new OpenAlertException("请先新增PBS数据");
}
if (planRecord.getPlannedStart() == null) {
throw new OpenAlertException("计划开始不能为空");
}
if (planRecord.getPlannedFinish() == null) {
throw new OpenAlertException("计划结束不能为空");
}
planRecord.setId(null);
boolean top = planRecord.getParentId() == null || planRecord.getParentId() == 0;
if (top) {
@ -172,6 +178,7 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
if (oldPlanRecord == null) {
throw new OpenAlertException("未找到计划编制数据");
}
planRecord.setWeight(NumberUtil.div(planRecord.getWeightRate(), new BigDecimal("100")));
if (DateUtil.compare(planRecord.getPlannedStart(), oldPlanRecord.getPlannedStart()) != 0 || DateUtil.compare(planRecord.getPlannedFinish(), oldPlanRecord.getPlannedFinish()) != 0) {
int count = planFeedbackService.count(new LambdaQueryWrapper<PlanFeedback>()
.eq(PlanFeedback::getRecordId, planRecord.getId()));

View File

@ -154,6 +154,9 @@ public class PouringOrderLedgerServiceImpl extends ServiceImpl<PouringOrderLedge
e.setConstructionContractor(FlowUtil.getPullDownLong(map, "constructionContractor"));
e.setActualPouringVolume(Convert.toBigDecimal(map.get("actualPouringVolume")));
e.setRemark(FlowUtil.getString(map, "remark"));
e.setEpcProfessionalEngineerDate(FlowUtil.getDate(map, "epcProfessionalEngineerDate"));
e.setSupervisionProfessionalEngineerDate(FlowUtil.getDate(map, "supervisionProfessionalEngineerDate"));
e.setProjectTeamProfessionalEngineerDate(FlowUtil.getDate(map, "projectTeamProfessionalEngineerDate"));
baseMapper.insert(e);
}
@ -175,11 +178,11 @@ public class PouringOrderLedgerServiceImpl extends ServiceImpl<PouringOrderLedge
&& StrUtil.isBlank(constructionContractor)
&& StrUtil.isBlank(supplyStation);
StringBuilder groupby = new StringBuilder();
addCondition(device, groupby);
addCondition(projectGroupId, groupby);
addCondition(epcContractor, groupby);
addCondition(constructionContractor, groupby);
addCondition(supplyStation, groupby);
addCondition(device, groupby, "device");
addCondition(projectGroupId, groupby, "project_group_id");
addCondition(epcContractor, groupby, "epc_contractor");
addCondition(constructionContractor, groupby, "construction_contractor");
addCondition(supplyStation, groupby, "supply_station");
param.put("groupby", "group by " + (StrUtil.isNotBlank(groupby.toString()) ? groupby.toString() : "1=1"));
List<EntityMap> periodMilestones = baseMapper.getCountSupplyStationDetail(param);
int pageNo = Integer.parseInt(param.getOrDefault("pageNo", 1).toString());
@ -270,12 +273,12 @@ public class PouringOrderLedgerServiceImpl extends ServiceImpl<PouringOrderLedge
return rt;
}
private void addCondition(String device, StringBuilder groupby) {
private void addCondition(String device, StringBuilder groupby, String key) {
if (StrUtil.isNotBlank(device)) {
if (groupby != null) {
if (!groupby.toString().equals("")) {
groupby.append(",");
}
groupby.append("t.").append(device);
groupby.append("t.").append(key);
}
}

View File

@ -32,6 +32,8 @@
ei.enterprise_name,
p.project_name,
t.car_qr_code
,
t.special_work_type
FROM car_info t
join project p on p.project_sn = t.project_sn
LEFT JOIN car_type b ON (t.car_type = b.id and t.project_sn = b.project_sn)

View File

@ -72,5 +72,6 @@ public class ProjectConfig implements Serializable {
private String k2;
@ApiModelProperty(value = "拓展val2")
private String v2;
@ApiModelProperty(value = "安全人工时")
private java.lang.String safeWorkTime;
}

View File

@ -0,0 +1,54 @@
混凝土浇筑申请记录
工程名称: 编号:{{castingNumber}}
致: {{supervisorName}} (监理(建设)单位)
本工程一层 {{castingLocation}} 部位的钢筋、模板、水电安装和预埋件等报验通过。
土建工序质量报验单
安装工序质量报验单
混凝土浇灌施工方案报审表
浇筑的准备工作已就绪,申请于{{pouringBeginTime}}至{{pouringEndTime}}浇筑混凝土,请批准。
配合比
{{mixProportion}}
设计坍落度
{{designSlump}}
预计浇筑量
{{estimatedPouringVolume}}
施工值班负责人
{{constructionShiftSupervisorName}}
设计强度值
{{designStrength}}
施工缝预留位置
{{constructionJointReservePosition}}
人料机准备情况
{{manpowerMachineReadiness}}
供应站
{{supplyStation}}
已具备混凝土浇筑条件
施工员:{{}}{{constructionWorkerName}} {{}}日期:{{constructionDate}}
已具备混凝土浇筑条件
EPC承包商专业工程师:{{}}{{epcProfessionalEngineerName}} {{}}日期:{{epcProfessionalEngineerDate}}
监理(建设)单位审核意见:
同意浇筑
监理专业工程师:{{}}{{supervisionProfessionalEngineerName}} {{}}日期:{{supervisionProfessionalEngineerDate}}
项目组专业工程师: {{}}{{projectTeamProfessionalEngineerName}} {{}}日期:{{projectTeamProfessionalEngineerDate}}