Merge branch 'b_lms' of http://121.40.234.130:8899/root/lanzhouhailiang_one into b_lms
This commit is contained in:
@@ -57,10 +57,10 @@ public interface IBstIvtCutpointivtService extends IService<BstIvtCutpointivt> {
|
||||
* 获取同尺寸的气涨轴
|
||||
* @param type 点位类型:1套轴对接位,2分切缓存位,3分切对接位
|
||||
* @param size 气涨轴尺寸
|
||||
* @param area 区域(0上1下)
|
||||
* @param generation 代数(4:小,5:大)
|
||||
* @return /
|
||||
*/
|
||||
List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String area);
|
||||
List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String generation);
|
||||
|
||||
/**
|
||||
* 根据桁架对应的点位编码获取点位实体
|
||||
@@ -80,8 +80,7 @@ public interface IBstIvtCutpointivtService extends IService<BstIvtCutpointivt> {
|
||||
/**
|
||||
* 获取类型1状态3,没任务的点位
|
||||
* @param location 区域:0上1下
|
||||
* @param area:区域:B1 B2 B3 B4
|
||||
* @return
|
||||
*/
|
||||
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location, String area);
|
||||
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.b_lms.bst.ivt.cutpointivt.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -84,4 +85,9 @@ public class BstIvtCutpointivt implements Serializable {
|
||||
|
||||
private String point_status;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String qzz_generation;
|
||||
@TableField(exist = false)
|
||||
private String qzz_size;
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public interface BstIvtCutpointivtMapper extends BaseMapper<BstIvtCutpointivt> {
|
||||
|
||||
List<BstIvtCutpointivt> getAreaNotTaskPointByStatus(String type, String pointStatus, String area, String sort);
|
||||
|
||||
List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String area);
|
||||
List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String generation);
|
||||
|
||||
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location, String area);
|
||||
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location);
|
||||
}
|
||||
|
||||
@@ -29,11 +29,14 @@
|
||||
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt">
|
||||
SELECT bc.*
|
||||
FROM `bst_ivt_cutpointivt` bc
|
||||
LEFT JOIN pdm_bi_slittingproductionplan pp ON pp.qzzno = bc.qzz_no1
|
||||
OR pp.qzzno = bc.qzz_no2
|
||||
LEFT JOIN pdm_bi_slittingproductionplan pp ON pp.qzzno = bc.qzz_no1
|
||||
OR pp.qzzno = bc.qzz_no2
|
||||
LEFT JOIN st_ivt_cutpointivt sc ON sc.ext_code = pp.resource_name
|
||||
WHERE bc.point_type = #{type}
|
||||
AND pp.qzz_size = #{size}
|
||||
AND LEFT(pp.resource_name, 2) = #{area}
|
||||
<if test="size == '3'">
|
||||
AND sc.qzz_generation = #{generation}
|
||||
</if>
|
||||
AND bc.is_used = '1'
|
||||
AND bc.point_status = '3'
|
||||
AND 0 = (SELECT COUNT(*)
|
||||
@@ -43,9 +46,10 @@
|
||||
</select>
|
||||
<select id="getAreaNotTaskPointByLocationAreaAndStatus"
|
||||
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt">
|
||||
SELECT DISTINCT bic.*
|
||||
SELECT DISTINCT bic.*, sc.qzz_generation, p.qzz_size
|
||||
FROM bst_ivt_cutpointivt bic
|
||||
LEFT JOIN pdm_bi_slittingproductionplan p ON p.qzzno = bic.qzz_no1 OR p.qzzno = bic.qzz_no2
|
||||
LEFT JOIN st_ivt_cutpointivt sc ON sc.ext_code = p.resource_name
|
||||
WHERE bic.point_type = '1'
|
||||
AND bic.is_used = '1'
|
||||
AND bic.point_status = '3'
|
||||
@@ -57,6 +61,5 @@
|
||||
OR t.point_code1 = bic.truss_point_code1 oR t.point_code2 = bic.truss_point_code1
|
||||
OR t.point_code1 = bic.truss_point_code2 oR t.point_code2 = bic.truss_point_code2)
|
||||
)
|
||||
AND LEFT(p.resource_name,2) = #{area}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -94,8 +94,8 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String area) {
|
||||
return bstIvtCutpointivtMapper.getPointByTypeAndShaftSize(type, size, area);
|
||||
public List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String generation) {
|
||||
return bstIvtCutpointivtMapper.getPointByTypeAndShaftSize(type, size, generation);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,7 +115,7 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location, String area) {
|
||||
return bstIvtCutpointivtMapper.getAreaNotTaskPointByLocationAreaAndStatus(location, area);
|
||||
public List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location) {
|
||||
return bstIvtCutpointivtMapper.getAreaNotTaskPointByLocationAreaAndStatus(location);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,11 +63,11 @@ public interface IBstIvtShafttubeivtService extends IService<BstIvtShafttubeivt>
|
||||
/**
|
||||
* 获得气胀轴库对应的气涨轴位置
|
||||
* @param qzzSize 气涨轴尺寸
|
||||
* @param specification 标箔、锂电
|
||||
* @param pointCode 对应的穿拔轴机
|
||||
* @param location 位置:上半部分还是下半部分
|
||||
* @return
|
||||
*/
|
||||
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String specification, String location);
|
||||
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String pointCode, String location);
|
||||
|
||||
/**
|
||||
* 获取没任务的气涨轴缓存位
|
||||
|
||||
@@ -92,4 +92,7 @@ public class BstIvtShafttubeivt implements Serializable {
|
||||
/** 规划 */
|
||||
private String plan;
|
||||
|
||||
/** 关联点位 */
|
||||
private String parent_code;
|
||||
|
||||
}
|
||||
|
||||
@@ -13,9 +13,21 @@ public interface BstIvtShafttubeivtMapper extends BaseMapper<BstIvtShafttubeivt>
|
||||
|
||||
List<BstIvtShafttubeivt> getAllShaftPointsByConditions(String type, String location, String have);
|
||||
|
||||
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String specification, String location);
|
||||
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String pointCode, String location);
|
||||
|
||||
/**
|
||||
* 获取含有气胀轴的气胀轴暂存位
|
||||
* @param qzzSize 气胀轴尺寸
|
||||
* @param specification 标箔/锂电
|
||||
* @param location 位置(上下)
|
||||
* @return /
|
||||
*/
|
||||
List<BstIvtShafttubeivt> getNotTaskShaftCache(String qzzSize, String specification, String location);
|
||||
|
||||
/**
|
||||
* 获取空气胀轴的气胀轴暂存位
|
||||
* @param startPoint 点位信息(包含:尺寸、类型、位置)
|
||||
* @return /
|
||||
*/
|
||||
List<BstIvtShafttubeivt> getNotTaskShaftCacheEmpty(BstIvtShafttubeivt startPoint);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
)
|
||||
</select>
|
||||
<select id="getByQzzSize" resultType="org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
`bst_ivt_shafttubeivt` bsf
|
||||
WHERE bsf.is_used = '1' AND bsf.qzz_size = #{qzzSize} AND bsf.point_type = '1'
|
||||
AND bsf.qzz_generation = #{specification} AND bsf.point_location = #{location}
|
||||
SELECT *
|
||||
FROM `bst_ivt_shafttubeivt` bsf
|
||||
WHERE bsf.is_used = '1'
|
||||
AND bsf.qzz_size = #{qzzSize}
|
||||
AND bsf.point_type = '1'
|
||||
AND bsf.point_location = #{location}
|
||||
AND bsf.parent_code = #{pointCode}
|
||||
</select>
|
||||
<select id="getNotTaskShaftCache"
|
||||
resultType="org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt">
|
||||
|
||||
@@ -102,8 +102,8 @@ public class BstIvtShafttubeivtServiceImpl extends ServiceImpl<BstIvtShafttubeiv
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String specification, String location) {
|
||||
return bstIvtShafttubeivtMapper.getByQzzSize(qzzSize, specification, location);
|
||||
public List<BstIvtShafttubeivt> getByQzzSize(String qzzSize, String pointCode, String location) {
|
||||
return bstIvtShafttubeivtMapper.getByQzzSize(qzzSize, pointCode, location);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,10 +45,9 @@ public interface IPdmBiSlittingproductionplanService extends IService<PdmBiSlitt
|
||||
|
||||
/**
|
||||
* 获取可用的分切计划
|
||||
* @param area 区域
|
||||
* @return /
|
||||
*/
|
||||
List<SlitterPlanDistinctDto> getAllCutPlan(String area);
|
||||
List<SlitterPlanDistinctDto> getAllCutPlan();
|
||||
|
||||
/**
|
||||
* 通过气涨轴编码获取分切计划
|
||||
|
||||
@@ -12,5 +12,5 @@ import java.util.List;
|
||||
**/
|
||||
public interface PdmBiSlittingproductionplanMapper extends BaseMapper<PdmBiSlittingproductionplan> {
|
||||
|
||||
List<SlitterPlanDistinctDto> getAllCutPlan(String area);
|
||||
List<SlitterPlanDistinctDto> getAllCutPlan();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
p.parent_container_name,
|
||||
p.split_group,
|
||||
p.up_or_down,
|
||||
p.qzz_size,
|
||||
sc.qzz_generation,
|
||||
COALESCE ( count_table.num, 0 ) num,
|
||||
COALESCE ( ct1.cn, 0 ) AS cn,
|
||||
COALESCE ( ct2.cnn, 0 ) AS cnn
|
||||
@@ -58,12 +60,13 @@
|
||||
AND p.parent_container_name = ct2.parent_container_name
|
||||
AND p.split_group = ct2.split_group
|
||||
AND p.up_or_down <![CDATA[ <> ]]> ct2.up_or_down
|
||||
LEFT JOIN st_ivt_cutpointivt sc
|
||||
ON sc.ext_code = p.resource_name
|
||||
WHERE
|
||||
p.`status` = '01'
|
||||
AND p.is_child_tz_ok = '0'
|
||||
AND p.is_paper_ok = '1'
|
||||
AND p.is_delete = '0'
|
||||
AND LEFT ( p.resource_name, 2 ) = #{area}
|
||||
AND p.up_or_down IS NOT NULL
|
||||
AND p.left_or_right IS NOT NULL
|
||||
GROUP BY
|
||||
@@ -71,6 +74,8 @@
|
||||
p.parent_container_name,
|
||||
p.split_group,
|
||||
p.up_or_down,
|
||||
p.qzz_size,
|
||||
sc.qzz_generation,
|
||||
num,
|
||||
cn,
|
||||
cnn
|
||||
|
||||
@@ -77,8 +77,8 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SlitterPlanDistinctDto> getAllCutPlan(String area) {
|
||||
return pdmBiSlittingproductionplanMapper.getAllCutPlan(area);
|
||||
public List<SlitterPlanDistinctDto> getAllCutPlan() {
|
||||
return pdmBiSlittingproductionplanMapper.getAllCutPlan();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,9 +30,10 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 自动任务 呼叫套轴 根据分切计划来呼叫套轴任务 桁架任务
|
||||
* @Date: 2024/2/1
|
||||
* @see TrussCallAirShaftTask#createTask(JSONObject)
|
||||
* @Description: 自动任务 呼叫套轴 根据分切计划来呼叫套轴任务 桁架任务
|
||||
* <p>注:内包间只是区分气胀轴大小(即代数),不需要区分锂电/标箔</p>
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@@ -57,34 +58,21 @@ public class AutoCallAirShaftTask {
|
||||
* 并根据计划来决定是进行套轴还是拔轴操作。如果需要套轴,它会寻找合适的套轴位置,并且在没有合适位置时会触发滚条气涨轴的操作。
|
||||
* 同时,该方法也会更新相关的分切计划状态。
|
||||
* 套拔轴缓存位满了、没有分切计划,则触发自动创建套拔轴任务
|
||||
* update: 24/04/28 内包间只是区分气胀轴大小(即代数),不需要区分锂电/标箔
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void run() {
|
||||
// 1、获取空的插拔轴位(无任务)
|
||||
List<BstIvtShafttubeivt> emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2","0","0");
|
||||
emptyPoints.forEach(empty -> {
|
||||
// 标箔:1,锂电:2
|
||||
// 标箔:1,锂电:2 改:大小:4代5代
|
||||
String specification = empty.getQzz_generation();
|
||||
String location = empty.getPoint_location();
|
||||
String area;
|
||||
if (SlitterConstant.SLITTER_STANDARD_FOIL.equals(specification)) {
|
||||
if (SlitterConstant.SLITTER_AREA_UP.equals(location)) {
|
||||
area = "B2";
|
||||
} else {
|
||||
area = "B4";
|
||||
}
|
||||
} else {
|
||||
if (SlitterConstant.SLITTER_AREA_UP.equals(location)) {
|
||||
area = "B1";
|
||||
} else {
|
||||
area = "B3";
|
||||
}
|
||||
}
|
||||
// 2、获取分切计划数据,hint: 根据标箔锂电区分区域
|
||||
List<SlitterPlanDistinctDto> plans = slittingproductionplanService.getAllCutPlan(area);
|
||||
// 2、获取分切计划数据
|
||||
List<SlitterPlanDistinctDto> plans = slittingproductionplanService.getAllCutPlan();
|
||||
if (plans.size() == 0) {
|
||||
// 如果不需要套轴,就只做拔轴
|
||||
makePullShaft(empty, area);
|
||||
makePullShaft(empty, specification);
|
||||
return;
|
||||
}
|
||||
// 查看套轴对接位是否满了
|
||||
@@ -92,26 +80,35 @@ public class AutoCallAirShaftTask {
|
||||
// 如果满了就只做拔轴
|
||||
if (emptyShaftPoint.size() == 0) {
|
||||
// 如果不需要套轴,就只做拔轴
|
||||
makePullShaft(empty, area);
|
||||
makePullShaft(empty, specification);
|
||||
return;
|
||||
}
|
||||
// 获取一个分切计划的Dto。如果是6寸,可以直接使用、如果是3寸,需要判断当前位置是否满足
|
||||
SlitterPlanDistinctDto planDto = plans.stream()
|
||||
.filter(planD -> "6".equals(planD.getQzz_size()) ||
|
||||
("3".equals(planD.getQzz_size()) && specification.equals(planD.getQzz_generation())))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (planDto == null) {
|
||||
return;
|
||||
}
|
||||
// 获取一个分切计划的Dto。一根轴可能有两个分切计划
|
||||
SlitterPlanDistinctDto planDto = plans.get(0);
|
||||
// 获取分切计划dto中对应的需要套轴的分切计划 最多两个计划
|
||||
List<PdmBiSlittingproductionplan> needPlans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq(PdmBiSlittingproductionplan::getResource_name, planDto.getResource_name())
|
||||
.eq(PdmBiSlittingproductionplan::getParent_container_name, planDto.getParent_container_name())
|
||||
.eq(PdmBiSlittingproductionplan::getUp_or_down, planDto.getUp_or_down())
|
||||
.eq(PdmBiSlittingproductionplan::getSplit_group, planDto.getSplit_group())
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO)
|
||||
.eq(PdmBiSlittingproductionplan::getIs_paper_ok, SlitterConstant.SLITTER_YES));
|
||||
// 获取其中一条
|
||||
PdmBiSlittingproductionplan needPlan = needPlans.get(0);
|
||||
String qzzSize = needPlan.getQzz_size();
|
||||
// 从套轴对接位获取相同气涨轴大小 (同标箔或者锂电分开)
|
||||
List<BstIvtCutpointivt> qzzPoint = bcutpointivtService.getPointByTypeAndShaftSize("1", qzzSize, area);
|
||||
// 从套轴对接位获取相同气涨轴大小
|
||||
// update: 不需要(同标箔或者锂电分开)
|
||||
List<BstIvtCutpointivt> qzzPoint = bcutpointivtService.getPointByTypeAndShaftSize("1", qzzSize, specification);
|
||||
if (qzzPoint.size() == 0) {
|
||||
// 调用ACS滚条气涨轴下来
|
||||
toAcsOutShaft(qzzSize, specification, location, empty);
|
||||
toAcsOutShaft(qzzSize, location, empty);
|
||||
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
|
||||
saveCutPlanMessage(empty, needPlans, qzzSize);
|
||||
return;
|
||||
@@ -121,7 +118,7 @@ public class AutoCallAirShaftTask {
|
||||
if (ObjectUtil.isEmpty(startPoint)) {
|
||||
// 如果不存在,则发起信号滚气涨轴
|
||||
// 调用ACS滚条气涨轴下来
|
||||
toAcsOutShaft(qzzSize, specification, location, empty);
|
||||
toAcsOutShaft(qzzSize, location, empty);
|
||||
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
|
||||
saveCutPlanMessage(empty, needPlans, qzzSize);
|
||||
return;
|
||||
@@ -172,41 +169,36 @@ public class AutoCallAirShaftTask {
|
||||
/**
|
||||
* 获取对应的气胀轴库1
|
||||
* @param qzzSize 气涨轴尺寸
|
||||
* @param specification 标箔、锂电(1,2)
|
||||
* @param location 位置:上半部分还是下半部分
|
||||
* @param empty 套拔轴点位
|
||||
*/
|
||||
private void toAcsOutShaft(String qzzSize, String specification, String location, BstIvtShafttubeivt empty) {
|
||||
private void toAcsOutShaft(String qzzSize, String location, BstIvtShafttubeivt empty) {
|
||||
// 需要区分上下
|
||||
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize, specification, location);
|
||||
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize, empty.getPoint_code(), location);
|
||||
if (shafttubeivts.size() == 0) {
|
||||
throw new BadRequestException("气胀轴库找不到[" + qzzSize + "]规格的气涨轴");
|
||||
}
|
||||
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||
// todo: 访问acs判断有无气涨轴
|
||||
boolean flag = true;
|
||||
if (!flag) {
|
||||
// 气涨轴库没有对应的气涨轴,就到气涨轴暂存区获取
|
||||
toCreatShaftCacheTask(qzzSize, specification, location, empty);
|
||||
} else {
|
||||
JSONArray acsParam = new JSONArray();
|
||||
JSONObject acsQzz = new JSONObject();
|
||||
acsQzz.put("device_code", shafttubeivt.getPoint_code());
|
||||
acsQzz.put("code", "to_command");
|
||||
acsQzz.put("value", "1");
|
||||
acsQzz.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
acsParam.add(acsQzz);
|
||||
wmsToAcsService.action(acsParam);
|
||||
}
|
||||
JSONArray acsParam = new JSONArray();
|
||||
JSONObject acsQzz = new JSONObject();
|
||||
acsQzz.put("device_code", shafttubeivt.getPoint_code());
|
||||
acsQzz.put("code", "to_command");
|
||||
acsQzz.put("value", "1");
|
||||
acsQzz.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
acsParam.add(acsQzz);
|
||||
wmsToAcsService.action(acsParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* todo: 预留
|
||||
* 创建气涨轴缓存的桁架任务
|
||||
* @param qzzSize 气涨轴尺寸
|
||||
* @param specification 标箔、锂电(1,2)
|
||||
* @param location 位置:上半部分还是下半部分
|
||||
* @param empty 套拔轴点位
|
||||
*/
|
||||
@Deprecated
|
||||
private void toCreatShaftCacheTask(String qzzSize, String specification, String location, BstIvtShafttubeivt empty) {
|
||||
// 获取气涨轴缓存没有任务的点位
|
||||
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getNotTaskShaftCache(qzzSize, specification, location);
|
||||
@@ -270,16 +262,25 @@ public class AutoCallAirShaftTask {
|
||||
}
|
||||
|
||||
/**
|
||||
* 不需要套轴,就只做拔轴(区分标箔、锂电)
|
||||
* 不需要套轴,就只做拔轴
|
||||
* update: 不需要(区分标箔、锂电)
|
||||
* @param empty 空的插拔轴点位
|
||||
* @param area 区域
|
||||
* @param specification 代数(4、5)
|
||||
*/
|
||||
private void makePullShaft(BstIvtShafttubeivt empty, String area) {
|
||||
List<BstIvtCutpointivt> notTaskPoints = bcutpointivtService.getAreaNotTaskPointByLocationAreaAndStatus(empty.getPoint_location(), area);
|
||||
private void makePullShaft(BstIvtShafttubeivt empty, String specification) {
|
||||
List<BstIvtCutpointivt> notTaskPoints = bcutpointivtService.getAreaNotTaskPointByLocationAreaAndStatus(empty.getPoint_location());
|
||||
if (notTaskPoints.size() == 0) {
|
||||
return;
|
||||
}
|
||||
BstIvtCutpointivt cutpointivt = notTaskPoints.get(0);
|
||||
// 筛选一个满足的位置:3寸:看代数4/5;6寸直接
|
||||
BstIvtCutpointivt cutpointivt = notTaskPoints.stream()
|
||||
.filter(cut -> "6".equals(cut.getQzz_size()) ||
|
||||
("3".equals(cut.getQzz_size()) && specification.equals(cut.getQzz_generation())))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (cutpointivt == null) {
|
||||
return;
|
||||
}
|
||||
String pointCode1 = ObjectUtil.isNotEmpty(cutpointivt.getQzz_no1()) ? cutpointivt.getTruss_point_code1() : cutpointivt.getTruss_point_code2();
|
||||
String qzzNo = ObjectUtil.isNotEmpty(cutpointivt.getQzz_no1()) ? cutpointivt.getQzz_no1() : cutpointivt.getQzz_no2();
|
||||
// 获取对应的分切计划
|
||||
@@ -296,6 +297,12 @@ public class AutoCallAirShaftTask {
|
||||
param.put("point_code2", empty.getPoint_code());
|
||||
param.put("vehicle_code", qzzNo);
|
||||
param.put("qzz_no", qzzNo);
|
||||
// 当前纸管信息
|
||||
SlitterTaskUtil.putCurrentPaperSpec(param, list);
|
||||
// 套管数量
|
||||
param.put("casingCount", 0);
|
||||
// 拔管数量
|
||||
param.put("pullCount", list.size());
|
||||
// hint: 当前分切计划的气涨轴尺寸
|
||||
param.put("qzz_size", plan.getQzz_size());
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴缓存<>穿拔轴位"));
|
||||
|
||||
@@ -29,4 +29,12 @@ public class SlitterPlanDistinctDto {
|
||||
* 数量
|
||||
*/
|
||||
private String num;
|
||||
/**
|
||||
* 气胀轴尺寸
|
||||
*/
|
||||
private String qzz_size;
|
||||
/**
|
||||
* 气胀轴代数
|
||||
*/
|
||||
private String qzz_generation;
|
||||
}
|
||||
|
||||
@@ -132,6 +132,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
if (ObjectUtil.isEmpty(CBJ.getTube_code1()) && ObjectUtil.isEmpty(CBJ.getTube_code2())) {
|
||||
// 清空
|
||||
CBJ.setHave_qzz(SlitterConstant.SLITTER_NO);
|
||||
CBJ.setQzz_size("");
|
||||
TaskUtils.updateOptMessageByBShaftPoint(CBJ);
|
||||
shafttubeivtService.updateById(CBJ);
|
||||
}
|
||||
|
||||
@@ -139,10 +139,10 @@ public class SlitterTaskUtil {
|
||||
param.put("currentLeftSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
|
||||
} else {
|
||||
if (SlitterConstant.SLITTER_TYPE_PAPER.equals(plan.getPaper_tube_or_FRP())) {
|
||||
param.put("currentRight", plan.getPaper_tube_model());
|
||||
param.put("currentRight", plan.getPaper_tube_material());
|
||||
param.put("currentRightSize", plan.getPaper_tube_model().split("\\|")[2].charAt(0));
|
||||
} else {
|
||||
param.put("currentRight", plan.getFRP_model());
|
||||
param.put("currentRight", plan.getFRP_material());
|
||||
param.put("currentRightSize", plan.getFRP_model().split("\\|")[2].charAt(0));
|
||||
}
|
||||
param.put("currentLeftSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
|
||||
|
||||
@@ -6,6 +6,14 @@ import org.apache.commons.configuration.PropertiesConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 工具类
|
||||
* </p>
|
||||
*
|
||||
* @author lyd
|
||||
* @since 2023-05-03
|
||||
*/
|
||||
public class ColUtil {
|
||||
private static final Logger log = LoggerFactory.getLogger(ColUtil.class);
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.Map;
|
||||
|
||||
import static org.nl.modules.common.utils.FileUtil.SYS_TEM_DIR;
|
||||
|
||||
|
||||
/**
|
||||
* @author: lyd
|
||||
* @description: 代码生成
|
||||
@@ -101,7 +100,7 @@ public class GenUtil {
|
||||
* 定义后端文件路径以及名称
|
||||
*/
|
||||
private static String getAdminFilePath(String templateName, CodeGenConfig genConfig, String className, String rootPath) {
|
||||
String projectPath = rootPath + File.separator;
|
||||
String projectPath = rootPath + File.separator + genConfig.getModule_name() + File.separator;
|
||||
String packagePath = projectPath + "src" + File.separator + "main" + File.separator + "java" + File.separator;
|
||||
if (!ObjectUtils.isEmpty(genConfig.getPack())) {
|
||||
packagePath += genConfig.getPack().replace(".", File.separator) + File.separator;
|
||||
@@ -323,7 +322,6 @@ public class GenUtil {
|
||||
|
||||
/**
|
||||
* 打包下载
|
||||
*
|
||||
* @param columns
|
||||
* @param genConfig
|
||||
* @return
|
||||
@@ -371,7 +369,6 @@ public class GenUtil {
|
||||
|
||||
/**
|
||||
* 生成文件
|
||||
*
|
||||
* @param file
|
||||
* @param template
|
||||
* @param map
|
||||
@@ -394,7 +391,6 @@ public class GenUtil {
|
||||
|
||||
/**
|
||||
* 生成代码
|
||||
*
|
||||
* @param columnInfos
|
||||
* @param genConfig
|
||||
* @throws IOException
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
package org.nl.modules.common.utils;/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.modules.common.utils;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
@@ -96,7 +95,6 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
File file = null;
|
||||
try {
|
||||
// 用uuid作为文件名,防止生成的临时文件重复
|
||||
//file = File.createTempFile(IdUtil.simpleUUID(), prefix);
|
||||
file = new File(SYS_TEM_DIR + IdUtil.simpleUUID() + prefix);
|
||||
// MultipartFile to File
|
||||
multipartFile.transferTo(file);
|
||||
@@ -210,7 +208,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
BigExcelWriter writer = ExcelUtil.getBigWriter(file);
|
||||
// 一次性写出内容,使用默认样式,强制输出标题
|
||||
writer.write(list, true);
|
||||
SXSSFSheet sheet = (SXSSFSheet) writer.getSheet();
|
||||
SXSSFSheet sheet = (SXSSFSheet)writer.getSheet();
|
||||
//上面需要强转SXSSFSheet 不然没有trackAllColumnsForAutoSizing方法
|
||||
sheet.trackAllColumnsForAutoSizing();
|
||||
//列宽自适应
|
||||
@@ -249,7 +247,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
// 1M
|
||||
int len = 1024 * 1024;
|
||||
if (size > (maxSize * len)) {
|
||||
throw new BadRequestException("文件超出规定大小");
|
||||
throw new BadRequestException("文件超出规定大小!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@ package org.nl.system.controller.generator;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.system.service.generator.ICodeGenConfigService;
|
||||
import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -20,7 +23,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
*/
|
||||
@SaIgnore
|
||||
@RestController
|
||||
|
||||
@RequestMapping("api/genConfig")
|
||||
public class CodeGenConfigController {
|
||||
|
||||
@@ -29,14 +31,14 @@ public class CodeGenConfigController {
|
||||
|
||||
|
||||
@GetMapping(value = "/{tableName}")
|
||||
public ResponseEntity<Object> query(@PathVariable String tableName) {
|
||||
public ResponseEntity<Object> query(@PathVariable String tableName){
|
||||
return new ResponseEntity<>(genConfigService.findByTableName(tableName), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody CodeGenConfig genConfig) {
|
||||
return new ResponseEntity<>(genConfigService.update(genConfig.getTable_name(), genConfig), HttpStatus.OK);
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody CodeGenConfig genConfig){
|
||||
return new ResponseEntity<>(genConfigService.update(genConfig.getTable_name(), genConfig),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.util.List;
|
||||
@SaIgnore
|
||||
@RestController
|
||||
@RequestMapping("/api/generator")
|
||||
|
||||
public class CodeGeneratorController {
|
||||
@Autowired
|
||||
private ICodeGeneratorService generatorService;
|
||||
@@ -40,26 +39,26 @@ public class CodeGeneratorController {
|
||||
|
||||
|
||||
@GetMapping(value = "/tables")
|
||||
public ResponseEntity<Object> queryTables(@RequestParam(defaultValue = "") String name, PageQuery pageable) {
|
||||
public ResponseEntity<Object> queryTables(@RequestParam(defaultValue = "") String name, PageQuery pageable){
|
||||
return new ResponseEntity<>(TableDataInfo.build(generatorService.getTables(name, pageable)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/columns")
|
||||
public ResponseEntity<Object> queryColumns(@RequestParam String tableName) {
|
||||
public ResponseEntity<Object> queryColumns(@RequestParam String tableName){
|
||||
return new ResponseEntity<>(TableDataInfo.build(generatorService.getColumns(tableName)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
public ResponseEntity<HttpStatus> save(@RequestBody List<CodeColumnConfig> columnInfos) {
|
||||
public ResponseEntity<HttpStatus> save(@RequestBody List<CodeColumnConfig> columnInfos){
|
||||
generatorService.updateBatchById(columnInfos);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "sync")
|
||||
public ResponseEntity<HttpStatus> sync(@RequestBody List<String> tables) {
|
||||
public ResponseEntity<HttpStatus> sync(@RequestBody List<String> tables){
|
||||
for (String table : tables) {
|
||||
generatorService.sync(generatorService.getColumns(table), generatorService.query(table));
|
||||
}
|
||||
@@ -68,24 +67,20 @@ public class CodeGeneratorController {
|
||||
|
||||
|
||||
@PostMapping(value = "/{tableName}/{type}")
|
||||
public ResponseEntity<Object> generator(@PathVariable String tableName, @PathVariable Integer type, HttpServletRequest request, HttpServletResponse response) {
|
||||
if (!generatorEnabled && type == 0) {
|
||||
throw new BadRequestException("此环境不允许生成代码,请选择预览或者下载查看!");
|
||||
public ResponseEntity<Object> generator(@PathVariable String tableName, @PathVariable Integer type, HttpServletRequest request, HttpServletResponse response){
|
||||
if(!generatorEnabled && type == 0){
|
||||
throw new BadRequestException("此环境不允许生成代码,请选择预览或者下载查看");
|
||||
}
|
||||
switch (type) {
|
||||
switch (type){
|
||||
// 生成代码
|
||||
case 0:
|
||||
generatorService.generator(genConfigService.findByTableName(tableName), generatorService.getColumns(tableName));
|
||||
case 0: generatorService.generator(genConfigService.findByTableName(tableName), generatorService.getColumns(tableName));
|
||||
break;
|
||||
// 预览
|
||||
case 1:
|
||||
return generatorService.preview(genConfigService.findByTableName(tableName), generatorService.getColumns(tableName));
|
||||
case 1: return generatorService.preview(genConfigService.findByTableName(tableName), generatorService.getColumns(tableName));
|
||||
// 打包
|
||||
case 2:
|
||||
generatorService.download(genConfigService.findByTableName(tableName), generatorService.getColumns(tableName), request, response);
|
||||
case 2: generatorService.download(genConfigService.findByTableName(tableName), generatorService.getColumns(tableName), request, response);
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException("没有这个选项");
|
||||
default: throw new BadRequestException("信息为空");
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.nl.system.service.generator;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -15,7 +15,6 @@ public interface ICodeGenConfigService extends IService<CodeGenConfig> {
|
||||
|
||||
/**
|
||||
* 根据表名查找
|
||||
*
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
@@ -23,7 +22,6 @@ public interface ICodeGenConfigService extends IService<CodeGenConfig> {
|
||||
|
||||
/**
|
||||
* 根据表名更新
|
||||
*
|
||||
* @param tableName
|
||||
* @param genConfig
|
||||
* @return
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package org.nl.system.service.generator;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.system.service.generator.dao.CodeColumnConfig;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||
import org.nl.system.service.generator.dto.TablesInfo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
||||
@@ -25,16 +26,14 @@ public interface ICodeGeneratorService extends IService<CodeColumnConfig> {
|
||||
|
||||
/**
|
||||
* 获得所有的表格信息
|
||||
*
|
||||
* @param name
|
||||
* @param pageQuery
|
||||
* @return
|
||||
* @return IPage<TablesInfo>
|
||||
*/
|
||||
IPage<TablesInfo> getTables(String name, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 得到数据表的元数据
|
||||
*
|
||||
* @param tableName 表名
|
||||
* @return /
|
||||
*/
|
||||
@@ -42,7 +41,6 @@ public interface ICodeGeneratorService extends IService<CodeColumnConfig> {
|
||||
|
||||
/**
|
||||
* 根据表名查询表字段
|
||||
*
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
@@ -50,36 +48,32 @@ public interface ICodeGeneratorService extends IService<CodeColumnConfig> {
|
||||
|
||||
/**
|
||||
* 同步表数据
|
||||
*
|
||||
* @param columnInfos /
|
||||
* @param columnInfos /
|
||||
* @param columnInfoList /
|
||||
*/
|
||||
@Async
|
||||
void sync(IPage<CodeColumnConfig> columnInfos, List<CodeColumnConfig> columnInfoList);
|
||||
|
||||
/**
|
||||
* 预览代码
|
||||
*
|
||||
* 视图
|
||||
* @param byTableName
|
||||
* @param columns
|
||||
* @return
|
||||
* @return ResponseEntity<Object>
|
||||
*/
|
||||
ResponseEntity<Object> preview(CodeGenConfig byTableName, IPage<CodeColumnConfig> columns);
|
||||
|
||||
/**
|
||||
* 打包下载
|
||||
*
|
||||
* @param genConfig 配置信息
|
||||
* @param genConfig 配置信息
|
||||
* @param columnsPage 字段信息分页数据
|
||||
* @param request /
|
||||
* @param response /
|
||||
* @param request /
|
||||
* @param response /
|
||||
*/
|
||||
void download(CodeGenConfig genConfig, IPage<CodeColumnConfig> columnsPage, HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 代码生成
|
||||
*
|
||||
* @param genConfig 配置信息
|
||||
* @param genConfig 配置信息
|
||||
* @param columnsPage 字段信息分页数据
|
||||
*/
|
||||
void generator(CodeGenConfig genConfig, IPage<CodeColumnConfig> columnsPage);
|
||||
|
||||
@@ -5,12 +5,15 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nl.common.utils.GenUtil;
|
||||
import org.nl.system.service.generator.dto.ColumnInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 列的数据信息表
|
||||
@@ -72,25 +75,24 @@ public class CodeColumnConfig implements Serializable {
|
||||
|
||||
/**
|
||||
* 创建默认的实体
|
||||
*
|
||||
* @param tableName
|
||||
* @param config
|
||||
* @return
|
||||
* @param tableName /
|
||||
* @param config /
|
||||
* @return CodeColumnConfig
|
||||
*/
|
||||
public static CodeColumnConfig createDefault(String tableName, ColumnInfo config) {
|
||||
CodeColumnConfig columnConfig = new CodeColumnConfig();
|
||||
columnConfig.setColumn_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
columnConfig.setColumn_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
columnConfig.setTable_name(tableName);
|
||||
columnConfig.setColumn_name(config.getColumn_name());
|
||||
columnConfig.setColumn_type(config.getColumn_type());
|
||||
columnConfig.setKey_type(config.getKey_type());
|
||||
columnConfig.setExtra(config.getExtra());
|
||||
columnConfig.setNot_null((ObjectUtil.isNotEmpty(config.getKey_type())
|
||||
&& ObjectUtil.isNotEmpty(config.getExtra())
|
||||
&&ObjectUtil.isNotEmpty(config.getExtra())
|
||||
&& GenUtil.PK.equalsIgnoreCase(config.getKey_type())
|
||||
&& GenUtil.EXTRA.equalsIgnoreCase(config.getExtra()))
|
||||
? false : ObjectUtil.isNotEmpty(config.getNot_null()) ? config.getNot_null() : false);
|
||||
columnConfig.setRemark(ObjectUtil.isNotEmpty(config.getRemark()) ? config.getRemark() : null);
|
||||
&&GenUtil.EXTRA.equalsIgnoreCase(config.getExtra()))
|
||||
?false:ObjectUtil.isNotEmpty(config.getNot_null())?config.getNot_null():false);
|
||||
columnConfig.setRemark(ObjectUtil.isNotEmpty(config.getRemark())?config.getRemark():null);
|
||||
columnConfig.setList_show(true);
|
||||
columnConfig.setForm_show(true);
|
||||
return columnConfig;
|
||||
|
||||
@@ -2,12 +2,11 @@ package org.nl.system.service.generator.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 代码生成配置表
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.nl.system.service.generator.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.system.service.generator.dao.CodeColumnConfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.system.service.generator.dto.ColumnInfo;
|
||||
import org.nl.system.service.generator.dto.TablesInfo;
|
||||
|
||||
@@ -19,25 +19,24 @@ public interface CodeColumnConfigMapper extends BaseMapper<CodeColumnConfig> {
|
||||
|
||||
/**
|
||||
* 分页查找
|
||||
*
|
||||
* @param name 表名
|
||||
* @return 表信息
|
||||
* @param name /
|
||||
* @param pageSize /
|
||||
* @param offset /
|
||||
* @return List<TablesInfo>
|
||||
*/
|
||||
List<TablesInfo> getTables(String name, int pageSize, int offset);
|
||||
|
||||
/**
|
||||
* 分页查询的总数
|
||||
*
|
||||
* @param name 表名
|
||||
* @return 表信息
|
||||
* @param name
|
||||
* @return long
|
||||
*/
|
||||
long getTablesTotal(String name);
|
||||
|
||||
/**
|
||||
* 获取
|
||||
*
|
||||
* @param tableName 表名
|
||||
* @return 列数据
|
||||
* 获取字段名称
|
||||
* @param tableName
|
||||
* @return List<ColumnInfo>
|
||||
*/
|
||||
List<ColumnInfo> getTablesByTableName(String tableName);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.system.service.generator.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,7 +40,7 @@ public class CodeGenConfigServiceImpl extends ServiceImpl<CodeGenConfigMapper, C
|
||||
@Override
|
||||
public CodeGenConfig update(String tableName, CodeGenConfig genConfig) {
|
||||
// 如果 api 路径为空,则自动生成路径
|
||||
if (StrUtil.isEmpty(genConfig.getApi_path())) {
|
||||
if(StrUtil.isEmpty(genConfig.getApi_path())){
|
||||
String separator = File.separator;
|
||||
String[] paths;
|
||||
String symbol = "\\";
|
||||
@@ -63,7 +63,7 @@ public class CodeGenConfigServiceImpl extends ServiceImpl<CodeGenConfigMapper, C
|
||||
if (ObjectUtil.isNotEmpty(genConfig.getConfig_id())) {
|
||||
codeGenConfigMapper.updateById(genConfig);
|
||||
} else {
|
||||
genConfig.setConfig_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
genConfig.setConfig_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
codeGenConfigMapper.insert(genConfig);
|
||||
}
|
||||
return genConfig;
|
||||
|
||||
@@ -9,8 +9,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.GenUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.FileUtil;
|
||||
import org.nl.system.service.generator.ICodeGeneratorService;
|
||||
import org.nl.system.service.generator.dao.CodeColumnConfig;
|
||||
@@ -142,7 +142,7 @@ public class CodeGeneratorServiceImpl extends ServiceImpl<CodeColumnConfigMapper
|
||||
ZipUtil.zip(file.getPath(), zipPath);
|
||||
FileUtil.downloadFile(request, response, new File(zipPath), true);
|
||||
} catch (IOException e) {
|
||||
throw new BadRequestException("打包失败");
|
||||
throw new BadRequestException("系统繁忙,稍后在试");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public class CodeGeneratorServiceImpl extends ServiceImpl<CodeColumnConfigMapper
|
||||
GenUtil.generatorCode(columns, genConfig);
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BadRequestException("生成失败,请手动处理已生成的文件");
|
||||
throw new BadRequestException("系统繁忙,稍后在试");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package ${package}.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import ${package}.service.I${className}Service;
|
||||
import ${package}.service.dao.${className};
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -36,8 +36,7 @@ public class ${className}Controller {
|
||||
@PostMapping
|
||||
@Log("新增${apiAlias}")
|
||||
//@SaCheckPermission("@el.check('${changeClassName}:add')")
|
||||
public ResponseEntity
|
||||
<Object> create(@Validated @RequestBody ${className} entity){
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody ${className} entity){
|
||||
${changeClassName}Service.create(entity);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
@@ -54,7 +53,7 @@ public class ${className}Controller {
|
||||
//@SaCheckPermission("@el.check('${changeClassName}:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
${changeClassName}Service.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
${changeClassName}Service.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
package ${package}.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
<#if hasTimestamp>
|
||||
import java.sql.Timestamp;
|
||||
import java.sql.Timestamp;
|
||||
import java.sql.Timestamp;
|
||||
</#if>
|
||||
<#if hasBigDecimal>
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
</#if>
|
||||
import lombok.Data;
|
||||
import lombok.Builder;
|
||||
import java.io.Serializable;
|
||||
<#if !auto && pkColumnType = 'Long'>
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
</#if>
|
||||
|
||||
/**
|
||||
* @description /
|
||||
@@ -23,16 +30,27 @@ public class ${className}Dto implements Serializable {
|
||||
<#if columns??>
|
||||
<#list columns as column>
|
||||
|
||||
<#if column.remark != ''>
|
||||
/** ${column.remark} */
|
||||
</#if>
|
||||
<#if column.columnKey = 'PRI'>
|
||||
<#if !auto && pkColumnType = 'Long'>
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
</#if>
|
||||
</#if>
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
<#if column.remark != ''>
|
||||
/** ${column.remark} */
|
||||
</#if>
|
||||
<#if column.columnKey = 'PRI'>
|
||||
<#if !auto && pkColumnType = 'Long'>
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
</#if>
|
||||
</#if>
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
<#if column.remark != ''>
|
||||
/** ${column.remark} */
|
||||
</#if>
|
||||
<#if column.columnKey = 'PRI'>
|
||||
<#if !auto && pkColumnType = 'Long'>
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
</#if>
|
||||
</#if>
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
</#list>
|
||||
</#if>
|
||||
}
|
||||
|
||||
|
||||
@@ -1,41 +1,40 @@
|
||||
package ${package}.service.dao;
|
||||
|
||||
<#if hasPk>
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
</#if>
|
||||
import lombok.Builder;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
<#if hasTimestamp>
|
||||
import java.sql.Timestamp;
|
||||
import java.sql.Timestamp;
|
||||
</#if>
|
||||
<#if hasBigDecimal>
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
</#if>
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description 添加'@Builder'注解最好不好添加'@NoArgsConstructor'
|
||||
* @description /
|
||||
* @author ${author}
|
||||
* @date ${date}
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("${tableName}")
|
||||
public class ${className} implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
<#if columns??>
|
||||
<#list columns as column>
|
||||
<#if column.columnKey = 'PRI'>
|
||||
@TableId(value = "${column.columnName}", type = <#if auto>IdType.AUTO<#else>IdType.NONE</#if>)
|
||||
</#if>
|
||||
<#if column.remark != ''>
|
||||
<#if column.remark?has_content>
|
||||
/** ${column.remark} */
|
||||
<#else>
|
||||
/** ${column.changeColumnName} */
|
||||
|
||||
@@ -8,8 +8,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import ${package}.service.I${className}Service;
|
||||
import ${package}.service.dao.mapper.${className}Mapper;
|
||||
@@ -59,7 +60,7 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Mapper, ${c
|
||||
@Override
|
||||
public void update(${className} entity) {
|
||||
${className} dto = ${changeClassName}Mapper.selectById(entity.get${pkChangeColName ? cap_first }());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
if (dto == null) throw new BadRequestException(LangProcess.msg("error_SystemAuthError"));
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<#if queryColumns??>
|
||||
<#list queryColumns as column>
|
||||
<#if column.queryType != 'BetWeen'>
|
||||
<label class="el-form-item-label"><#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if></label>
|
||||
<el-input v-model="query.${column.changeColumnName}" clearable placeholder="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<label class="el-form-item-label"><#if column.remark?has_content>${column.remark}<#else>${column.changeColumnName}</#if></label>
|
||||
<el-input v-model="query.${column.changeColumnName}" clearable placeholder="<#if column.remark?has_content>${column.remark}<#else>${column.changeColumnName}</#if>" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
@@ -37,7 +37,7 @@
|
||||
<#if columns??>
|
||||
<#list columns as column>
|
||||
<#if column.formShow>
|
||||
<el-form-item label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>"<#if column.istNotNull> prop="${column.changeColumnName}"</#if>>
|
||||
<el-form-item label="<#if column.remark?has_content>${column.remark}<#else>${column.changeColumnName}</#if>"<#if column.istNotNull> prop="${column.changeColumnName}"</#if>>
|
||||
<#if column.formType = 'Input'>
|
||||
<el-input v-model="form.${column.changeColumnName}" style="width: 370px;" />
|
||||
<#elseif column.formType = 'Textarea'>
|
||||
@@ -80,15 +80,15 @@
|
||||
<#list columns as column>
|
||||
<#if column.columnShow>
|
||||
<#if (column.dictName)?? && (column.dictName)!="">
|
||||
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>" :min-width="flexWidth('${column.changeColumnName}',crud.data,'<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>')">
|
||||
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark?has_content>${column.remark}<#else>${column.changeColumnName}</#if>" :min-width="flexWidth('${column.changeColumnName}',crud.data,'<#if column.remark?has_content>${column.remark}<#else>${column.changeColumnName}</#if>')">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.${column.dictName}[scope.row.${column.changeColumnName}] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<#elseif column.columnType != 'Timestamp'>
|
||||
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>" :min-width="flexWidth('${column.changeColumnName}',crud.data,'<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>')"/>
|
||||
<#elseif column.columnType != 'Date'>
|
||||
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark?has_content>${column.remark}<#else>${column.changeColumnName}</#if>" :min-width="flexWidth('${column.changeColumnName}',crud.data,'<#if column.remark?has_content>${column.remark}<#else>${column.changeColumnName}</#if>')"/>
|
||||
<#else>
|
||||
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>" :min-width="flexWidth('${column.changeColumnName}',crud.data,'<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>')">
|
||||
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark?has_content>${column.remark}<#else>${column.changeColumnName}</#if>" :min-width="flexWidth('${column.changeColumnName}',crud.data,'<#if column.remark?has_content>${column.remark}<#else>${column.changeColumnName}</#if>')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.${column.changeColumnName}) }}</span>
|
||||
</template>
|
||||
@@ -152,7 +152,7 @@ export default {
|
||||
<#list isNotNullColumns as column>
|
||||
<#if column.istNotNull>
|
||||
${column.changeColumnName}: [
|
||||
{ required: true, message: '<#if column.remark != ''>${column.remark}</#if>不能为空', trigger: 'blur' }
|
||||
{ required: true, message: '<#if column.remark?has_content>${column.remark}</#if>不能为空', trigger: 'blur' }
|
||||
]<#if column_has_next>,</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
@@ -162,7 +162,7 @@ export default {
|
||||
<#if queryColumns??>
|
||||
<#list queryColumns as column>
|
||||
<#if column.queryType != 'BetWeen'>
|
||||
{ key: '${column.changeColumnName}', display_name: '<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>' }<#if column_has_next>,</#if>
|
||||
{ key: '${column.changeColumnName}', display_name: '<#if column.remark?has_content>${column.remark}<#else>${column.changeColumnName}</#if>' }<#if column_has_next>,</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
|
||||
Reference in New Issue
Block a user