Commit 7a09d36d authored by renchao's avatar renchao

生产工序业务修改

parent d1943580
...@@ -65,17 +65,17 @@ public class TProcessesBlastdesignHoleController { ...@@ -65,17 +65,17 @@ public class TProcessesBlastdesignHoleController {
} }
/** // /**
* 根据uid删除炮孔设计 // * 根据uid删除炮孔设计
* // *
* @param tProcessesBlastdesignHoleQuery // * @param tProcessesBlastdesignHoleQuery
* @return // * @return
*/ // */
@ApiOperation(value = "根据uid删除炮孔设计") // @ApiOperation(value = "根据uid删除炮孔设计")
@RequestMapping(value = "/deleteByUid", method = RequestMethod.POST) // @RequestMapping(value = "/deleteByUid", method = RequestMethod.POST)
public R deleteByUid(@RequestBody TProcessesBlastdesignHoleQuery tProcessesBlastdesignHoleQuery) { // public R deleteByUid(@RequestBody TProcessesBlastdesignHoleQuery tProcessesBlastdesignHoleQuery) {
return itProcessesBlastdesignHoleService.deleteByUid(tProcessesBlastdesignHoleQuery); // return itProcessesBlastdesignHoleService.deleteByUid(tProcessesBlastdesignHoleQuery);
} // }
/** /**
......
...@@ -3,16 +3,20 @@ package cn.wise.sc.acquisition.business.entity; ...@@ -3,16 +3,20 @@ package cn.wise.sc.acquisition.business.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
/** /**
* <p> * <p>
* *
* </p> * </p>
* *
* @author renchao * @author renchao
...@@ -24,38 +28,14 @@ import lombok.experimental.Accessors; ...@@ -24,38 +28,14 @@ import lombok.experimental.Accessors;
@TableName("T_Processes_Blast") @TableName("T_Processes_Blast")
public class TProcessesBlast implements Serializable { public class TProcessesBlast implements Serializable {
private static final long serialVersionUID=1L; private static final long serialVersionUID = 1L;
/** /**
* ID号 * ID号
*/ */
@TableId(value = "Uid", type = IdType.ASSIGN_UUID) @TableId("Uid")
private String Uid; private String Uid;
/**
* 采区名称
*/
@TableField("StopeName")
private String StopeName;
/**
* 平台名称
*/
@TableField("StepName")
private String StepName;
/**
* 爆区名称
*/
@TableField("BlastAreaName")
private String BlastAreaName;
/**
* 炮孔编号
*/
@TableField("HoleID")
private String HoleID;
/** /**
* 爆破人员 * 爆破人员
...@@ -99,11 +79,6 @@ public class TProcessesBlast implements Serializable { ...@@ -99,11 +79,6 @@ public class TProcessesBlast implements Serializable {
@TableField("Tabulator") @TableField("Tabulator")
private String Tabulator; private String Tabulator;
/**
* 实测孔深(m)
*/
@TableField("Depth")
private Double Depth;
@TableField("Bz") @TableField("Bz")
private String Bz; private String Bz;
......
...@@ -33,38 +33,9 @@ public class TProcessesDrilling implements Serializable { ...@@ -33,38 +33,9 @@ public class TProcessesDrilling implements Serializable {
/** /**
* ID号 * ID号
*/ */
@TableId(value = "Uid", type = IdType.ASSIGN_UUID) @TableId("Uid")
private String Uid; private String Uid;
/**
* 采区名称
*/
@TableField("StopeName")
private String StopeName;
/**
* 平台名称
*/
@TableField("StepName")
private String StepName;
/**
* 爆区名称
*/
@TableField("BlastAreaName")
private String BlastAreaName;
/**
* 炮孔编号
*/
@TableField("HoleID")
private String HoleID;
/**
* 穿孔日期
*/
@TableField("DrillingDate")
private LocalDateTime DrillingDate;
/** /**
* 项目经理 * 项目经理
......
...@@ -6,11 +6,8 @@ ...@@ -6,11 +6,8 @@
<!-- 表和实体字段对照关系, 类似RestultMap --> <!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TProcessesBlastColumns"> <sql id="TProcessesBlastColumns">
a.Uid, a.Uid,
a.StopeName,
a.StepName,
a.BlastAreaName,
a.HoleID,
a.BlastDate,
a.BlastPeople, a.BlastPeople,
a.CheckHoleDate, a.CheckHoleDate,
a.CheckHolePeople, a.CheckHolePeople,
...@@ -23,30 +20,40 @@ ...@@ -23,30 +20,40 @@
</sql> </sql>
<sql id="TProcessesBlastdesignColumns"> <sql id="TProcessesBlastdesignColumns">
b.StopeName,
b.StepName,
b.BlastAreaName,
b.BlastHoleID AS HoleID,
b.HoleBlastVolume, b.HoleBlastVolume,
b.depth AS DesignDepth,<!-- 设计孔深,将爆破工序里的depth去掉,用设计炮孔里的替代 --> b.depth AS DesignDepth,<!-- 设计孔深,将爆破工序里的depth去掉,用设计炮孔里的替代 -->
</sql> </sql>
<sql id="TProcessesDrillingColumns"> <sql id="TProcessesDrillingColumns">
c.BlastDate,
c.Depth, c.Depth,
</sql> </sql>
<sql id="TProcessesBlastdesignHoleJoins"> <sql id="TProcessesDrillingJoins">
left join T_Processes_BlastDesign_Hole b on a.HoleID = b.BlastHoleID left join T_Processes_Drilling c on a.Uid = c.Uid
left join T_Processes_Drilling c on a.HoleID = c.HoleID </sql>
<sql id="TProcessesBlastDesignHoleJoins">
left join T_Processes_BlastDesign_Hole b on c.Uid = b.BlastHoleID
</sql> </sql>
<!-- 获取所有getPage列表 --> <!-- 获取所有getPage列表 -->
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo"> <select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo">
SELECT SELECT
a.Uid, a.Uid,
a.HoleID, b.BlastHoleID AS HoleID,
b.HoleBlastVolume, b.HoleBlastVolume,
b.depth AS DesignDepth, b.depth AS DesignDepth,
c.Depth c.Depth
FROM T_Processes_Blast a FROM T_Processes_Blast a
<include refid="TProcessesBlastdesignHoleJoins"/> <include refid="TProcessesDrillingJoins"/>
<include refid="TProcessesBlastDesignHoleJoins"/>
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
...@@ -60,7 +67,8 @@ ...@@ -60,7 +67,8 @@
<include refid="TProcessesDrillingColumns"/> <include refid="TProcessesDrillingColumns"/>
<include refid="TProcessesBlastColumns"/> <include refid="TProcessesBlastColumns"/>
FROM T_Processes_Blast a FROM T_Processes_Blast a
<include refid="TProcessesBlastdesignHoleJoins"/> <include refid="TProcessesDrillingJoins"/>
<include refid="TProcessesBlastDesignHoleJoins"/>
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
......
...@@ -28,13 +28,9 @@ ...@@ -28,13 +28,9 @@
b.DesignDate, b.DesignDate,
</sql> </sql>
<sql id="TProcessesDrillingColumns">
d.DrillingDate,
</sql>
<sql id="TProcessesBlastdesignHoleJoins"> <sql id="TProcessesBlastdesignHoleJoins">
left join T_Processes_BlastDesign_Volume b on a.StopeName=b.StopeName and a.StepName=b.StepName and a.BlastAreaName=b.BlastAreaName left join T_Processes_BlastDesign_Volume b on a.StopeName=b.StopeName and a.StepName=b.StepName and a.BlastAreaName=b.BlastAreaName
left join T_Processes_Drilling d on a.BlastHoleID = d.HoleID
</sql> </sql>
<!-- 获取所有getPage列表 --> <!-- 获取所有getPage列表 -->
...@@ -52,8 +48,7 @@ ...@@ -52,8 +48,7 @@
a.y, a.y,
a.z, a.z,
a.StepHeight, a.StepHeight,
b.BlastVolume, b.BlastVolume
d.DrillingDate
FROM T_Processes_BlastDesign_Hole a FROM T_Processes_BlastDesign_Hole a
<include refid="TProcessesBlastdesignHoleJoins"/> <include refid="TProcessesBlastdesignHoleJoins"/>
<where> <where>
......
...@@ -6,11 +6,6 @@ ...@@ -6,11 +6,6 @@
<!-- 表和实体字段对照关系, 类似RestultMap --> <!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TProcessesDrillingColumns"> <sql id="TProcessesDrillingColumns">
a.Uid, a.Uid,
a.StopeName,
a.StepName,
a.BlastAreaName,
a.HoleID,
a.DrillingDate,
a.Manager, a.Manager,
a.Supervisor, a.Supervisor,
a.TechDepart, a.TechDepart,
...@@ -37,7 +32,13 @@ ...@@ -37,7 +32,13 @@
a.Tag a.Tag
</sql> </sql>
<sql id="TProcessesDiggingHoleColumns"> <sql id="TProcessesBlastDesignHoleColumns">
b.StopeName,
b.StepName,
b.BlastAreaName,
b.BlastHoleID AS HoleId,
b.DrillingDate,
b.Depth AS DesignDepth, b.Depth AS DesignDepth,
b.RowSpace AS DesignRowSpace, b.RowSpace AS DesignRowSpace,
b.HoleSpace AS DesignHoleSpace, b.HoleSpace AS DesignHoleSpace,
...@@ -53,26 +54,30 @@ ...@@ -53,26 +54,30 @@
d.DesignDate, d.DesignDate,
</sql> </sql>
<sql id="TProcessesDrillingJoins"> <sql id="TProcessesBlastDesignHoleJoins">
left join T_Processes_BlastDesign_Hole b on a.HoleID = b.BlastHoleID left join T_Processes_BlastDesign_Hole b on a.Uid = b.Uid
left join T_Processes_BlastDesign_Volume d on a.StopeName=d.StopeName and a.StepName=d.StepName and a.BlastAreaName=d.BlastAreaName </sql>
<sql id="TProcessesBlastDesignVolumeJoins">
left join T_Processes_BlastDesign_Volume d on b.StopeName=d.StopeName and b.StepName=d.StepName and b.BlastAreaName=d.BlastAreaName
</sql> </sql>
<!-- 获取所有getPage列表 --> <!-- 获取所有getPage列表 -->
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo"> <select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo">
SELECT SELECT
a.Uid, a.Uid,
a.HoleID,
a.Depth, a.Depth,
a.RowSpace, a.RowSpace,
a.HoleSpace, a.HoleSpace,
a.HoleBlastVolume, a.HoleBlastVolume,
b.BlastHoleID AS HoleId,
b.Depth AS DesignDepth, b.Depth AS DesignDepth,
b.RowSpace AS DesignRowSpace, b.RowSpace AS DesignRowSpace,
b.HoleSpace AS DesignHoleSpace, b.HoleSpace AS DesignHoleSpace,
b.StepHeight b.StepHeight
FROM T_Processes_Drilling a FROM T_Processes_Drilling a
<include refid="TProcessesDrillingJoins"/> <include refid="TProcessesBlastDesignHoleJoins"/>
<include refid="TProcessesBlastDesignVolumeJoins"/>
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
...@@ -82,11 +87,12 @@ ...@@ -82,11 +87,12 @@
<!-- 获取所有getPage列表 --> <!-- 获取所有getPage列表 -->
<select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo"> <select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo">
SELECT SELECT
<include refid="TProcessesDiggingHoleColumns"/> <include refid="TProcessesBlastDesignHoleColumns"/>
<include refid="TProcessesBlastdesignVolumeColumns"/> <include refid="TProcessesBlastdesignVolumeColumns"/>
<include refid="TProcessesDrillingColumns"/> <include refid="TProcessesDrillingColumns"/>
FROM T_Processes_Drilling a FROM T_Processes_Drilling a
<include refid="TProcessesDrillingJoins"/> <include refid="TProcessesBlastDesignHoleJoins"/>
<include refid="TProcessesBlastDesignVolumeJoins"/>
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
...@@ -97,6 +103,7 @@ ...@@ -97,6 +103,7 @@
SELECT SELECT
sum(${condition}) sum(${condition})
FROM T_Processes_Drilling a FROM T_Processes_Drilling a
<include refid="TProcessesBlastDesignHoleJoins"/>
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
......
...@@ -24,35 +24,6 @@ public class TProcessesBlastQuery { ...@@ -24,35 +24,6 @@ public class TProcessesBlastQuery {
@ApiModelProperty("Uid") @ApiModelProperty("Uid")
private String Uid; private String Uid;
/**
* 采区名称
*/
@ApiModelProperty("StopeName")
private String StopeName;
/**
* 平台名称
*/
@ApiModelProperty("StepName")
private String StepName;
/**
* 爆区名称
*/
@ApiModelProperty("BlastAreaName")
private String BlastAreaName;
/**
* 炮孔编号
*/
@ApiModelProperty("HoleID")
private String HoleID;
/**
* 爆破日期
*/
@ApiModelProperty("BlastDate")
private LocalDateTime BlastDate;
/** /**
* 爆破人员 * 爆破人员
...@@ -117,12 +88,48 @@ public class TProcessesBlastQuery { ...@@ -117,12 +88,48 @@ public class TProcessesBlastQuery {
@ApiModelProperty("设计孔深") @ApiModelProperty("设计孔深")
private Double DesignDepth; private Double DesignDepth;
//表连接字段 炮孔设计表
/**
* 采区名称
*/
@ApiModelProperty("StopeName")
private String StopeName;
/**
* 平台名称
*/
@ApiModelProperty("StepName")
private String StepName;
/**
* 爆区名称
*/
@ApiModelProperty("BlastAreaName")
private String BlastAreaName;
/**
* 炮孔编号
*/
@ApiModelProperty("HoleID")
private String HoleID;
/** /**
* 单孔爆破量 来自 TProcessesBlastdesignHole * 单孔爆破量 来自 TProcessesBlastdesignHole
*/ */
@ApiModelProperty("单孔爆破量") @ApiModelProperty("单孔爆破量")
private Double HoleBlastVolume; private Double HoleBlastVolume;
//表连接字段,穿孔工序表
/**
* 爆破日期
*/
@ApiModelProperty("BlastDate")
private LocalDateTime BlastDate;
//以下为业务增加字段 //以下为业务增加字段
/** /**
* 炮孔编号 修改新的时候会用的 * 炮孔编号 修改新的时候会用的
......
...@@ -25,35 +25,6 @@ public class TProcessesDrillingQuery { ...@@ -25,35 +25,6 @@ public class TProcessesDrillingQuery {
@ApiModelProperty("Uid") @ApiModelProperty("Uid")
private String Uid; private String Uid;
/**
* 采区名称
*/
@ApiModelProperty("StopeName")
private String StopeName;
/**
* 平台名称
*/
@ApiModelProperty("StepName")
private String StepName;
/**
* 爆区名称
*/
@ApiModelProperty("BlastAreaName")
private String BlastAreaName;
/**
* 炮孔编号
*/
@ApiModelProperty("HoleID")
private String HoleID;
/**
* 穿孔日期
*/
@ApiModelProperty("DrillingDate")
private LocalDateTime DrillingDate;
/** /**
* 项目经理 * 项目经理
...@@ -201,6 +172,35 @@ public class TProcessesDrillingQuery { ...@@ -201,6 +172,35 @@ public class TProcessesDrillingQuery {
//以下是增加字段 需要表连接的字段 炮孔设计 //以下是增加字段 需要表连接的字段 炮孔设计
/**
* 采区名称
*/
@ApiModelProperty("StopeName")
private String StopeName;
/**
* 平台名称
*/
@ApiModelProperty("StepName")
private String StepName;
/**
* 爆区名称
*/
@ApiModelProperty("BlastAreaName")
private String BlastAreaName;
/**
* 炮孔编号
*/
@ApiModelProperty("HoleID")
private String HoleID;
/**
* 穿孔日期
*/
@ApiModelProperty("DrillingDate")
private LocalDateTime DrillingDate;
@ApiModelProperty("孔深(m)") @ApiModelProperty("孔深(m)")
private Double DesignDepth; private Double DesignDepth;
......
...@@ -25,35 +25,8 @@ public class TProcessesBlastVo { ...@@ -25,35 +25,8 @@ public class TProcessesBlastVo {
@ApiModelProperty("Uid") @ApiModelProperty("Uid")
private String Uid; private String Uid;
/**
* 采区名称
*/
@ApiModelProperty("StopeName")
private String StopeName;
/**
* 平台名称
*/
@ApiModelProperty("StepName")
private String StepName;
/**
* 爆区名称
*/
@ApiModelProperty("BlastAreaName")
private String BlastAreaName;
/**
* 炮孔编号
*/
@ApiModelProperty("HoleID")
private String HoleID;
/**
* 爆破日期
*/
@ApiModelProperty("BlastDate")
private LocalDateTime BlastDate;
/** /**
* 爆破人员 * 爆破人员
...@@ -128,4 +101,35 @@ public class TProcessesBlastVo { ...@@ -128,4 +101,35 @@ public class TProcessesBlastVo {
*/ */
@ApiModelProperty("单孔爆破量") @ApiModelProperty("单孔爆破量")
private Double HoleBlastVolume; private Double HoleBlastVolume;
/**
* 采区名称
*/
@ApiModelProperty("StopeName")
private String StopeName;
/**
* 平台名称
*/
@ApiModelProperty("StepName")
private String StepName;
/**
* 爆区名称
*/
@ApiModelProperty("BlastAreaName")
private String BlastAreaName;
/**
* 炮孔编号
*/
@ApiModelProperty("HoleID")
private String HoleID;
/**
* 爆破日期
*/
@ApiModelProperty("BlastDate")
private LocalDateTime BlastDate;
} }
...@@ -25,36 +25,6 @@ public class TProcessesDrillingVo { ...@@ -25,36 +25,6 @@ public class TProcessesDrillingVo {
@ApiModelProperty("Uid") @ApiModelProperty("Uid")
private String Uid; private String Uid;
/**
* 采区名称
*/
@ApiModelProperty("StopeName")
private String StopeName;
/**
* 平台名称
*/
@ApiModelProperty("StepName")
private String StepName;
/**
* 爆区名称
*/
@ApiModelProperty("BlastAreaName")
private String BlastAreaName;
/**
* 炮孔编号
*/
@ApiModelProperty("HoleID")
private String HoleID;
/**
* 穿孔日期
*/
@ApiModelProperty("DrillingDate")
private LocalDateTime DrillingDate;
/** /**
* 项目经理 * 项目经理
*/ */
...@@ -201,6 +171,35 @@ public class TProcessesDrillingVo { ...@@ -201,6 +171,35 @@ public class TProcessesDrillingVo {
//以下是增加字段 需要表连接的字段 炮孔设计 //以下是增加字段 需要表连接的字段 炮孔设计
/**
* 采区名称
*/
@ApiModelProperty("StopeName")
private String StopeName;
/**
* 平台名称
*/
@ApiModelProperty("StepName")
private String StepName;
/**
* 爆区名称
*/
@ApiModelProperty("BlastAreaName")
private String BlastAreaName;
/**
* 炮孔编号
*/
@ApiModelProperty("HoleID")
private String HoleID;
/**
* 穿孔日期
*/
@ApiModelProperty("DrillingDate")
private LocalDateTime DrillingDate;
@ApiModelProperty("孔深(m)") @ApiModelProperty("孔深(m)")
private Double DesignDepth; private Double DesignDepth;
......
...@@ -20,11 +20,8 @@ public interface ITProcessesBlastService extends IService<TProcessesBlast> { ...@@ -20,11 +20,8 @@ public interface ITProcessesBlastService extends IService<TProcessesBlast> {
R updateByUid(TProcessesBlastQuery query); R updateByUid(TProcessesBlastQuery query);
R updateByHoleId(TProcessesBlastQuery query);
R insertTProcessesBlast(TProcessesBlastQuery query); R insertTProcessesBlast(TProcessesBlastQuery query);
R getByUid(TProcessesBlastQuery query); R getByUid(TProcessesBlastQuery query);
R getByHoleId(TProcessesBlastQuery query);
} }
...@@ -24,10 +24,8 @@ public interface ITProcessesDrillingService extends IService<TProcessesDrilling> ...@@ -24,10 +24,8 @@ public interface ITProcessesDrillingService extends IService<TProcessesDrilling>
R updateHoleBlastVolume(TProcessesDrillingQuery query); R updateHoleBlastVolume(TProcessesDrillingQuery query);
R updateByHoleId(TProcessesDrillingQuery query);
R getByUid(TProcessesDrillingQuery query); R getByUid(TProcessesDrillingQuery query);
R getByHoleId(TProcessesDrillingQuery query);
} }
...@@ -56,12 +56,7 @@ public class TProcessesBlastServiceImpl extends ServiceImpl<TProcessesBlastMappe ...@@ -56,12 +56,7 @@ public class TProcessesBlastServiceImpl extends ServiceImpl<TProcessesBlastMappe
Page<TProcessesBlast> page = new Page<>(query.getPageNum(), query.getPageSize()); Page<TProcessesBlast> page = new Page<>(query.getPageNum(), query.getPageSize());
//条件封装 //条件封装
QueryWrapper<TProcessesBlast> queryWrapper = new QueryWrapper<>(); QueryWrapper<TProcessesBlast> queryWrapper = new QueryWrapper<>();
queryWrapper.select(
ProjectEnum.TProcessesBlast.DEPTH.getLabel(),
ProjectEnum.TProcessesBlast.DESIGN_DEPTH.getLabel(),
ProjectEnum.TProcessesBlast.HOLE_ID.getLabel(),
ProjectEnum.TProcessesBlast.HOLE_BLAST_VOLUME.getLabel()
);
//如果设计时间不为空 因为涉及到表连接,需要创建字段别名 //如果设计时间不为空 因为涉及到表连接,需要创建字段别名
if (tProcessesBlastQuery.getBlastDate() != null) { if (tProcessesBlastQuery.getBlastDate() != null) {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
...@@ -89,7 +84,7 @@ public class TProcessesBlastServiceImpl extends ServiceImpl<TProcessesBlastMappe ...@@ -89,7 +84,7 @@ public class TProcessesBlastServiceImpl extends ServiceImpl<TProcessesBlastMappe
} }
//不能修改炮孔编号 //不能修改炮孔编号
if (StringUtils.isNotBlank(query.getHoleID())) { if (StringUtils.isNotBlank(query.getHoleID())) {
return R.failed("爆破设计中->不能修改炮孔编号"); return R.failed("爆破设计中->请到炮孔设计中修改炮孔编号");
} }
//条件封装 //条件封装
BeanUtilsNewCopy.copyPropertiesIgnoreNull(query, temp); BeanUtilsNewCopy.copyPropertiesIgnoreNull(query, temp);
...@@ -97,15 +92,16 @@ public class TProcessesBlastServiceImpl extends ServiceImpl<TProcessesBlastMappe ...@@ -97,15 +92,16 @@ public class TProcessesBlastServiceImpl extends ServiceImpl<TProcessesBlastMappe
if (StringUtils.isNotBlank(query.getStepName()) if (StringUtils.isNotBlank(query.getStepName())
|| StringUtils.isNotBlank(query.getBlastAreaName()) || StringUtils.isNotBlank(query.getBlastAreaName())
|| StringUtils.isNotBlank(query.getStopeName())) { || StringUtils.isNotBlank(query.getStopeName())) {
return R.failed("爆破设计中->请到炮孔设计中修改爆区名称,采区名称,平台名称");
//判断矿山爆区表是否存在数据 不存在不能修改 //判断矿山爆区表是否存在数据 不存在不能修改
//query里不一定StopeName,StepName,BlastAreaName都有,需要从temp中拿query没有的, //query里不一定StopeName,StepName,BlastAreaName都有,需要从temp中拿query没有的,
// 所以将query有的更新到temp中,再把temp中的复制到tMineStopeQuery // 所以将query有的更新到temp中,再把temp中的复制到tMineStopeQuery
TMineStopeQuery tMineStopeQuery = new TMineStopeQuery(); // TMineStopeQuery tMineStopeQuery = new TMineStopeQuery();
BeanUtils.copyProperties(temp, tMineStopeQuery); // BeanUtils.copyProperties(temp, tMineStopeQuery);
R volume = itMineStopeService.getByQuery(tMineStopeQuery); // R volume = itMineStopeService.getByQuery(tMineStopeQuery);
if (volume.getData() == null) { // if (volume.getData() == null) {
return R.failed("爆破设计中->矿山爆区表数据不存在,StopeName,StepName,BlastAreaName"); // return R.failed("爆破设计中->矿山爆区表数据不存在,StopeName,StepName,BlastAreaName");
} // }
} }
//判断是否修改设计孔深 和 单孔爆破量 //判断是否修改设计孔深 和 单孔爆破量
if (query.getDesignDepth() != null || query.getHoleBlastVolume() != null) { if (query.getDesignDepth() != null || query.getHoleBlastVolume() != null) {
...@@ -143,55 +139,16 @@ public class TProcessesBlastServiceImpl extends ServiceImpl<TProcessesBlastMappe ...@@ -143,55 +139,16 @@ public class TProcessesBlastServiceImpl extends ServiceImpl<TProcessesBlastMappe
} }
} }
@Override
public R updateByHoleId(TProcessesBlastQuery query) {
log.info(JSON.toJSONString(query));
//参数校验
Rcode.NOT_PARAM.assertNotNull(query);
Rcode.NOT_PARAM.assertNotNull(query.getHoleID());
//判断数据是否存在
QueryWrapper<TProcessesBlast> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(ProjectEnum.TProcessesBlast.HOLE_ID.getLabel(), query.getHoleID());
TProcessesBlast temp = baseMapper.selectOne(queryWrapper);
if (temp == null) {
return R.failed("爆破设计中->爆破设计中数据不存在:HOLE_ID: " + query.getHoleID());
}
//判断是否将炮孔编号修改为新的炮孔编号 如果是,直接修改,不能调用基础方法,避免循环
if (StringUtils.isNotBlank(query.getNewHoleID())) {
temp.setHoleID(query.getNewHoleID());
int update = baseMapper.updateById(temp);
if (update > 0) {
return R.ok("爆破设计中->修改成功");
} else {
return R.failed("爆破设计中->修改失败");
}
}
//条件封装
query.setUid(temp.getUid());
//调用基础方法修改
return updateByUid(query);
}
@Override @Override
public R insertTProcessesBlast(TProcessesBlastQuery query) { public R insertTProcessesBlast(TProcessesBlastQuery query) {
log.info(JSON.toJSONString(query)); log.info(JSON.toJSONString(query));
//参数校验 //参数校验
Rcode.NOT_PARAM.assertNotNull(query); Rcode.NOT_PARAM.assertNotNull(query);
Rcode.NOT_PARAM.assertNotEmpty(query.getStopeName());
Rcode.NOT_PARAM.assertNotEmpty(query.getStepName());
Rcode.NOT_PARAM.assertNotEmpty(query.getBlastAreaName());
Rcode.NOT_PARAM.assertNotEmpty(query.getHoleID());
//uid自动生成 不能手动设置 //uid自动生成 不能手动设置
if (query.getUid() != null) { if (query.getUid() != null) {
return R.failed("爆破设计中->uid自动生成 不能手动设置"); return R.failed("爆破设计中->uid自动生成 不能手动设置");
} }
//判断炮孔编号是否已经存在
if (StringUtils.isNotBlank(query.getHoleID())) {
R r = getByHoleId(query);
if (r.getData() != null) {
return R.failed("爆破设计中->炮孔编号已存在: HoleID:" + query.getHoleID());
}
}
//条件封装 //条件封装
TProcessesBlast tProcessesDrilling = new TProcessesBlast(); TProcessesBlast tProcessesDrilling = new TProcessesBlast();
BeanUtils.copyProperties(query, tProcessesDrilling); BeanUtils.copyProperties(query, tProcessesDrilling);
...@@ -219,17 +176,5 @@ public class TProcessesBlastServiceImpl extends ServiceImpl<TProcessesBlastMappe ...@@ -219,17 +176,5 @@ public class TProcessesBlastServiceImpl extends ServiceImpl<TProcessesBlastMappe
return R.ok(baseMapper.getByQuery(queryWrapper)); return R.ok(baseMapper.getByQuery(queryWrapper));
} }
@Override
public R getByHoleId(TProcessesBlastQuery query) {
log.info(JSON.toJSONString(query));
//参数校验
Rcode.NOT_PARAM.assertNotNull(query);
Rcode.NOT_PARAM.assertNotEmpty(query.getHoleID());
QueryWrapper<TProcessesBlast> queryWrapper = new QueryWrapper<>();
StringBuilder holeId = new StringBuilder();
holeId.append(ProjectEnum.TableAlias.A.getLabel()).append(ProjectEnum.TProcessesBlast.HOLE_ID.getLabel());
queryWrapper.eq(holeId.toString(), query.getHoleID());
//查询并且返回
return R.ok(baseMapper.getByQuery(queryWrapper));
}
} }
...@@ -96,18 +96,18 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses ...@@ -96,18 +96,18 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses
} }
//修改穿孔工序炮孔编号 //修改穿孔工序炮孔编号
TProcessesDrillingQuery tProcessesDrillingQuery = new TProcessesDrillingQuery(); TProcessesDrillingQuery tProcessesDrillingQuery = new TProcessesDrillingQuery();
tProcessesDrillingQuery.setHoleID(temp.getBlastHoleID()); tProcessesDrillingQuery.setUid(temp.getUid());
tProcessesDrillingQuery.setNewHoleID(query.getBlastHoleID()); tProcessesDrillingQuery.setNewHoleID(query.getBlastHoleID());
R r1 = itProcessesDrillingService.updateByHoleId(tProcessesDrillingQuery); R r1 = itProcessesDrillingService.updateByUid(tProcessesDrillingQuery);
if (r1.getCode() != 0) { if (r1.getCode() != 0) {
log.error("炮孔设计中->修改穿孔工序炮孔编号失败:{}", JSON.toJSONString(tProcessesDrillingQuery)); log.error("炮孔设计中->修改穿孔工序炮孔编号失败:{}", JSON.toJSONString(tProcessesDrillingQuery));
return R.failed(r1.getMsg()); return R.failed(r1.getMsg());
} }
//修改爆破设计炮孔编号 //修改爆破设计炮孔编号
TProcessesBlastQuery tProcessesBlastQuery = new TProcessesBlastQuery(); TProcessesBlastQuery tProcessesBlastQuery = new TProcessesBlastQuery();
tProcessesBlastQuery.setHoleID(temp.getBlastHoleID()); tProcessesBlastQuery.setUid(temp.getUid());
tProcessesBlastQuery.setNewHoleID(query.getBlastHoleID()); tProcessesBlastQuery.setNewHoleID(query.getBlastHoleID());
R r2 = itProcessesBlastService.updateByHoleId(tProcessesBlastQuery); R r2 = itProcessesBlastService.updateByUid(tProcessesBlastQuery);
if (r2.getCode() != 0) { if (r2.getCode() != 0) {
log.error("炮孔设计中->修改爆破设计炮孔编号失败:{}", JSON.toJSONString(tProcessesBlastQuery)); log.error("炮孔设计中->修改爆破设计炮孔编号失败:{}", JSON.toJSONString(tProcessesBlastQuery));
return R.failed(r2.getMsg()); return R.failed(r2.getMsg());
...@@ -156,7 +156,7 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses ...@@ -156,7 +156,7 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses
//如果修改了台阶高度,需要通知爆破设计重新计算设计区爆破量 //如果修改了台阶高度,需要通知爆破设计重新计算设计区爆破量
if (query.getStepHeight() != null) { if (query.getStepHeight() != null) {
TProcessesDrillingQuery tProcessesDrillingQuery = new TProcessesDrillingQuery(); TProcessesDrillingQuery tProcessesDrillingQuery = new TProcessesDrillingQuery();
tProcessesDrillingQuery.setHoleID(temp.getBlastHoleID()); tProcessesDrillingQuery.setUid(temp.getUid());
tProcessesDrillingQuery.setStepHeight(query.getStepHeight()); tProcessesDrillingQuery.setStepHeight(query.getStepHeight());
itProcessesDrillingService.updateHoleBlastVolume(tProcessesDrillingQuery); itProcessesDrillingService.updateHoleBlastVolume(tProcessesDrillingQuery);
} }
...@@ -273,12 +273,12 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses ...@@ -273,12 +273,12 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses
log.info(JSON.toJSONString(tProcessesBlastdesignHole)); log.info(JSON.toJSONString(tProcessesBlastdesignHole));
int insert = baseMapper.insert(tProcessesBlastdesignHole); int insert = baseMapper.insert(tProcessesBlastdesignHole);
if (insert > 0) { if (insert > 0) {
R r = getByBlastHoleID(query);
TProcessesBlastdesignHole hole = (TProcessesBlastdesignHole) r.getData();
//增加一条穿孔工序 //增加一条穿孔工序
TProcessesDrillingQuery tProcessesDrillingQuery = new TProcessesDrillingQuery(); TProcessesDrillingQuery tProcessesDrillingQuery = new TProcessesDrillingQuery();
tProcessesDrillingQuery.setStepName(tProcessesBlastdesignHole.getStepName()); tProcessesBlastdesignHole.setUid(hole.getUid());
tProcessesDrillingQuery.setStopeName(tProcessesBlastdesignHole.getStopeName());
tProcessesDrillingQuery.setBlastAreaName(tProcessesBlastdesignHole.getBlastAreaName());
tProcessesDrillingQuery.setHoleID(query.getBlastHoleID());
tProcessesDrillingQuery.setTag(DateUtil.timeToStr(LocalDateTime.now(), DateUtil.FORMAT_TO_SECOND)); tProcessesDrillingQuery.setTag(DateUtil.timeToStr(LocalDateTime.now(), DateUtil.FORMAT_TO_SECOND));
R r1 = itProcessesDrillingService.insertTProcessesDrilling(tProcessesDrillingQuery); R r1 = itProcessesDrillingService.insertTProcessesDrilling(tProcessesDrillingQuery);
if (r1.getCode() != 0) { if (r1.getCode() != 0) {
...@@ -288,10 +288,7 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses ...@@ -288,10 +288,7 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses
//增加一条爆破工序 //增加一条爆破工序
TProcessesBlastQuery tProcessesBlastQuery = new TProcessesBlastQuery(); TProcessesBlastQuery tProcessesBlastQuery = new TProcessesBlastQuery();
tProcessesBlastQuery.setStepName(tProcessesBlastdesignHole.getStepName()); tProcessesBlastQuery.setUid(hole.getUid());
tProcessesBlastQuery.setStopeName(tProcessesBlastdesignHole.getStopeName());
tProcessesBlastQuery.setBlastAreaName(tProcessesBlastdesignHole.getBlastAreaName());
tProcessesBlastQuery.setHoleID(query.getBlastHoleID());
tProcessesBlastQuery.setTag(DateUtil.timeToStr(LocalDateTime.now(), DateUtil.FORMAT_TO_SECOND)); tProcessesBlastQuery.setTag(DateUtil.timeToStr(LocalDateTime.now(), DateUtil.FORMAT_TO_SECOND));
R r2 = itProcessesBlastService.insertTProcessesBlast(tProcessesBlastQuery); R r2 = itProcessesBlastService.insertTProcessesBlast(tProcessesBlastQuery);
if (r2.getCode() != 0) { if (r2.getCode() != 0) {
......
...@@ -58,12 +58,15 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin ...@@ -58,12 +58,15 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin
Page<TProcessesDrilling> page = new Page<>(query.getPageNum(), query.getPageSize()); Page<TProcessesDrilling> page = new Page<>(query.getPageNum(), query.getPageSize());
//条件封装 //条件封装
QueryWrapper<TProcessesDrilling> queryWrapper = new QueryWrapper<>(); QueryWrapper<TProcessesDrilling> queryWrapper = new QueryWrapper<>();
StringBuffer drillingDate = new StringBuffer()
.append(ProjectEnum.TableAlias.B.getLabel())
.append(ProjectEnum.TProcessesDrilling.DRILLING_DATE.getLabel());
//如果设计时间不为空 因为涉及到表连接,需要创建字段别名 //如果设计时间不为空 因为涉及到表连接,需要创建字段别名
if (tProcessesDrillingQuery.getDrillingDate() != null) { if (tProcessesDrillingQuery.getDrillingDate() != null) {
//前端传来的时间可能为2021-04-05 17:37:33.000, 需要查询 2021-04-05 00:00:00 到 2021-04-05 23:59:59 的数据 故作处理 //前端传来的时间可能为2021-04-05 17:37:33.000, 需要查询 2021-04-05 00:00:00 到 2021-04-05 23:59:59 的数据 故作处理
queryWrapper queryWrapper
.ge(ProjectEnum.TProcessesDrilling.DRILLING_DATE.getLabel(), DateUtil.getBeginTimeStr(tProcessesDrillingQuery.getDrillingDate())) .ge(drillingDate.toString(), DateUtil.getBeginTimeStr(tProcessesDrillingQuery.getDrillingDate()))
.le(ProjectEnum.TProcessesDrilling.DRILLING_DATE.getLabel(), DateUtil.getEndTimeStr(tProcessesDrillingQuery.getDrillingDate())); .le(drillingDate.toString(), DateUtil.getEndTimeStr(tProcessesDrillingQuery.getDrillingDate()));
} }
//查询分页数据 //查询分页数据
...@@ -75,9 +78,6 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin ...@@ -75,9 +78,6 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin
Double depthSum = baseMapper.getSumByCondition(depth.toString(), queryWrapper); Double depthSum = baseMapper.getSumByCondition(depth.toString(), queryWrapper);
//查询,今日合计孔深 //查询,今日合计孔深
StringBuffer drillingDate = new StringBuffer()
.append(ProjectEnum.TableAlias.A.getLabel())
.append(ProjectEnum.TProcessesDrilling.DRILLING_DATE.getLabel());
//初始化QueryWrapper //初始化QueryWrapper
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
queryWrapper = new QueryWrapper<>(); queryWrapper = new QueryWrapper<>();
...@@ -104,21 +104,7 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin ...@@ -104,21 +104,7 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin
log.info(JSON.toJSONString(query)); log.info(JSON.toJSONString(query));
//参数校验 //参数校验
Rcode.NOT_PARAM.assertNotNull(query); Rcode.NOT_PARAM.assertNotNull(query);
Rcode.NOT_PARAM.assertNotEmpty(query.getStopeName());
Rcode.NOT_PARAM.assertNotEmpty(query.getStepName());
Rcode.NOT_PARAM.assertNotEmpty(query.getBlastAreaName());
Rcode.NOT_PARAM.assertNotEmpty(query.getHoleID());
//uid自动生成 不能手动设置
if (query.getUid() != null) {
return R.failed("穿孔工序中->uid自动生成 不能手动设置");
}
//判断炮孔编号是否已经存在
if (StringUtils.isNotBlank(query.getHoleID())) {
R r = getByHoleId(query);
if (r.getData() != null) {
return R.failed("穿孔工序中->炮孔编号已存在: HoleID:" + query.getHoleID());
}
}
//条件封装 //条件封装
TProcessesDrilling tProcessesDrilling = new TProcessesDrilling(); TProcessesDrilling tProcessesDrilling = new TProcessesDrilling();
BeanUtils.copyProperties(query, tProcessesDrilling); BeanUtils.copyProperties(query, tProcessesDrilling);
...@@ -154,28 +140,30 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin ...@@ -154,28 +140,30 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin
if (StringUtils.isNotBlank(query.getStepName()) if (StringUtils.isNotBlank(query.getStepName())
|| StringUtils.isNotBlank(query.getBlastAreaName()) || StringUtils.isNotBlank(query.getBlastAreaName())
|| StringUtils.isNotBlank(query.getStopeName())) { || StringUtils.isNotBlank(query.getStopeName())) {
return R.failed("穿孔工序中->请到炮孔设计中修改爆区名称,采区名称,平台名称");
//判断矿山爆区表是否存在数据 不存在不能修改 //判断矿山爆区表是否存在数据 不存在不能修改
//query里不一定StopeName,StepName,BlastAreaName都有,需要从temp中拿query没有的, //query里不一定StopeName,StepName,BlastAreaName都有,需要从temp中拿query没有的,
// 所以将query有的更新到temp中,再把temp中的复制到tMineStopeQuery // 所以将query有的更新到temp中,再把temp中的复制到tMineStopeQuery
TMineStopeQuery tMineStopeQuery = new TMineStopeQuery(); // TMineStopeQuery tMineStopeQuery = new TMineStopeQuery();
BeanUtils.copyProperties(temp, tMineStopeQuery); // BeanUtils.copyProperties(temp, tMineStopeQuery);
R volume = itMineStopeService.getByQuery(tMineStopeQuery); // R volume = itMineStopeService.getByQuery(tMineStopeQuery);
if (volume.getData() == null) { // if (volume.getData() == null) {
return R.failed("穿孔工序中->矿山爆区表数据不存在,StopeName,StepName,BlastAreaName"); // return R.failed("穿孔工序中->矿山爆区表数据不存在,StopeName,StepName,BlastAreaName");
} // }
} }
//判断是否修改设计爆区爆破量 设计爆区爆破量(m3) TAT //判断是否修改设计爆区爆破量 设计爆区爆破量(m3) TAT
if (query.getBlastVolume() != null) { if (query.getBlastVolume() != null) {
TProcessesBlastdesignVolumeQuery tProcessesBlastdesignVolumeQuery = new TProcessesBlastdesignHoleQuery(); return R.failed("穿孔工序中->请到炮孔设计中修改设计爆区爆破量");
tProcessesBlastdesignVolumeQuery.setStopeName(temp.getStopeName()); // TProcessesBlastdesignVolumeQuery tProcessesBlastdesignVolumeQuery = new TProcessesBlastdesignHoleQuery();
tProcessesBlastdesignVolumeQuery.setStepName(temp.getStepName()); // tProcessesBlastdesignVolumeQuery.setStopeName(temp.getStopeName());
tProcessesBlastdesignVolumeQuery.setBlastAreaName(temp.getBlastAreaName()); // tProcessesBlastdesignVolumeQuery.setStepName(temp.getStepName());
tProcessesBlastdesignVolumeQuery.setBlastVolume(query.getBlastVolume()); // tProcessesBlastdesignVolumeQuery.setBlastAreaName(temp.getBlastAreaName());
R r = itProcessesBlastdesignVolumeService.updateByQuery(tProcessesBlastdesignVolumeQuery); // tProcessesBlastdesignVolumeQuery.setBlastVolume(query.getBlastVolume());
if (r.getCode() != 0) { // R r = itProcessesBlastdesignVolumeService.updateByQuery(tProcessesBlastdesignVolumeQuery);
log.info("穿孔工序中->修改设计爆区爆破量失败:{}", JSON.toJSONString(tProcessesBlastdesignVolumeQuery)); // if (r.getCode() != 0) {
return R.failed(r.getMsg()); // log.info("穿孔工序中->修改设计爆区爆破量失败:{}", JSON.toJSONString(tProcessesBlastdesignVolumeQuery));
} // return R.failed(r.getMsg());
// }
} }
//判断是否修改炮孔设计 //判断是否修改炮孔设计
if (query.getDesignDepth() != null if (query.getDesignDepth() != null
...@@ -208,15 +196,15 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin ...@@ -208,15 +196,15 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin
//计算单孔爆破量 //计算单孔爆破量
//先获取炮孔设计数据台阶高度 //先获取炮孔设计数据台阶高度
TProcessesBlastdesignHoleQuery holeQuery = new TProcessesBlastdesignHoleQuery(); TProcessesBlastdesignHoleQuery holeQuery = new TProcessesBlastdesignHoleQuery();
holeQuery.setBlastHoleID(temp.getHoleID()); holeQuery.setUid(temp.getUid());
R r = itProcessesBlastdesignHoleService.getByBlastHoleID(holeQuery); R r = itProcessesBlastdesignHoleService.getByUid(holeQuery);
//不为空计算单孔爆破量 //不为空计算单孔爆破量
if (r.getData() != null) { if (r.getData() != null) {
TProcessesBlastdesignHole data = (TProcessesBlastdesignHole) r.getData(); TProcessesBlastdesignHole data = (TProcessesBlastdesignHole) r.getData();
Double volume = calculateHoleBlastVolume(temp.getHoleSpace(), temp.getRowSpace(), data.getStepHeight()); Double volume = calculateHoleBlastVolume(temp.getHoleSpace(), temp.getRowSpace(), data.getStepHeight());
temp.setHoleBlastVolume(volume); temp.setHoleBlastVolume(volume);
} else { } else {
log.info("穿孔工序中->计算单孔爆破量时,获取炮孔设计为空,炮孔编号:{}", temp.getHoleID()); log.info("穿孔工序中->计算单孔爆破量时,获取炮孔设计为空,炮孔编号:{}", temp.getUid());
} }
} }
...@@ -233,47 +221,16 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin ...@@ -233,47 +221,16 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin
} }
@Override
public R updateByHoleId(TProcessesDrillingQuery query) {
log.info(JSON.toJSONString(query));
//参数校验
Rcode.NOT_PARAM.assertNotNull(query);
Rcode.NOT_PARAM.assertNotNull(query.getHoleID());
//判断数据是否存在
QueryWrapper<TProcessesDrilling> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(ProjectEnum.TProcessesDrilling.HOLE_ID.getLabel(), query.getHoleID());
TProcessesDrilling temp = baseMapper.selectOne(queryWrapper);
if (temp == null) {
return R.failed("穿孔工序中->数据不存在:HOLE_ID: " + query.getHoleID());
}
//判断是否将炮孔编号修改为新的炮孔编号 如果是,直接修改,不能调用基础方法,避免循环
if (StringUtils.isNotBlank(query.getNewHoleID())) {
temp.setHoleID(query.getNewHoleID());
int update = baseMapper.updateById(temp);
if (update > 0) {
return R.ok("穿孔工序中->修改成功");
} else {
return R.failed("穿孔工序中->修改失败");
}
}
//条件封装
query.setUid(temp.getUid());
//调用基础方法修改
return updateByUid(query);
}
@Override @Override
public R updateHoleBlastVolume(TProcessesDrillingQuery query) { public R updateHoleBlastVolume(TProcessesDrillingQuery query) {
log.info(JSON.toJSONString(query)); log.info(JSON.toJSONString(query));
//参数校验 //参数校验
Rcode.NOT_PARAM.assertNotNull(query); Rcode.NOT_PARAM.assertNotNull(query);
Rcode.NOT_PARAM.assertNotNull(query.getHoleID()); Rcode.NOT_PARAM.assertNotNull(query.getUid());
Rcode.NOT_PARAM.assertNotNull(query.getStepHeight()); Rcode.NOT_PARAM.assertNotNull(query.getStepHeight());
//判断数据是否存在 //判断数据是否存在
QueryWrapper<TProcessesDrilling> queryWrapper = new QueryWrapper<>(); QueryWrapper<TProcessesDrilling> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(ProjectEnum.TProcessesBlast.HOLE_ID.getLabel(), query.getHoleID()); queryWrapper.eq(ProjectEnum.TProcessesBlast.UID.getLabel(), query.getUid());
TProcessesDrilling temp = baseMapper.selectOne(queryWrapper); TProcessesDrilling temp = baseMapper.selectOne(queryWrapper);
if (temp == null) { if (temp == null) {
return R.failed("穿孔工序中->数据不存在:HOLE_ID: " + query.getHoleID()); return R.failed("穿孔工序中->数据不存在:HOLE_ID: " + query.getHoleID());
...@@ -306,22 +263,6 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin ...@@ -306,22 +263,6 @@ public class TProcessesDrillingServiceImpl extends ServiceImpl<TProcessesDrillin
} }
@Override
public R getByHoleId(TProcessesDrillingQuery query) {
log.info(JSON.toJSONString(query));
//参数校验
Rcode.NOT_PARAM.assertNotNull(query);
Rcode.NOT_PARAM.assertNotEmpty(query.getHoleID());
//查询并且返回
QueryWrapper<TProcessesDrilling> queryWrapper = new QueryWrapper<>();
StringBuilder holeId = new StringBuilder();
holeId.append(ProjectEnum.TableAlias.A.getLabel()).append(ProjectEnum.TProcessesDrilling.HOLE_ID.getLabel());
queryWrapper.eq(holeId.toString(), query.getHoleID());
//查询并且返回
return R.ok(baseMapper.getByQuery(queryWrapper));
}
/** /**
* 计算并设值 单孔爆破量(m3)=孔距*排距*台阶高度 * 计算并设值 单孔爆破量(m3)=孔距*排距*台阶高度
*/ */
......
...@@ -6,11 +6,8 @@ ...@@ -6,11 +6,8 @@
<!-- 表和实体字段对照关系, 类似RestultMap --> <!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TProcessesBlastColumns"> <sql id="TProcessesBlastColumns">
a.Uid, a.Uid,
a.StopeName,
a.StepName,
a.BlastAreaName,
a.HoleID,
a.BlastDate,
a.BlastPeople, a.BlastPeople,
a.CheckHoleDate, a.CheckHoleDate,
a.CheckHolePeople, a.CheckHolePeople,
...@@ -23,30 +20,40 @@ ...@@ -23,30 +20,40 @@
</sql> </sql>
<sql id="TProcessesBlastdesignColumns"> <sql id="TProcessesBlastdesignColumns">
b.StopeName,
b.StepName,
b.BlastAreaName,
b.BlastHoleID AS HoleID,
b.HoleBlastVolume, b.HoleBlastVolume,
b.depth AS DesignDepth,<!-- 设计孔深,将爆破工序里的depth去掉,用设计炮孔里的替代 --> b.depth AS DesignDepth,<!-- 设计孔深,将爆破工序里的depth去掉,用设计炮孔里的替代 -->
</sql> </sql>
<sql id="TProcessesDrillingColumns"> <sql id="TProcessesDrillingColumns">
c.BlastDate,
c.Depth, c.Depth,
</sql> </sql>
<sql id="TProcessesBlastdesignHoleJoins"> <sql id="TProcessesDrillingJoins">
left join T_Processes_BlastDesign_Hole b on a.HoleID = b.BlastHoleID left join T_Processes_Drilling c on a.Uid = c.Uid
left join T_Processes_Drilling c on a.HoleID = c.HoleID </sql>
<sql id="TProcessesBlastDesignHoleJoins">
left join T_Processes_BlastDesign_Hole b on c.Uid = b.BlastHoleID
</sql> </sql>
<!-- 获取所有getPage列表 --> <!-- 获取所有getPage列表 -->
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo"> <select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo">
SELECT SELECT
a.Uid, a.Uid,
a.HoleID, b.BlastHoleID AS HoleID,
b.HoleBlastVolume, b.HoleBlastVolume,
b.depth AS DesignDepth, b.depth AS DesignDepth,
c.Depth c.Depth
FROM T_Processes_Blast a FROM T_Processes_Blast a
<include refid="TProcessesBlastdesignHoleJoins"/> <include refid="TProcessesDrillingJoins"/>
<include refid="TProcessesBlastDesignHoleJoins"/>
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
...@@ -60,7 +67,8 @@ ...@@ -60,7 +67,8 @@
<include refid="TProcessesDrillingColumns"/> <include refid="TProcessesDrillingColumns"/>
<include refid="TProcessesBlastColumns"/> <include refid="TProcessesBlastColumns"/>
FROM T_Processes_Blast a FROM T_Processes_Blast a
<include refid="TProcessesBlastdesignHoleJoins"/> <include refid="TProcessesDrillingJoins"/>
<include refid="TProcessesBlastDesignHoleJoins"/>
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
......
...@@ -28,13 +28,9 @@ ...@@ -28,13 +28,9 @@
b.DesignDate, b.DesignDate,
</sql> </sql>
<sql id="TProcessesDrillingColumns">
d.DrillingDate,
</sql>
<sql id="TProcessesBlastdesignHoleJoins"> <sql id="TProcessesBlastdesignHoleJoins">
left join T_Processes_BlastDesign_Volume b on a.StopeName=b.StopeName and a.StepName=b.StepName and a.BlastAreaName=b.BlastAreaName left join T_Processes_BlastDesign_Volume b on a.StopeName=b.StopeName and a.StepName=b.StepName and a.BlastAreaName=b.BlastAreaName
left join T_Processes_Drilling d on a.BlastHoleID = d.HoleID
</sql> </sql>
<!-- 获取所有getPage列表 --> <!-- 获取所有getPage列表 -->
...@@ -52,8 +48,7 @@ ...@@ -52,8 +48,7 @@
a.y, a.y,
a.z, a.z,
a.StepHeight, a.StepHeight,
b.BlastVolume, b.BlastVolume
d.DrillingDate
FROM T_Processes_BlastDesign_Hole a FROM T_Processes_BlastDesign_Hole a
<include refid="TProcessesBlastdesignHoleJoins"/> <include refid="TProcessesBlastdesignHoleJoins"/>
<where> <where>
......
...@@ -6,11 +6,6 @@ ...@@ -6,11 +6,6 @@
<!-- 表和实体字段对照关系, 类似RestultMap --> <!-- 表和实体字段对照关系, 类似RestultMap -->
<sql id="TProcessesDrillingColumns"> <sql id="TProcessesDrillingColumns">
a.Uid, a.Uid,
a.StopeName,
a.StepName,
a.BlastAreaName,
a.HoleID,
a.DrillingDate,
a.Manager, a.Manager,
a.Supervisor, a.Supervisor,
a.TechDepart, a.TechDepart,
...@@ -37,7 +32,13 @@ ...@@ -37,7 +32,13 @@
a.Tag a.Tag
</sql> </sql>
<sql id="TProcessesDiggingHoleColumns"> <sql id="TProcessesBlastDesignHoleColumns">
b.StopeName,
b.StepName,
b.BlastAreaName,
b.BlastHoleID AS HoleId,
b.DrillingDate,
b.Depth AS DesignDepth, b.Depth AS DesignDepth,
b.RowSpace AS DesignRowSpace, b.RowSpace AS DesignRowSpace,
b.HoleSpace AS DesignHoleSpace, b.HoleSpace AS DesignHoleSpace,
...@@ -53,26 +54,30 @@ ...@@ -53,26 +54,30 @@
d.DesignDate, d.DesignDate,
</sql> </sql>
<sql id="TProcessesDrillingJoins"> <sql id="TProcessesBlastDesignHoleJoins">
left join T_Processes_BlastDesign_Hole b on a.HoleID = b.BlastHoleID left join T_Processes_BlastDesign_Hole b on a.Uid = b.Uid
left join T_Processes_BlastDesign_Volume d on a.StopeName=d.StopeName and a.StepName=d.StepName and a.BlastAreaName=d.BlastAreaName </sql>
<sql id="TProcessesBlastDesignVolumeJoins">
left join T_Processes_BlastDesign_Volume d on b.StopeName=d.StopeName and b.StepName=d.StepName and b.BlastAreaName=d.BlastAreaName
</sql> </sql>
<!-- 获取所有getPage列表 --> <!-- 获取所有getPage列表 -->
<select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo"> <select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo">
SELECT SELECT
a.Uid, a.Uid,
a.HoleID,
a.Depth, a.Depth,
a.RowSpace, a.RowSpace,
a.HoleSpace, a.HoleSpace,
a.HoleBlastVolume, a.HoleBlastVolume,
b.BlastHoleID AS HoleId,
b.Depth AS DesignDepth, b.Depth AS DesignDepth,
b.RowSpace AS DesignRowSpace, b.RowSpace AS DesignRowSpace,
b.HoleSpace AS DesignHoleSpace, b.HoleSpace AS DesignHoleSpace,
b.StepHeight b.StepHeight
FROM T_Processes_Drilling a FROM T_Processes_Drilling a
<include refid="TProcessesDrillingJoins"/> <include refid="TProcessesBlastDesignHoleJoins"/>
<include refid="TProcessesBlastDesignVolumeJoins"/>
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
...@@ -82,11 +87,12 @@ ...@@ -82,11 +87,12 @@
<!-- 获取所有getPage列表 --> <!-- 获取所有getPage列表 -->
<select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo"> <select id="getByQuery" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesDrillingVo">
SELECT SELECT
<include refid="TProcessesDiggingHoleColumns"/> <include refid="TProcessesBlastDesignHoleColumns"/>
<include refid="TProcessesBlastdesignVolumeColumns"/> <include refid="TProcessesBlastdesignVolumeColumns"/>
<include refid="TProcessesDrillingColumns"/> <include refid="TProcessesDrillingColumns"/>
FROM T_Processes_Drilling a FROM T_Processes_Drilling a
<include refid="TProcessesDrillingJoins"/> <include refid="TProcessesBlastDesignHoleJoins"/>
<include refid="TProcessesBlastDesignVolumeJoins"/>
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
...@@ -97,6 +103,7 @@ ...@@ -97,6 +103,7 @@
SELECT SELECT
sum(${condition}) sum(${condition})
FROM T_Processes_Drilling a FROM T_Processes_Drilling a
<include refid="TProcessesBlastDesignHoleJoins"/>
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}
</where> </where>
......
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