包头bug修复

This commit is contained in:
guoshengxiong 2024-12-12 18:53:58 +08:00
parent 65b902d4ad
commit d4d6863b7d
19 changed files with 384 additions and 141 deletions

View File

@ -1,13 +1,11 @@
package com.zhgd.xmgl.modules.baotou.controller;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.baotou.service.IPouringOrderLedgerService;
import com.zhgd.xmgl.modules.baotou.entity.PouringOrderLedger;
import com.zhgd.xmgl.util.FlowUtil;
import com.zhgd.xmgl.modules.baotou.service.IPouringOrderLedgerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -19,7 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -42,8 +42,8 @@ public class PouringOrderLedgerController {
*
* @return
*/
@OperLog(operModul = "浇筑令台账管理", operType = "分页查询", operDesc = "分页列表查询浇筑令台账信息")
@ApiOperation(value = "分页列表查询浇筑令台账信息", notes = "分页列表查询浇筑令台账信息", httpMethod = "GET")
@OperLog(operModul = "混凝土浇筑申请记录管理", operType = "分页查询", operDesc = "分页列表查询混凝土浇筑申请记录")
@ApiOperation(value = "分页列表查询混凝土浇筑申请记录", notes = "分页列表查询混凝土浇筑申请记录", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
@ -58,8 +58,8 @@ public class PouringOrderLedgerController {
*
* @return
*/
@OperLog(operModul = "浇筑令台账管理", operType = "列表查询", operDesc = "列表查询浇筑令台账信息")
@ApiOperation(value = "列表查询浇筑令台账信息", notes = "列表查询浇筑令台账信息", httpMethod = "GET")
@OperLog(operModul = "混凝土浇筑申请记录管理", operType = "列表查询", operDesc = "列表查询混凝土浇筑申请记录")
@ApiOperation(value = "列表查询混凝土浇筑申请记录", notes = "列表查询混凝土浇筑申请记录", httpMethod = "GET")
@GetMapping(value = "/list")
public Result<List<PouringOrderLedger>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(pouringOrderLedgerService.queryList(param));
@ -71,39 +71,14 @@ public class PouringOrderLedgerController {
* @param pouringOrderLedger
* @return
*/
@OperLog(operModul = "浇筑令台账管理", operType = "添加", operDesc = "添加浇筑令台账信息")
@ApiOperation(value = "添加浇筑令台账信息", notes = "添加浇筑令台账信息", httpMethod = "POST")
@OperLog(operModul = "混凝土浇筑申请记录管理", operType = "添加", operDesc = "添加混凝土浇筑申请记录")
@ApiOperation(value = "添加混凝土浇筑申请记录", notes = "添加混凝土浇筑申请记录", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<PouringOrderLedger> add(@RequestBody @Validate PouringOrderLedger pouringOrderLedger) {
pouringOrderLedgerService.add(pouringOrderLedger);
return Result.ok();
}
@OperLog(operModul = "浇筑令台账管理", operType = "添加", operDesc = "工作流添加浇筑令台账信息")
@ApiOperation(value = "工作流添加浇筑令台账信息", notes = "工作流添加浇筑令台账信息", httpMethod = "POST")
@PostMapping(value = "/flow/add")
public Result<PouringOrderLedger> addFromFlow(@RequestBody @Validate Map<String, Object> map) {
log.info("工作流添加浇筑令台账信息:{}", JSON.toJSONString(map));
PouringOrderLedger ledger = new PouringOrderLedger();
String concreteNumber = MapUtils.getString(map, "concreteNumber");
Long device = FlowUtil.getPullDownLong(map, "device");
String castingLocation = MapUtils.getString(map, "castingLocation");
String plannedVolume = MapUtils.getString(map, "plannedVolume");
String projectSn = MapUtils.getString(map, "projectSn");
Long concreteSupplier = Optional.ofNullable(map.get("concreteSupplier")).map(o -> Convert.toLong(((List) o).get(0))).orElse(null);
Long projectGroupId = Optional.ofNullable(map.get("projectGroupId")).map(o -> Convert.toLong(((List) o).get(0))).orElse(null);
Long epcPcContractor = Optional.ofNullable(map.get("epcPcContractor")).map(o -> Convert.toLong(((List) o).get(0))).orElse(null);
ledger.setConcreteNumber(concreteNumber);
ledger.setDevice(device);
ledger.setCastingLocation(castingLocation);
ledger.setConcreteSupplier(concreteSupplier);
ledger.setProjectGroupId(projectGroupId);
ledger.setEpcPcContractor(epcPcContractor);
ledger.setPlannedVolume(plannedVolume);
ledger.setProjectSn(projectSn);
pouringOrderLedgerService.add(ledger);
return Result.ok();
}
/**
* 编辑
@ -111,8 +86,8 @@ public class PouringOrderLedgerController {
* @param pouringOrderLedger
* @return
*/
@OperLog(operModul = "浇筑令台账管理", operType = "编辑", operDesc = "编辑浇筑令台账信息")
@ApiOperation(value = "编辑浇筑令台账信息", notes = "编辑浇筑令台账信息", httpMethod = "POST")
@OperLog(operModul = "混凝土浇筑申请记录管理", operType = "编辑", operDesc = "编辑混凝土浇筑申请记录")
@ApiOperation(value = "编辑混凝土浇筑申请记录", notes = "编辑混凝土浇筑申请记录", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<PouringOrderLedger> edit(@RequestBody PouringOrderLedger pouringOrderLedger) {
pouringOrderLedgerService.edit(pouringOrderLedger);
@ -124,8 +99,8 @@ public class PouringOrderLedgerController {
*
* @return
*/
@OperLog(operModul = "浇筑令台账管理", operType = "删除", operDesc = "删除浇筑令台账信息")
@ApiOperation(value = "删除浇筑令台账信息", notes = "删除浇筑令台账信息", httpMethod = "POST")
@OperLog(operModul = "混凝土浇筑申请记录管理", operType = "删除", operDesc = "删除混凝土浇筑申请记录")
@ApiOperation(value = "删除混凝土浇筑申请记录", notes = "删除混凝土浇筑申请记录", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "浇筑令台账ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
@PostMapping(value = "/delete")
public Result<PouringOrderLedger> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
@ -139,12 +114,46 @@ public class PouringOrderLedgerController {
* @param id
* @return
*/
@OperLog(operModul = "浇筑令台账管理", operType = "通过id查询", operDesc = "通过id查询浇筑令台账信息")
@ApiOperation(value = "通过id查询浇筑令台账信息", notes = "通过id查询浇筑令台账信息", httpMethod = "GET")
@OperLog(operModul = "混凝土浇筑申请记录管理", operType = "通过id查询", operDesc = "通过id查询混凝土浇筑申请记录")
@ApiOperation(value = "通过id查询混凝土浇筑申请记录", notes = "通过id查询混凝土浇筑申请记录", httpMethod = "GET")
@ApiImplicitParam(name = "id", value = "浇筑令台账ID", paramType = "query", required = true, dataType = "Integer")
@GetMapping(value = "/queryById")
public Result<PouringOrderLedger> queryById(@RequestParam(name = "id", required = true) String id) {
return Result.success(pouringOrderLedgerService.queryById(id));
}
@OperLog(operModul = "混凝土浇筑申请记录管理", operType = "添加", operDesc = "工作流添加混凝土浇筑申请记录")
@ApiOperation(value = "工作流添加混凝土浇筑申请记录", notes = "工作流添加混凝土浇筑申请记录", httpMethod = "POST")
@PostMapping(value = "/flow/add")
public Result<PouringOrderLedger> addFromFlow(@RequestBody @Validate Map<String, Object> map) {
log.info("工作流添加混凝土浇筑申请记录:{}", JSON.toJSONString(map));
pouringOrderLedgerService.addFromFlow(map);
return Result.ok();
}
@OperLog(operModul = "混凝土浇筑申请记录管理", operType = "", operDesc = "统计供应站")
@ApiOperation(value = "统计供应站", notes = "统计供应站", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String"),
})
@GetMapping(value = "/countSupplyStation")
public Result<List<String>> countSupplyStation(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(pouringOrderLedgerService.countSupplyStation(param));
}
@OperLog(operModul = "混凝土浇筑申请记录管理", operType = "", operDesc = "查询统计供应站详情")
@ApiOperation(value = "查询统计供应站详情", notes = "查询统计供应站详情", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "levelType", value = "时间级别1月2年", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "month", value = "", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "year", value = "", paramType = "query", required = false, dataType = "String"),
})
@GetMapping(value = "/getCountSupplyStationDetails")
public Result<Map<String,Object>> getCountSupplyStationDetails(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(pouringOrderLedgerService.getCountSupplyStationDetails(param));
}
}

View File

@ -22,83 +22,99 @@ import io.swagger.annotations.ApiModelProperty;
@TableName("pouring_order_ledger")
@ApiModel(value="PouringOrderLedger实体类",description="PouringOrderLedger")
public class PouringOrderLedger implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="id")
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="id")
private java.lang.Long id ;
/**浇筑合编号*/
@Excel(name = "浇筑合编号", width = 15)
@ApiModelProperty(value="浇筑合编号")
/**编号*/
@ApiModelProperty(value="编号")
private java.lang.String castingNumber ;
/**
* 混泥土编号
*/
@Excel(name = "混泥土编号", width = 15)
@ApiModelProperty(value = "混泥土编号")
private java.lang.String concreteNumber;
/**
* 装置
*/
@Excel(name = "装置", width = 15)
@ApiModelProperty(value = "装置")
private java.lang.Long device;
/**
* 浇筑部位
*/
@Excel(name = "浇筑部位", width = 15)
@ApiModelProperty(value = "浇筑部位")
private java.lang.String castingLocation;
/**混凝土供应商*/
@Excel(name = "混凝土供应商", width = 15)
@ApiModelProperty(value="混凝土供应商")
private java.lang.Long concreteSupplier ;
/**装置*/
@ApiModelProperty(value="装置")
private java.lang.Long device ;
/**项目组id*/
@Excel(name = "项目组id", width = 15)
@ApiModelProperty(value="项目组id")
@ApiModelProperty(value="项目组id")
private java.lang.Long projectGroupId ;
/**监理单位id*/
@ApiModelProperty(value="监理单位id")
private java.lang.Long supervisor ;
/**EPC/PC承包商*/
@Excel(name = "EPC/PC承包商", width = 15)
@ApiModelProperty(value="EPC/PC承包商")
@ApiModelProperty(value="EPC/PC承包商")
private java.lang.Long epcPcContractor ;
/**计划方量*/
@Excel(name = "计划方量", width = 15)
@ApiModelProperty(value="计划方量")
private java.lang.String plannedVolume ;
/**浇筑部位*/
@ApiModelProperty(value="浇筑部位")
private java.lang.String castingLocation ;
/**浇筑开始时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="浇筑开始时间")
private java.util.Date pouringBeginTime ;
/**浇筑结束时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="浇筑结束时间")
private java.util.Date pouringEndTime ;
/**明细表*/
@ApiModelProperty(value="明细表")
private java.lang.String detail ;
/**施工员*/
@ApiModelProperty(value="施工员")
private java.lang.Long constructionWorker ;
/**施工员日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value="施工员日期")
private java.util.Date constructionDate ;
/**项目sn*/
@Excel(name = "项目sn", width = 15)
@ApiModelProperty(value="项目sn")
@ApiModelProperty(value="项目sn")
private java.lang.String projectSn ;
/**创建时间 yyyy-MM-dd HH:mm:ss*/
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="创建时间 yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime ;
/**更新时间 yyyy-MM-dd HH:mm:ss*/
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="更新时间 yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime ;
/**浇筑开始时间 yyyy-MM-dd HH:mm:ss*/
@Excel(name = "浇筑开始时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="浇筑开始时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date pouringBeginTime ;
/**浇筑结束时间 yyyy-MM-dd HH:mm:ss*/
@Excel(name = "浇筑结束时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="浇筑结束时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date pouringEndTime ;
/**状态1未浇筑;2已浇筑;*/
@Excel(name = "状态1未浇筑;2已浇筑;", width = 15)
@ApiModelProperty(value="状态1未浇筑;2已浇筑;")
private java.lang.Integer status;
private java.lang.Integer status ;
/**配合比*/
@ApiModelProperty(value="配合比")
private java.lang.String mixProportion ;
/**设计坍落度*/
@ApiModelProperty(value="设计坍落度")
private java.lang.String designSlump ;
/**预计浇筑量*/
@ApiModelProperty(value="预计浇筑量")
private java.math.BigDecimal estimatedPouringVolume ;
/**施工值班负责人*/
@ApiModelProperty(value="施工值班负责人")
private java.lang.Long constructionShiftSupervisor ;
/**设计强度值*/
@ApiModelProperty(value="设计强度值")
private java.lang.String designStrength ;
/**施工缝预留位置*/
@ApiModelProperty(value="施工缝预留位置")
private java.lang.String constructionJointReservePosition ;
/**人料机准备情况*/
@ApiModelProperty(value="人料机准备情况")
private java.lang.String manpowerMachineReadiness ;
/**供应站*/
@ApiModelProperty(value="供应站")
private java.lang.String supplyStation ;
/**专业监理工程师*/
@ApiModelProperty(value="专业监理工程师")
private java.lang.Long professionalSupervisionEngineer ;
/**专业监理工程师日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value="专业监理工程师日期")
private java.util.Date professionalSupervisionEngineerDate ;
@TableField(exist = false)
@ApiModelProperty(value = "项目组名称")
@ -109,8 +125,19 @@ public class PouringOrderLedger implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value = "EPC/PC承包商名称")
private java.lang.String epcPcContractorName;
@TableField(exist = false)
@ApiModelProperty(value = "装置名称")
private java.lang.String deviceName;
@TableField(exist = false)
@ApiModelProperty(value="监理单位名称")
private java.lang.String supervisorName ;
@TableField(exist = false)
@ApiModelProperty(value="施工员名称")
private java.lang.String constructionWorkerName ;
@TableField(exist = false)
@ApiModelProperty(value="施工值班负责人名称")
private java.lang.String constructionShiftSupervisorName ;
@TableField(exist = false)
@ApiModelProperty(value="专业监理工程师名称")
private java.lang.String professionalSupervisionEngineerName ;
}

View File

@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -29,4 +30,8 @@ public interface PouringOrderLedgerMapper extends BaseMapper<PouringOrderLedger>
PouringOrderLedger getById(String id);
List<TrendOneVo> countPouringEnterprise(Map<String, Object> map);
List<String> countSupplyStation(HashMap<String, Object> param);
List<Map<String, String>> getCountSupplyStationDetail(HashMap<String, Object> param);
}

View File

@ -1,18 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.baotou.mapper.PouringOrderLedgerMapper">
<select id="queryList" resultType="com.zhgd.xmgl.modules.baotou.entity.PouringOrderLedger">
select * from(select t.*,
pg.project_group_name,
ei1.enterprise_name as concrete_supplier_name,
ei2.enterprise_name as epc_pc_contractor_name,
du.device_unit_name as device_name
ei2.enterprise_name as epc_pc_contractor_name
,ei3.enterprise_name as supervisor_name
,du.device_unit_name as device_name
,wi.worker_name as construction_shift_supervisor_name
,su1.real_name as construction_worker_name
,su2.real_name as professional_supervision_engineer_name
from pouring_order_ledger t
left join project_group pg on t.project_group_id = pg.id
left join enterprise_info ei1 on ei1.id = t.concrete_supplier
left join enterprise_info ei2 on ei2.id = t.epc_pc_contractor
left join enterprise_info ei3 on ei3.id = t.supervisor
left join device_unit du on du.id=t.device
left join worker_info wi on wi.id = t.construction_shift_supervisor
left join system_user su1 on su1.user_id=t.construction_worker
left join system_user su2 on su2.user_id=t.professional_supervision_engineer
) t
${ew.customSqlSegment}
</select>
@ -20,14 +25,20 @@
<select id="getById" resultType="com.zhgd.xmgl.modules.baotou.entity.PouringOrderLedger">
select * from(select t.*,
pg.project_group_name,
ei1.enterprise_name as concrete_supplier_name,
ei2.enterprise_name as epc_pc_contractor_name,
du.device_unit_name as device_name
ei2.enterprise_name as epc_pc_contractor_name
,ei3.enterprise_name as supervisor_name
,du.device_unit_name as device_name
,wi.worker_name as construction_shift_supervisor_name
,su1.real_name as construction_worker_name
,su2.real_name as professional_supervision_engineer_name
from pouring_order_ledger t
left join project_group pg on t.project_group_id = pg.id
left join enterprise_info ei1 on ei1.id = t.concrete_supplier
left join enterprise_info ei2 on ei2.id = t.epc_pc_contractor
left join enterprise_info ei3 on ei3.id = t.supervisor
left join device_unit du on du.id=t.device
left join worker_info wi on wi.id = t.construction_shift_supervisor
left join system_user su1 on su1.user_id=t.construction_worker
left join system_user su2 on su2.user_id=t.professional_supervision_engineer
) t
where id=#{id}
</select>
@ -42,4 +53,35 @@
where 1 = 1 and pol.project_sn = #{projectSn}
group by ei.id
</select>
<select id="countSupplyStation" resultType="java.lang.String">
select
supply_station
from
pouring_order_ledger pol
where 1 = 1 and pol.project_sn = #{projectSn}
group by pol.supply_station
</select>
<select id="getCountSupplyStationDetail" resultType="java.util.Map">
select
DATE_FORMAT(pol.pouring_begin_time, '%Y-%m') time
,pol.*
,ifnull(round(sum(estimated_pouring_volume),2),0) as sum
from
pouring_order_ledger pol
where 1 = 1 and pol.project_sn = #{projectSn}
<if test="month != null and month != ''">
and DATE_FORMAT(pol.pouring_begin_time, '%Y-%m') = #{month}
</if>
<if test="year != null and year != ''">
and DATE_FORMAT(pol.pouring_begin_time, '%Y') = #{year}
</if>
<if test="levelType == '1'.toString() ">
group by DATE_FORMAT(pol.pouring_begin_time, '%Y-%m-%d')
</if>
<if test="levelType == '2'.toString() ">
group by DATE_FORMAT(pol.pouring_begin_time, '%Y-%m')
</if>
</select>
</mapper>

View File

@ -147,4 +147,14 @@ public class PlanMilestoneController {
return Result.success(p);
}
@OperLog(operModul = "进度里程碑管理", operType = "分页查询", operDesc = "分页列表查询最近上级的wps进度里程碑信息")
@ApiOperation(value = "分页列表查询最近上级的wps进度里程碑信息", notes = "分页列表查询最近上级的wps进度里程碑信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})
@GetMapping(value = "/xxxx")
public Object dxxfsds(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return planMilestoneService.xxx(MapUtils.getLong(param, ""));
}
}

View File

@ -56,4 +56,7 @@ public interface IPlanMilestoneService extends IService<PlanMilestone> {
List<PlanMilestone> getParentMilestones(PlanRecord record, List<PlanMilestone> allPlanMilestones);
boolean checkHaveMilestone(Long recordId);
Object xxx(Long recordId);
}

View File

@ -66,7 +66,9 @@ public interface IPlanRecordService extends IService<PlanRecord> {
IPage<PlanRecord> queryTreePage(HashMap<String, Object> param);
List<PlanRecord> getWorkChildren(String recordId);
List<PlanRecord> getWorkChildren(Long recordId);
List<PlanRecord> getChildren(Long recordId);
List<PlanFeedbackPeriod> getPlanShares(Map<String, Object> param);

View File

@ -161,5 +161,19 @@ public class PlanMilestoneServiceImpl extends ServiceImpl<PlanMilestoneMapper, P
return planMilestones != null ? planMilestones : new ArrayList<>();
}
@Override
public boolean checkHaveMilestone(Long recordId) {
List<PlanRecord> records = planRecordService.getChildren(recordId);
List<Long> rids = records.stream().map(PlanRecord::getId).collect(Collectors.toList());
List<PlanMilestone> milestones = planMilestoneMapper.selectList(new LambdaQueryWrapper<PlanMilestone>()
.in(PlanMilestone::getRecordId, rids));
return CollUtil.isNotEmpty(milestones);
}
@Override
public Object xxx(Long recordId) {
return planRecordService.getChildren(recordId);
}
}

View File

@ -242,13 +242,18 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
}
@Override
public List<PlanRecord> getWorkChildren(String recordId) {
return baseMapper.getChildren(Long.valueOf(recordId)).stream().filter(o -> o.getWorkType() == 1).collect(Collectors.toList());
public List<PlanRecord> getWorkChildren(Long recordId) {
return baseMapper.getChildren(recordId).stream().filter(o -> o.getWorkType() == 1).collect(Collectors.toList());
}
@Override
public List<PlanRecord> getChildren(Long recordId) {
return baseMapper.getChildren(recordId);
}
@Override
public List<PlanFeedbackPeriod> getPlanShares(Map<String, Object> param) {
String recordId = MapUtils.getString(param, "recordId");
Long recordId = MapUtils.getLong(param, "recordId");
String beginDate = MapUtils.getString(param, "periodStart");
String endDate = MapUtils.getString(param, "periodEnd");
List<PlanFeedbackPeriod> feedbackPeriods = new ArrayList<>();
@ -264,7 +269,7 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
} else if (record.getWorkType() == 2) {
List<PlanRecord> planRecords = planRecordMapper.selectList(new LambdaQueryWrapper<PlanRecord>().eq(PlanRecord::getProjectSn, projectSn));
//判断是否最后一级wbs是的话需要显示里程碑
List<PlanRecord> children = baseMapper.getChildren(Long.valueOf(recordId));
List<PlanRecord> children = baseMapper.getChildren(recordId);
children.add(record);
List<PlanRecord> trees = BeanUtil.copyToList(ListUtils.listToTree(JSONArray.parseArray(JSON.toJSONString(children)), "id", "parentId", "children"), PlanRecord.class);
Map<Date, PlanFeedbackPeriod> map = this.getChildFeedbackPeriodMap(trees.get(0), planRecords, milestones, planPeriod);
@ -280,6 +285,15 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
feedbackPeriods = feedbackPeriods.stream().filter(o -> DateUtil.compare(DateUtil.parseDate(endDate), o.getPeriodStart()) >= 0).collect(Collectors.toList());
}
}
if (record.getWorkType() == 2) {
boolean have = planMilestoneService.checkHaveMilestone(recordId);
if (have) {
//去掉里程碑
for (PlanFeedbackPeriod period : feedbackPeriods) {
period.setMilestoneVals(new ArrayList<>());
}
}
}
return feedbackPeriods;
}
@ -346,14 +360,14 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
//计算百分比
for (Map.Entry<Date, PlanFeedbackPeriod> entry : startMap.entrySet()) {
PlanFeedbackPeriod period = entry.getValue();
if (BigDecimal.ZERO.compareTo(child.getWeight()) != 0) {
if (child.getWeight() != null && !NumberUtil.equals(BigDecimal.ZERO, child.getWeight())) {
period.setPlanPer(NumberUtil.mul(new BigDecimal("100"), NumberUtil.div(period.getPlanYdz(), child.getWeight(), 2)));
period.setActualPer(NumberUtil.mul(new BigDecimal("100"), NumberUtil.div(period.getActualYdz(), child.getWeight(), 2)));
}
}
for (Map.Entry<Date, PlanFeedbackPeriod> entry : startMap1.entrySet()) {
PlanFeedbackPeriod period = entry.getValue();
if (BigDecimal.ZERO.compareTo(child.getWeight()) != 0) {
if (child.getWeight() != null && !NumberUtil.equals(BigDecimal.ZERO, child.getWeight())) {
period.setPlanPer(NumberUtil.mul(new BigDecimal("100"), NumberUtil.div(period.getPlanYdz(), child.getWeight(), 2)));
period.setActualPer(NumberUtil.mul(new BigDecimal("100"), NumberUtil.div(period.getActualYdz(), child.getWeight(), 2)));
}
@ -541,7 +555,7 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
//计算百分比
for (Map.Entry<Date, PlanFeedbackPeriod> entry : startMap.entrySet()) {
PlanFeedbackPeriod period = entry.getValue();
if (BigDecimal.ZERO.compareTo(child.getWeight()) != 0) {
if (child.getWeight() != null && BigDecimal.ZERO.compareTo(child.getWeight()) != 0) {
period.setPlanPer(NumberUtil.mul(new BigDecimal("100"), NumberUtil.div(period.getPlanYdz(), child.getWeight(), 2)));
period.setActualPer(NumberUtil.mul(new BigDecimal("100"), NumberUtil.div(period.getActualYdz(), child.getWeight(), 2)));
}

View File

@ -55,4 +55,10 @@ public interface IPouringOrderLedgerService extends IService<PouringOrderLedger>
String getNextCastingNumber(String projectSn);
List<TrendOneVo> countPouringEnterprise(Map<String, Object> map);
void addFromFlow(Map<String, Object> map);
List<String> countSupplyStation(HashMap<String, Object> param);
Map<String,Object> getCountSupplyStationDetails(HashMap<String, Object> param);
}

View File

@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.baotou.service;
import com.zhgd.xmgl.modules.baotou.entity.UserModule;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.List;
@ -52,4 +53,6 @@ public interface IUserModuleService extends IService<UserModule> {
UserModule queryById(String id);
void saveUserModules(List<Long> moduleIdList, int type);
void saveAppUserModules(List<JSONObject> modules);
}

View File

@ -1,5 +1,9 @@
package com.zhgd.xmgl.modules.baotou.service.impl;
import java.math.BigDecimal;
import java.util.Date;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -11,7 +15,9 @@ import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
import com.zhgd.xmgl.modules.baotou.entity.PouringOrderLedger;
import com.zhgd.xmgl.modules.baotou.mapper.PouringOrderLedgerMapper;
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanFeedbackPeriod;
import com.zhgd.xmgl.modules.baotou.service.IPouringOrderLedgerService;
import com.zhgd.xmgl.util.FlowUtil;
import com.zhgd.xmgl.util.PageUtil;
import com.zhgd.xmgl.util.RefUtil;
import org.apache.commons.lang3.StringUtils;
@ -111,4 +117,58 @@ public class PouringOrderLedgerServiceImpl extends ServiceImpl<PouringOrderLedge
return baseMapper.countPouringEnterprise(map);
}
@Override
public void addFromFlow(Map<String, Object> map) {
PouringOrderLedger e = new PouringOrderLedger();
e.setCastingNumber(FlowUtil.getString(map,"castingNumber"));
e.setDevice(FlowUtil.getPullDownLong(map,"device"));
e.setProjectGroupId(FlowUtil.getPullDownLong(map,"projectGroupId"));
e.setSupervisor(FlowUtil.getPullDownLong(map,"supervisor"));
e.setEpcPcContractor(FlowUtil.getPullDownLong(map,"epcPcContractor"));
e.setCastingLocation(FlowUtil.getString(map,"castingLocation"));
e.setPouringBeginTime(FlowUtil.getStartDate(map,"pouringPeriod"));
e.setPouringEndTime(FlowUtil.getEndDate(map,"pouringPeriod"));
e.setDetail(FlowUtil.getJSONString(map,"detail"));
e.setConstructionWorker(FlowUtil.getPullDownLong(map,"constructionWorker"));
e.setConstructionDate(FlowUtil.getDate(map,"constructionDate"));
e.setProjectSn(FlowUtil.getString(map,"projectSn"));
e.setStatus(FlowUtil.getPullDownInteger(map,"status"));
e.setMixProportion(FlowUtil.getString(map,"mixProportion"));
e.setDesignSlump(FlowUtil.getString(map,"designSlump"));
e.setEstimatedPouringVolume(Convert.toBigDecimal(map.get("estimatedPouringVolume")));
e.setConstructionShiftSupervisor(FlowUtil.getPullDownLong(map,"constructionShiftSupervisor"));
e.setDesignStrength(FlowUtil.getString(map,"designStrength"));
e.setConstructionJointReservePosition(FlowUtil.getString(map,"constructionJointReservePosition"));
e.setManpowerMachineReadiness(FlowUtil.getString(map,"manpowerMachineReadiness"));
e.setSupplyStation(FlowUtil.getString(map,"supplyStation"));
e.setProfessionalSupervisionEngineer(FlowUtil.getPullDownLong(map,"professionalSupervisionEngineer"));
e.setProfessionalSupervisionEngineerDate(FlowUtil.getDate(map,"professionalSupervisionEngineerDate"));
baseMapper.insert(e);
}
@Override
public List<String> countSupplyStation(HashMap<String, Object> param) {
return baseMapper.countSupplyStation(param);
}
@Override
public Map<String, Object> getCountSupplyStationDetails(HashMap<String, Object> param) {
List<Map<String, String>> periodMilestones = baseMapper.getCountSupplyStationDetail(param);
int pageNo = Integer.parseInt(param.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(param.getOrDefault("pageSize", 10).toString());
if (pageSize < 0) {
pageSize = Integer.MAX_VALUE;
}
int i = cn.hutool.core.util.PageUtil.getStart(pageNo - 1, pageSize);
List<Map<String, String>> records = CollUtil.sub(periodMilestones, i, i + pageSize);
IPage<Map<String, String>> p = new Page<>();
p.setTotal(periodMilestones.size());
p.setRecords(records);
p.setCurrent(pageNo);
p.setSize(pageSize);
Map<String, Object> rt = new HashMap<>();
rt.put("page", p);
return rt;
}
}

View File

@ -1,39 +1,43 @@
package com.zhgd.xmgl.modules.baotou.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.redis.lock.redisson.DistributedLock;
import com.zhgd.xmgl.modules.baotou.entity.UserModule;
import com.zhgd.xmgl.modules.baotou.mapper.UserModuleMapper;
import com.zhgd.xmgl.modules.baotou.service.IUserModuleService;
import com.zhgd.xmgl.security.util.SecurityUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.util.PageUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.xmgl.util.RefUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import com.zhgd.xmgl.util.RefUtil;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Objects;
/**
* @Description: 账号常用模块
* @author pds
* @date 2024-10-18
* @date 2024-10-18
* @version V1.0
*/
@Service
public class UserModuleServiceImpl extends ServiceImpl<UserModuleMapper, UserModule> implements IUserModuleService {
@Autowired
private UserModuleMapper userModuleMapper;
@Override
public IPage<UserModule> queryPageList(HashMap<String, Object> param) {
QueryWrapper<UserModule> queryWrapper = this.getQueryWrapper(param);
Page<UserModule> page = PageUtil.getPage(param);
IPage<UserModule> pageList = baseMapper.queryList(page, queryWrapper,param);
IPage<UserModule> pageList = baseMapper.queryList(page, queryWrapper, param);
pageList.setRecords(this.dealList(pageList.getRecords()));
return pageList;
}
@ -41,7 +45,7 @@ public class UserModuleServiceImpl extends ServiceImpl<UserModuleMapper, UserMod
@Override
public List<UserModule> queryList(HashMap<String, Object> param) {
QueryWrapper<UserModule> queryWrapper = getQueryWrapper(param);
return dealList(baseMapper.queryList(queryWrapper,param));
return dealList(baseMapper.queryList(queryWrapper, param));
}
private QueryWrapper<UserModule> getQueryWrapper(HashMap<String, Object> param) {
@ -63,7 +67,7 @@ public class UserModuleServiceImpl extends ServiceImpl<UserModuleMapper, UserMod
@Override
public void edit(UserModule userModule) {
UserModule oldUserModule = baseMapper.selectById(userModule.getId());
if(oldUserModule==null) {
if (oldUserModule == null) {
throw new OpenAlertException("未找到对应实体");
}
baseMapper.updateById(userModule);
@ -72,7 +76,7 @@ public class UserModuleServiceImpl extends ServiceImpl<UserModuleMapper, UserMod
@Override
public void delete(String id) {
UserModule userModule = baseMapper.selectById(id);
if(userModule==null) {
if (userModule == null) {
throw new OpenAlertException("未找到对应实体");
}
baseMapper.deleteById(id);
@ -90,7 +94,21 @@ public class UserModuleServiceImpl extends ServiceImpl<UserModuleMapper, UserMod
@Override
public void saveUserModules(List<Long> moduleIdList, int type) {
Long userId = SecurityUtils.getUser().getUserId();
this.doSaveUserModules(moduleIdList, userId,type);
this.doSaveUserModules(moduleIdList, userId, type);
}
@Override
public void saveAppUserModules(List<JSONObject> modules) {
Long userId = SecurityUtils.getUser().getUserId();
userModuleMapper.delete(new LambdaQueryWrapper<UserModule>()
.eq(UserModule::getUserId, userId));
for (JSONObject l : modules) {
UserModule userModule = new UserModule();
userModule.setUserId(userId);
userModule.setModuleId(Objects.equals(l.getInt("isMenu"), 1) ? l.getLong("menuId") : l.getLong("moduleId"));
userModule.setType(2);
baseMapper.insert(userModule);
}
}
@DistributedLock(keyPrefix = "doSaveUserModules:", key = "#userId", tryLok = true, lockTime = 0)

View File

@ -19,6 +19,7 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
@ -245,9 +246,8 @@ public class BaseModuleController {
@ApiOperation(value = "列表查询账号常用模块信息app使用", notes = "列表查询账号常用模块信息app使用", httpMethod = "GET")
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = false, dataType = "String")
@GetMapping(value = "/queryAppUserModuleList")
public Result<List<BaseModule>> queryUserModuleList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
param.put("type", 2);
return Result.success(baseModuleService.queryUserModuleList(param));
public Result<List<BaseModule>> queryAppUserModuleList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(baseModuleService.queryAppUserModuleList(param));
}
@ApiOperation(value = "列查询所有的模块列表app使用", notes = "列查询所有的模块列表app使用", httpMethod = "POST")
@ -263,8 +263,8 @@ public class BaseModuleController {
@ApiOperation(value = "保存账号常用模块信息app使用", notes = "保存账号常用模块信息app使用", httpMethod = "POST")
@PostMapping(value = "/saveAppUserModules")
public Result saveUserModules(@RequestBody @ApiIgnore List<Long> moduleIdList) {
userModuleService.saveUserModules(moduleIdList,2);
public Result saveAppUserModules(@RequestBody @ApiIgnore List<JSONObject> modules) {
userModuleService.saveAppUserModules(modules);
return Result.ok();
}
}

View File

@ -99,4 +99,8 @@ public class BaseModule implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value = "模块所属菜单")
private List<EntityMap> menuList;
@TableField(exist = false)
private java.lang.Long menuId ;
@TableField(exist = false)
private java.lang.Integer isMenu ;
}

View File

@ -1,9 +1,9 @@
package com.zhgd.xmgl.modules.basicdata.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.xmgl.modules.basicdata.entity.dto.ModuleListPageDto;
import com.zhgd.xmgl.modules.basicdata.entity.BaseModule;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.basicdata.entity.BaseModule;
import com.zhgd.xmgl.modules.basicdata.entity.dto.ModuleListPageDto;
import java.util.HashMap;
import java.util.List;
@ -12,12 +12,13 @@ import java.util.Map;
/**
* @Description: 模块
* @author pds
* @date 2020-10-12
* @date 2020-10-12
* @version V1.0
*/
public interface IBaseModuleService extends IService<BaseModule> {
/**
* 查询总企业默认的模块列表
*
* @param map
* @return
*/
@ -25,12 +26,14 @@ public interface IBaseModuleService extends IService<BaseModule> {
/**
* 查询企业下项目默认的模块列表
*
* @param map
* @return
*/
List<BaseModule> getProjectModuleList(Map<String, Object> map);
/**查询企业用户配置的模块列表
/**
* 查询企业用户配置的模块列表
*
* @param map
* @return
@ -39,6 +42,7 @@ public interface IBaseModuleService extends IService<BaseModule> {
/**
* 列表查询所有模块信息
*
* @param map
* @return
*/
@ -46,6 +50,7 @@ public interface IBaseModuleService extends IService<BaseModule> {
/**
* 分页列表查询所有模块信息
*
* @param dto
* @return
*/
@ -54,6 +59,7 @@ public interface IBaseModuleService extends IService<BaseModule> {
/**
* 查询项目配置的模块和菜单列表
*
* @param paramMap
* @return
*/
@ -61,5 +67,7 @@ public interface IBaseModuleService extends IService<BaseModule> {
List<BaseModule> queryUserModuleList(HashMap<String, Object> param);
List<BaseModule> queryAppUserModuleList(HashMap<String, Object> param);
Map<String, Object> getModuleAndMenuListForApp(HashMap<String, Object> paramMap);
}

View File

@ -21,6 +21,7 @@ import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
@ -73,6 +74,7 @@ public class BaseMenuServiceImpl extends ServiceImpl<BaseMenuMapper, BaseMenu> i
}
@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public void fixAuthDistribute() {
List<BaseMenu> baseMenus = baseMenuMapper.selectList(null);
for (BaseMenu baseMenu : baseMenus) {

View File

@ -150,6 +150,20 @@ public class BaseModuleServiceImpl extends ServiceImpl<BaseModuleMapper, BaseMod
return moduleList.stream().filter(o->userModuleMap.containsKey(o.getModuleId())).collect(Collectors.toList());
}
@Override
public List<BaseModule> queryAppUserModuleList(HashMap<String, Object> param) {
param.put("userId", SecurityUtils.getUser().getUserId());
param.put("moduleType", 2);
Map<String, Object> map = baseModuleService.getModuleAndMenuList(param);
List<BaseModule> moduleList = (List<BaseModule>) map.get("moduleList");
if (CollUtil.isEmpty(moduleList)) {
return new ArrayList<>();
}
param.put("type", 2);
Map<Long, BaseModule> userModuleMap = baseModuleMapper.queryUserModuleList(param).stream().collect(Collectors.toMap(BaseModule::getModuleId, Function.identity()));
return moduleList.stream().filter(o->userModuleMap.containsKey(o.getModuleId())).collect(Collectors.toList());
}
@Override
public Map<String, Object> getModuleAndMenuListForApp(HashMap<String, Object> paramMap) {
paramMap.put("projectSn", defaultProjectSn);

View File

@ -1163,6 +1163,8 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
private BaseModule mapModules(EntityMap menu) {
BaseModule baseModule = new BaseModule();
baseModule.setModuleId(IdUtil.getSnowflake().nextId());
baseModule.setMenuId(MapUtils.getLong(menu, "menuId"));
baseModule.setIsMenu(1);
baseModule.setLabelName(MapUtils.getString(menu, "labelName"));
baseModule.setLabelSortNum(MapUtils.getString(menu, "labelSortNum"));
baseModule.setModuleName(MapUtils.getString(menu, "menuName"));