This commit is contained in:
parent
000d3502fb
commit
ce9c84fb93
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.common.biz.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -40,11 +41,14 @@ public class TreeSelect implements Serializable {
|
|||
/** 子节点数量 */
|
||||
private Integer number;
|
||||
|
||||
@ApiModelProperty(value = "是否录入编码(0:否,1:是)")
|
||||
private String isEnter;
|
||||
|
||||
public TreeSelect() {
|
||||
|
||||
}
|
||||
|
||||
public TreeSelect(Long id, String label, Long houseId, Integer level, Long parentId, List<TreeSelect> children, Integer number) {
|
||||
public TreeSelect(Long id, String label, Long houseId, Integer level, Long parentId, List<TreeSelect> children, Integer number, String isEnter) {
|
||||
this.id = id;
|
||||
this.label = label;
|
||||
this.houseId = houseId;
|
||||
|
|
@ -52,6 +56,7 @@ public class TreeSelect implements Serializable {
|
|||
this.parentId = parentId;
|
||||
this.children = children;
|
||||
this.number = number;
|
||||
this.isEnter = isEnter;
|
||||
}
|
||||
|
||||
public TreeSelect(Long id, String label, Integer level, Long parentId) {
|
||||
|
|
|
|||
|
|
@ -76,8 +76,7 @@ public class WsMaInfoServiceImpl implements WsMaInfoService {
|
|||
public AjaxResult save(WsMaInfo info) {
|
||||
try {
|
||||
int i = mapper.existsByModelAndCode(info.getMaModel(), info.getMaCode());
|
||||
if (ObjectUtils.isNotEmpty(i)) {
|
||||
mapper.updateCheckTime(i);
|
||||
if (i > 0) {
|
||||
return AjaxResult.error("该机具规格与编码已存在,请勿重复添加!");
|
||||
}
|
||||
int result = mapper.insert(info);
|
||||
|
|
@ -101,6 +100,10 @@ public class WsMaInfoServiceImpl implements WsMaInfoService {
|
|||
if (info.getId() == null) {
|
||||
return AjaxResult.error("ID不能为空");
|
||||
}
|
||||
int i = mapper.existsByModelAndCode(info.getMaModel(), info.getMaCode());
|
||||
if (i > 1) {
|
||||
return AjaxResult.error("该机具规格与编码已存在,请勿重复添加!");
|
||||
}
|
||||
int result = mapper.update(info);
|
||||
return result > 0
|
||||
? AjaxResult.success("更新成功")
|
||||
|
|
|
|||
|
|
@ -234,4 +234,7 @@ public class Type extends BaseEntity {
|
|||
@ApiModelProperty(value = "不含税单价")
|
||||
private BigDecimal notTaxPrice;
|
||||
|
||||
@ApiModelProperty(value = "是否录入编码(0:否,1:是)")
|
||||
private String isEnter;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,6 +302,6 @@ public class StandardConfigManageServiceImpl implements StandardConfigManageServ
|
|||
.filter(Objects::nonNull)
|
||||
.map(this::convertToTreeSelect)
|
||||
.collect(Collectors.toList());
|
||||
return new TreeSelect(type.getId(), type.getConfigName(), null, Integer.valueOf(type.getLevel()), type.getParentId(), children, null);
|
||||
return new TreeSelect(type.getId(), type.getConfigName(), null, Integer.valueOf(type.getLevel()), type.getParentId(), children, null, null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -647,7 +647,7 @@ public class TypeServiceImpl implements ITypeService {
|
|||
.filter(Objects::nonNull)
|
||||
.map(this::convertToTreeSelect)
|
||||
.collect(Collectors.toList());
|
||||
return new TreeSelect(type.getTypeId(), type.getTypeName(), type.getHouseId(), Integer.valueOf(type.getLevel()),type.getParentId(), children, type.getNumber());
|
||||
return new TreeSelect(type.getTypeId(), type.getTypeName(), type.getHouseId(), Integer.valueOf(type.getLevel()),type.getParentId(), children, type.getNumber(), type.getIsEnter());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,22 @@
|
|||
</resultMap>
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT *
|
||||
SELECT id,
|
||||
ma_name,
|
||||
ma_model,
|
||||
ma_code,
|
||||
supplier,
|
||||
DATE(now()) as this_check_time,
|
||||
DATE(DATE_SUB(DATE_ADD(NOW(), INTERVAL 1 YEAR), INTERVAL 1 DAY)) as next_check_time,
|
||||
repair_man,
|
||||
check_man,
|
||||
phone,
|
||||
result,
|
||||
type,
|
||||
model_id,
|
||||
is_active,
|
||||
opt_user,
|
||||
opt_time
|
||||
FROM ws_ma_info
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
|
@ -54,11 +69,10 @@
|
|||
WHERE del_flag = '0'
|
||||
</select>
|
||||
<select id="existsByModelAndCode" resultType="java.lang.Integer">
|
||||
SELECT id
|
||||
SELECT COUNT(*)
|
||||
FROM ws_ma_info
|
||||
WHERE ma_model = #{maModel}
|
||||
AND ma_code = #{maCode}
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="selectAll" resultMap="BaseResultMap" resultType="com.bonus.material.codeCollection.domain.WsMaInfo">
|
||||
SELECT *
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="isTest" column="is_test" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="samplingRatio" column="sampling_ratio" />
|
||||
<result property="isEnter" column="is_enter" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.bonus.material.ma.domain.vo.MaTypeVo" id="MaTypeVoResult">
|
||||
|
|
@ -166,7 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
t.model_code,t.unit_id,t.unit_name,t.unit_value,t.sort_num,t.manage_type,t.lease_price,t.eff_time,
|
||||
t.rent_price,t.buy_price,t.pay_ratio,t.pay_price,t.tax_ratio,t.level,t.rated_load,t.test_load,
|
||||
t.holding_time,t.warn_num,t.create_by,t.create_time,t.update_by,t.update_time,t.is_plan,
|
||||
t.is_ancuo,t.remark,t.fac_model,t.intelligent_code,t.is_test,
|
||||
t.is_ancuo,t.remark,t.fac_model,t.intelligent_code,t.is_test,t.is_enter,
|
||||
GROUP_CONCAT(distinct su.user_name) as keeper_nick_name,
|
||||
GROUP_CONCAT(distinct su.user_id) as keeperId,
|
||||
GROUP_CONCAT(distinct su2.user_name) as repair_nick_name,
|
||||
|
|
@ -252,6 +253,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="intelligentCode != null">intelligent_code,</if>
|
||||
<if test="isTest != null">is_test,</if>
|
||||
<if test="samplingRatio != null">sampling_ratio,</if>
|
||||
<if test="isEnter != null">is_enter,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeName != null and typeName != ''">#{typeName},</if>
|
||||
|
|
@ -287,6 +289,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="intelligentCode != null">#{intelligentCode},</if>
|
||||
<if test="isTest != null">#{isTest},</if>
|
||||
<if test="samplingRatio != null">#{samplingRatio},</if>
|
||||
<if test="isEnter != null">#{isEnter},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -326,6 +329,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isTest != null">is_test = #{isTest},</if>
|
||||
<if test="samplingRatio != null">sampling_ratio = #{samplingRatio},</if>
|
||||
<if test="notTaxPrice != null">notax_price = #{notTaxPrice},</if>
|
||||
<if test="isEnter != null">is_enter = #{isEnter},</if>
|
||||
</trim>
|
||||
where type_id = #{typeId}
|
||||
</update>
|
||||
|
|
@ -348,7 +352,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectMaTypeTree" resultMap="TypeResult">
|
||||
select
|
||||
mt3.type_id, mt3.type_name, mt3.parent_id, mt3.storage_num, mt3.type_code, mt3.model_code, mt3.unit_id,
|
||||
mt3.unit_name, mt3.level, whs.house_id
|
||||
mt3.unit_name, mt3.level, whs.house_id, mt3.is_enter
|
||||
from ma_type mt3
|
||||
left join ma_type mt2 on mt2.type_id=mt3.parent_id
|
||||
left join ma_type mt1 on mt1.type_id=mt2.parent_id
|
||||
|
|
@ -359,7 +363,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
select
|
||||
mt2.type_id, mt2.type_name, mt2.parent_id, mt2.storage_num, mt2.type_code, mt2.model_code, mt2.unit_id,
|
||||
mt2.unit_name, mt2.level, whs.house_id
|
||||
mt2.unit_name, mt2.level, whs.house_id, mt2.is_enter
|
||||
from ma_type mt2
|
||||
left join ma_type mt1 on mt1.type_id=mt2.parent_id
|
||||
left join wh_house_set whs on mt1.type_id=whs.type_id
|
||||
|
|
@ -369,7 +373,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
select
|
||||
mt1.type_id, mt1.type_name, mt1.parent_id, mt1.storage_num, mt1.type_code, mt1.model_code, mt1.unit_id,
|
||||
mt1.unit_name, mt1.level, whs.house_id
|
||||
mt1.unit_name, mt1.level, whs.house_id, mt1.is_enter
|
||||
from ma_type mt1
|
||||
left join wh_house_set whs on mt1.type_id=whs.type_id
|
||||
where mt1.del_flag = 0 and mt1.level = 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue