Merge branch 'dev-nx' of http://192.168.0.56:3000/bonus/devicesmgt into dev-nx

This commit is contained in:
BianLzhaoMin 2024-06-24 18:03:21 +08:00
commit 53361c7f01
5 changed files with 44 additions and 17 deletions

View File

@ -171,7 +171,7 @@ public class MaType extends BaseEntity {
/** 库管员id */
@ApiModelProperty(value = "库管员id")
private long keeperUserId;
private List<Long> keeperUserId;
/** 库管员名称 */
@ApiModelProperty(value = "库管员名称")
@ -453,11 +453,11 @@ public class MaType extends BaseEntity {
this.isAncuo = isAncuo;
}
public long getKeeperUserId() {
public List<Long> getKeeperUserId() {
return keeperUserId;
}
public void setKeeperUserId(long keeperUserId) {
public void setKeeperUserIdList(List<Long> keeperUserId) {
this.keeperUserId = keeperUserId;
}

View File

@ -81,4 +81,6 @@ public interface MaTypeMapper {
int deleteKeeperByTypeId(Long typeId);
int deletePropSetByTypeId(Long typeId);
int getMaType(MaType maType);
}

View File

@ -6,8 +6,10 @@ import com.bonus.sgzb.base.domain.vo.TreeSelect;
import com.bonus.sgzb.base.mapper.MaTypeFileMapper;
import com.bonus.sgzb.base.mapper.MaTypeMapper;
import com.bonus.sgzb.base.service.ITypeService;
import com.bonus.sgzb.common.core.exception.ServiceException;
import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.core.utils.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -53,6 +55,13 @@ public class MaTypeServiceImpl implements ITypeService {
String level = maType1.getLevel();
maType.setLevel(String.valueOf(Integer.parseInt(level) + 1));
maType.setCreateTime(DateUtils.getNowDate());
//根据类型名称判重
if (maType.getTypeName() != null && maType.getParentId() != null) {
int num = maTypeMapper.getMaType(maType);
if (num > 0) {
throw new ServiceException("机具类型名称与库中重复,请修改后重新提交!");
}
}
int i = maTypeMapper.insertType(maType);
Long typeId = maType.getTypeId();
// 图片路径保存
@ -74,10 +83,14 @@ public class MaTypeServiceImpl implements ITypeService {
typeFileMapper.insertMaTypeFile(typeFile1);
}
// 库管员配置
MaTypeKeeper typeKeeper = new MaTypeKeeper();
typeKeeper.setUserId(maType.getKeeperUserId());
typeKeeper.setTypeId(typeId);
maTypeMapper.insertKeeper(typeKeeper);
if (CollectionUtils.isNotEmpty(maType.getKeeperUserId())) {
for (Long keeperUserId : maType.getKeeperUserId()) {
MaTypeKeeper typeKeeper = new MaTypeKeeper();
typeKeeper.setUserId(keeperUserId);
typeKeeper.setTypeId(typeId);
maTypeMapper.insertKeeper(typeKeeper);
}
}
// 维修员配置
MaTypeRepair typeRepair = new MaTypeRepair();
@ -102,6 +115,13 @@ public class MaTypeServiceImpl implements ITypeService {
public int updateMaType(MaType maType) {
Long typeId = maType.getTypeId();
maType.setUpdateTime(DateUtils.getNowDate());
//根据类型名称判重
if (maType.getTypeName() != null && maType.getParentId() != null) {
int num = maTypeMapper.getMaType(maType);
if (num > 0) {
throw new ServiceException("机具类型名称与库中重复,请修改后重新提交!");
}
}
int i = maTypeMapper.updateType(maType);
// 图片路径保存
if (StringUtils.isNotEmpty(maType.getPhotoName()) && StringUtils.isNotEmpty(maType.getPhotoUrl())) {
@ -124,14 +144,15 @@ public class MaTypeServiceImpl implements ITypeService {
typeFileMapper.insertMaTypeFile(typeFile1);
}
// 库管员配置
if (maType.getKeeperUserId() >= 0L) {
if (CollectionUtils.isNotEmpty(maType.getKeeperUserId())) {
maTypeMapper.deleteKeeperByTypeId(typeId);
MaTypeKeeper typeKeeper = new MaTypeKeeper();
typeKeeper.setUserId(maType.getKeeperUserId());
typeKeeper.setTypeId(typeId);
maTypeMapper.insertKeeper(typeKeeper);
for (Long keeperUserId : maType.getKeeperUserId()) {
MaTypeKeeper typeKeeper = new MaTypeKeeper();
typeKeeper.setUserId(keeperUserId);
typeKeeper.setTypeId(typeId);
maTypeMapper.insertKeeper(typeKeeper);
}
}
// 维修员配置
if (maType.getRepairUserId() >= 0L) {
maTypeMapper.deleteTypeByTypeId(typeId);

View File

@ -280,7 +280,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select m.type_id, m.type_name, m.parent_id, m.status, m.num, m.unit_id,m.unit_name, m.manage_type,
m.lease_price, m.eff_time, m.rent_price, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load,
m.holding_time, m.warn_num, mtf.file_name photoName, mtf.file_url photoUrl,
mtf2.file_name documentName, mtf2.file_url documentUrl, mtk.user_id keeperUserId,
mtf2.file_name documentName, mtf2.file_url documentUrl, GROUP_CONCAT(mtk.user_id) keeperUserId,
GROUP_CONCAT(su.nick_name) as keeperUserName, mtr.user_id repairUserId, su1.nick_name repairUserName,mpi.prop_id as propId, mpi.prop_name as propName,
m.del_flag, m.create_by, m.create_time,
m.remark, m.company_id,m.fac_model as facModel
@ -337,8 +337,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select m.type_id, m.type_name, m.parent_id, m.status, m.num, m.unit_id, m.unit_name, m.manage_type,
m.lease_price,m.rent_price, m.eff_time, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load,
m.holding_time, m.warn_num, mtf.file_name photoName, mtf.file_url photoUrl,
mtf2.file_name documentName, mtf2.file_url documentUrl, mtk.user_id keeperUserId,
su.nick_name keeperUserName, mpi.prop_name, m.del_flag, m.create_by, m.create_time,
mtf2.file_name documentName, mtf2.file_url documentUrl, GROUP_CONCAT(mtk.user_id) keeperUserId,
GROUP_CONCAT(su.nick_name) keeperUserName, mpi.prop_name, m.del_flag, m.create_by, m.create_time,
m.remark, m.company_id,m.fac_model as facModel
from ma_type m
left join ma_prop_set mps on m.type_id = mps.type_id
@ -351,6 +351,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeName != null and typeName !=''">
AND type_name like concat('%',#{typeName},'%')
</if>
GROUP BY m.type_id
</select>
<select id="selectMaTypeTreeByLevel" resultMap="MaTypeResult" parameterType="java.lang.String">
@ -415,5 +416,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</where>
</select>
<select id="getMaType" resultType="java.lang.Integer">
select count(1) from ma_type where parent_id = #{parentId} and type_name = #{typeName}
</select>
</mapper>

View File

@ -617,7 +617,7 @@ export default {
this.queryParams.leaseApplyDetails.forEach((v) => {
this.$set(v, 'applyFor', this.queryParams.applyFor)
this.$set(v, 'updateTimes', this.queryParams.updateTimes)
if (!res.rows[0].directAuditRemark) {
if (!res.rows[0].directAuditBy) {
this.$set(v, 'taskName', this.queryParams.taskName)
} else {
this.$set(v, 'taskName', v.statusName)