冲突合并

This commit is contained in:
BianLzhaoMin 2024-06-12 16:17:19 +08:00
commit eaaa9cdafa
6 changed files with 119 additions and 31 deletions

View File

@ -73,6 +73,11 @@ public interface InventoryAndWarehousingMapper {
*/ */
int selectTaskNumByMonth(@Param("date") Date nowDate); int selectTaskNumByMonth(@Param("date") Date nowDate);
/**
* 根据二维码code查重
* @param code
* @return
*/
int selectByCode(String code); int selectByCode(String code);
/** /**
@ -81,4 +86,11 @@ public interface InventoryAndWarehousingMapper {
* @return * @return
*/ */
List<PutInStorageBean> getDetails(PutInStorageBean bean); List<PutInStorageBean> getDetails(PutInStorageBean bean);
/**
* 根据macode查重
* @param maCode
* @return
*/
int selectByMaCode(String maCode);
} }

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.service.impl; package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.common.core.exception.ServiceException;
import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.common.security.utils.SecurityUtils;
@ -86,6 +87,15 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
} }
} }
String code = genderBackCode(); String code = genderBackCode();
List<MachIneDto> machIneDtoList = dto.getMachIneDtoList();
if (CollectionUtils.isNotEmpty(machIneDtoList)) {
for (MachIneDto machIneDto : machIneDtoList) {
int count = selectByMaCode(machIneDto.getMaCode());
if (count != 0) {
throw new ServiceException("以下设备编码与库中数据存在重复,请修改后重新提交:" + machIneDto.getMaCode());
}
}
}
int res; int res;
try { try {
//1. 判断是数量还是编号入库保存到不同表 //1. 判断是数量还是编号入库保存到不同表
@ -119,6 +129,15 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
return AjaxResult.success(res); return AjaxResult.success(res);
} }
/**
* 根据设备编码code查重
* @param maCode
* @return
*/
private int selectByMaCode(String maCode) {
return inventoryAndWarehousingMapper.selectByMaCode(maCode);
}
/** /**
* 根据入库单号查看详情 * 根据入库单号查看详情
* @param bean * @param bean
@ -153,6 +172,9 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
machIneDto.setCreator(dto.getCreator()); machIneDto.setCreator(dto.getCreator());
machIneDto.setNum(dto.getNum()); machIneDto.setNum(dto.getNum());
machIneDto.setIsCode(dto.getIsCode()); machIneDto.setIsCode(dto.getIsCode());
machIneDto.setUnitId(dto.getUnitId());
machIneDto.setProId(dto.getProId());
machIneDto.setRemarks(dto.getRemarks());
res += insertInfo(machIneDto); res += insertInfo(machIneDto);
machIneDto.setInfoId(machIneDto.getId()); machIneDto.setInfoId(machIneDto.getId());
} }
@ -164,7 +186,6 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
machIneDto.setIsCode(dto.getIsCode()); machIneDto.setIsCode(dto.getIsCode());
machIneDto.setTypeId(dto.getTypeId()); machIneDto.setTypeId(dto.getTypeId());
machIneDto.setCreator(dto.getCreator()); machIneDto.setCreator(dto.getCreator());
machIneDto.setRemarks(dto.getRemarks());
machIneDto.setPutInType(dto.getPutInType()); machIneDto.setPutInType(dto.getPutInType());
machIneDto.setNum(dto.getNum()); machIneDto.setNum(dto.getNum());
machIneDto.setCheckMan(dto.getCheckMan()); machIneDto.setCheckMan(dto.getCheckMan());
@ -234,6 +255,7 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
machIneDto.setCreator(dto.getCreator()); machIneDto.setCreator(dto.getCreator());
machIneDto.setIsCode(dto.getIsCode()); machIneDto.setIsCode(dto.getIsCode());
machIneDto.setTotalNum(total); machIneDto.setTotalNum(total);
machIneDto.setRemarks(dto.getRemarks());
res += insertInfo(machIneDto); res += insertInfo(machIneDto);
machIneDto.setInfoId(machIneDto.getId()); machIneDto.setInfoId(machIneDto.getId());
} }

View File

@ -25,7 +25,7 @@
<if test="maId != null and maId != ''"> <if test="maId != null and maId != ''">
MACHINE, MACHINE,
</if> </if>
<if test="remarks != null and remarks != ''"> <if test="remark != null and remark != ''">
REMARKS, REMARKS,
</if> </if>
<if test="maCode != null and maCode != ''"> <if test="maCode != null and maCode != ''">
@ -54,8 +54,8 @@
<if test="maId != null and maId != ''"> <if test="maId != null and maId != ''">
#{maId}, #{maId},
</if> </if>
<if test="remarks != null and remarks != ''"> <if test="remark != null and remark != ''">
#{remarks}, #{remark},
</if> </if>
<if test="maCode != null and maCode != ''"> <if test="maCode != null and maCode != ''">
#{maCode}, #{maCode},
@ -81,17 +81,8 @@
<if test="unitId != null and unitId != ''">UNIT_ID,</if> <if test="unitId != null and unitId != ''">UNIT_ID,</if>
<if test="proId != null and proId != ''">PROJECT_ID,</if> <if test="proId != null and proId != ''">PROJECT_ID,</if>
<if test="code != null and code != ''">CODE,</if> <if test="code != null and code != ''">CODE,</if>
CREATE_DATE, <if test="remarks != null and remarks != ''">REMARKS,</if>
<choose> CREATE_DATE
<when test="isCode and remarks != null and remarks != ''">
REMARKS
</when>
<otherwise>
<if test="remark != null and remark != ''">
REMARKS
</if>
</otherwise>
</choose>
</trim> </trim>
VALUES VALUES
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -110,17 +101,8 @@
<if test="unitId != null and unitId != ''">#{unitId},</if> <if test="unitId != null and unitId != ''">#{unitId},</if>
<if test="proId != null and proId != ''">#{proId},</if> <if test="proId != null and proId != ''">#{proId},</if>
<if test="code != null and code != ''">#{code},</if> <if test="code != null and code != ''">#{code},</if>
sysdate(), <if test="remarks != null and remarks != ''">#{remarks},</if>
<choose> sysdate()
<when test="isCode and remarks != null and remarks != ''">
#{remarks}
</when>
<otherwise>
<if test="remark != null and remark != ''">
#{remark}
</if>
</otherwise>
</choose>
</trim> </trim>
</insert> </insert>
<insert id="insertMachine" useGeneratedKeys="true" keyProperty="maId"> <insert id="insertMachine" useGeneratedKeys="true" keyProperty="maId">
@ -262,7 +244,8 @@
mt2.type_name as typeName, mt2.type_name as typeName,
mt.type_name as typeModelName, mt.type_name as typeModelName,
su.user_name as modelName, su.user_name as modelName,
pisi.CREATE_DATE as createDate pisi.CREATE_DATE as createDate,
pisd.REMARKS as remark
FROM ma_type_put_in_storage_info pisi FROM ma_type_put_in_storage_info pisi
LEFT JOIN ma_type_put_in_storage_details pisd on pisi.id = pisd.INFO LEFT JOIN ma_type_put_in_storage_details pisd on pisi.id = pisd.INFO
LEFT JOIN bm_project_lot lot on lot.lot_id = pisi.PROJECT_ID LEFT JOIN bm_project_lot lot on lot.lot_id = pisi.PROJECT_ID
@ -286,4 +269,11 @@
</if> </if>
order by pisi.CREATE_DATE desc order by pisi.CREATE_DATE desc
</select> </select>
<select id="selectByMaCode" resultType="java.lang.Integer">
select count(*)
from ma_machine
<where>
<if test="maCode != null ">and ma_code = #{maCode}</if>
</where>
</select>
</mapper> </mapper>

View File

@ -35,6 +35,7 @@
v-model="queryParams.unitId" v-model="queryParams.unitId"
placeholder="请选择往来单位" placeholder="请选择往来单位"
clearable clearable
filterable
> >
<el-option <el-option
v-for="(item, i) in unitList" v-for="(item, i) in unitList"
@ -49,6 +50,7 @@
v-model="queryParams.projectId" v-model="queryParams.projectId"
placeholder="请选择工程名称" placeholder="请选择工程名称"
clearable clearable
filterable
> >
<el-option <el-option
v-for="(item, i) in projectList" v-for="(item, i) in projectList"

View File

@ -16,9 +16,10 @@ export const dialogConfig = {
{ t_width: '', t_props: 'typeName', t_label: '设备类型' }, { t_width: '', t_props: 'typeName', t_label: '设备类型' },
{ t_width: '', t_props: 'typeModelName', t_label: '规格型号' }, { t_width: '', t_props: 'typeModelName', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' }, { t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_width: '', t_props: 'num', t_label: '设备数量' }, { t_width: '', t_props: 'num', t_label: '入库数量' },
{ t_width: '', t_props: 'modelName', t_label: '入库人' }, { t_width: '', t_props: 'modelName', t_label: '入库人' },
{ t_width: '', t_props: 'createDate', t_label: '入库日期' }, { t_width: '', t_props: 'createDate', t_label: '入库日期' },
{ t_width: '', t_props: 'remark', t_label: '备注' },
], ],
} }

View File

@ -334,6 +334,7 @@
type="date" type="date"
placeholder="请输入检验时间" placeholder="请输入检验时间"
style="width: 400px" style="width: 400px"
@change="changeCheckTime"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -349,6 +350,17 @@
type="date" type="date"
placeholder="请输入检验时间" placeholder="请输入检验时间"
style="width: 13vw" style="width: 13vw"
:disabled="!codeForm.thisCheckTime"
:picker-options="{
disabledDate(time) {
if (codeForm.thisCheckTime) {
let today = new Date()
today.setHours(0, 0, 0, 0)
return time.getTime() < today.getTime() || time.getTime() < new Date(codeForm.thisCheckTime).getTime()
}
return false
}
}"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -523,22 +535,25 @@
:stripe="true" :stripe="true"
> >
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column <!-- <el-table-column
label="序号" label="序号"
align="center" align="center"
width="80" width="80"
type="index" type="index"
/> /> -->
<el-table-column <el-table-column
label="设备编码"
align="center" align="center"
prop="maCode" prop="maCode"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
<template v-slot:header>
<span style="color: red;">* </span>设备编码
</template>
<template v-slot:default="{ row }" v-if="!isNumCheck"> <template v-slot:default="{ row }" v-if="!isNumCheck">
<el-input <el-input
v-model="row.maCode" v-model="row.maCode"
placeholder="请输入设备编码" placeholder="请输入设备编码"
@blur="handleMaCodeBlur(row)"
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
@ -589,6 +604,7 @@
type="date" type="date"
placeholder="请输入检验时间" placeholder="请输入检验时间"
style="width: 170px" style="width: 170px"
@change="changeCheckTimeRow(row)"
></el-date-picker> ></el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
@ -604,6 +620,17 @@
type="date" type="date"
placeholder="请输入下次检验时间" placeholder="请输入下次检验时间"
style="width: 170px" style="width: 170px"
:disabled="!row.thisCheckTime"
:picker-options="{
disabledDate(time) {
if (row.thisCheckTime) {
let today = new Date()
today.setHours(0, 0, 0, 0)
return time.getTime() < today.getTime() || time.getTime() < new Date(row.thisCheckTime).getTime()
}
return false
}
}"
></el-date-picker> ></el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
@ -950,6 +977,7 @@ export default {
dialogConfig, dialogConfig,
getInventoryWarehousingApi, getInventoryWarehousingApi,
sendParams: {}, sendParams: {},
requiredMaCode: false,
} }
}, },
created() { created() {
@ -1224,6 +1252,14 @@ export default {
this.getList() this.getList()
}) })
} else { } else {
// this.codeTableList maCode,
this.requiredMaCode = this.codeTableList.some(
(item) => !item.maCode,
)
if (this.requiredMaCode) {
this.$message.error('设备编码不能为空')
return
}
// yyyy-MM-dd // yyyy-MM-dd
this.codeTableList.forEach((item) => { this.codeTableList.forEach((item) => {
if (item.thisCheckTime) { if (item.thisCheckTime) {
@ -1492,6 +1528,28 @@ export default {
closeDialogOuter() { closeDialogOuter() {
this.dialogConfig.outerVisible = false this.dialogConfig.outerVisible = false
}, },
handleMaCodeBlur(row) {
if (!row.maCode) {
this.$message.warning('设备编码不能为空')
}
},
//
changeCheckTime() {
if (this.codeForm.nextCheckTime && this.codeForm.thisCheckTime > this.codeForm.nextCheckTime) {
this.codeForm.nextCheckTime = ''
this.$message.warning('下次检验日期不能早于检验日期!')
} else if (!this.codeForm.thisCheckTime) {
this.codeForm.nextCheckTime = ''
}
},
changeCheckTimeRow(row) {
if (row.nextCheckTime && row.thisCheckTime > row.nextCheckTime) {
row.nextCheckTime = ''
this.$message.warning('下次检验日期不能早于检验日期!')
} else if (!row.thisCheckTime) {
row.nextCheckTime = ''
}
},
}, },
} }
</script> </script>
@ -1503,4 +1561,7 @@ export default {
::v-deep.el-form-item__label { ::v-deep.el-form-item__label {
padding: 0 20px !important; padding: 0 20px !important;
} }
::v-deep .el-input-number.is-without-controls .el-input__inner {
text-align: start;
}
</style> </style>