Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
liang.chao 2024-04-03 14:08:29 +08:00
commit 8592abb9b4
8 changed files with 103 additions and 114 deletions

View File

@ -203,6 +203,12 @@ public class MaType extends BaseEntity {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<MaType> children = new ArrayList<>();
/**
* 厂家规格型号
*/
@ApiModelProperty(value = "厂家规格型号")
private String facModel;
public Long getTypeId() {
@ -550,4 +556,12 @@ public class MaType extends BaseEntity {
public void setFinalPrice(String finalPrice) {
this.finalPrice = finalPrice;
}
public String getFacModel() {
return facModel;
}
public void setFacModel(String facModel) {
this.facModel = facModel;
}
}

View File

@ -69,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isPlan != null">is_plan,</if>
<if test="isAncuo != null">is_ancuo,</if>
<if test="remark != null">remark,</if>
<if test="facModel != null">fac_model,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeName != null and typeName != ''">#{typeName},</if>
@ -98,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isPlan != null">#{isPlan},</if>
<if test="isAncuo != null">#{isAncuo},</if>
<if test="remark != null">#{remark},</if>
<if test="facModel != null">#{facModel},</if>
</trim>
</insert>
@ -154,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isAncuo != null">is_ancuo = #{isAncuo},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="companyId != null">company_id = #{companyId},</if>
<if test="facModel != null">fac_model = #{facModel},</if>
</trim>
where type_id = #{typeId}
</update>
@ -273,13 +276,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<select id="selectMaTypeByTypeId" resultMap="MaTypeResult">
select m.type_id, m.type_name, m.parent_id, m.status, m.num, m.unit_id, m.manage_type,
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,
su.nick_name keeperUserName, mtr.user_id repairUserId, su1.nick_name repairUserName, mpi.prop_name,
su.nick_name 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.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
left join ma_prop_info mpi on mps.prop_id = mpi.prop_id
@ -334,7 +337,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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,
m.remark, m.company_id
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
left join ma_prop_info mpi on mps.prop_id = mpi.prop_id

View File

@ -60,13 +60,11 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
}
}
}
int res = 0;
int res;
try {
//1. 判断是数量还是编号入库保存到不同表
//1.1 如果是编号入库
if (dto.getIsCode()) {
/*插入ma_machinema_machine_label和ma_label_bind以及
ma_type_put_in_storage_info表和ma_type_put_in_storage_details表*/
res = insertMaMachineInfo(dto, codeList);
if (res == 0) {
log.error("insertMaMachineInfo方法插入异常");
@ -87,11 +85,9 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
}
}
} catch (Exception e) {
log.error(e.getMessage());
log.error("保存入库盘点异常:{}",e.getMessage());
// 添加事务回滚逻辑
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
if (res == 0) {
return AjaxResult.error(ExceptionEnum.SAVE_TO_DATABASE.getCode(), ExceptionEnum.SAVE_TO_DATABASE.getMsg());
}
return AjaxResult.success(res);
@ -113,7 +109,7 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
* @return
*/
private int insertMaMachineInfo(SavePutInfoDto dto, List<String> codeList) {
int num = 0;
int res = 0;
for (int i = 0; i < dto.getMachIneDtoList().size(); i++) {
MachIneDto machIneDto = dto.getMachIneDtoList().get(i);
String code = codeList.get(i);
@ -125,21 +121,22 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
machIneDto.setPutInType(dto.getPutInType());
machIneDto.setNum(dto.getNum());
machIneDto.setCheckMan(dto.getCheckMan());
num = inventoryAndWarehousingMapper.insertMachine(machIneDto);
if (num == 0) {
throw new RuntimeException("新增到ma_machine表失败");
}
num = inventoryAndWarehousingMapper.insertMachineLabel(machIneDto);
if (num == 0) {
throw new RuntimeException("新增到ma_machine_label表失败");
}
num = inventoryAndWarehousingMapper.insertLabelBind(machIneDto);
if (num == 0) {
throw new RuntimeException("新增到ma_label_bind表失败");
}
num = getAnInt(machIneDto);
res += insertMachineInfo(machIneDto);
}
return num;
return res;
}
/**
* 方法抽取保持到ma_machinema_machine_label和ma_label_bind
* @param machIneDto
* @return
*/
private int insertMachineInfo(MachIneDto machIneDto) {
int res = inventoryAndWarehousingMapper.insertMachine(machIneDto);
res += inventoryAndWarehousingMapper.insertMachineLabel(machIneDto);
res += inventoryAndWarehousingMapper.insertLabelBind(machIneDto);
res += insertTypePutInStorageInfo(machIneDto);
return res;
}
/**
@ -147,19 +144,12 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
* @param machIneDto
* @return
*/
private int getAnInt(MachIneDto machIneDto) {
int num;
private int insertTypePutInStorageInfo(MachIneDto machIneDto) {
//插入ma_type_put_in_storage_info表,返回主键id
num = inventoryAndWarehousingMapper.saveInfo(machIneDto);
if (num == 0) {
throw new RuntimeException("新增到ma_type_put_in_storage_info表失败");
}
int res = inventoryAndWarehousingMapper.saveInfo(machIneDto);
//ma_type_put_in_storage_details表
num = inventoryAndWarehousingMapper.saveDetails(machIneDto);
if (num == 0) {
throw new RuntimeException("新增到ma_type_put_in_storage_details表失败");
}
return num;
res += inventoryAndWarehousingMapper.saveDetails(machIneDto);
return res;
}
@ -180,16 +170,16 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
* @return
*/
private int insertPutInfo(SavePutInfoDto dto) {
int num = 0;
int res = 0;
for (int i = 0; i < dto.getMachIneDtoList().size(); i++) {
MachIneDto machIneDto = dto.getMachIneDtoList().get(i);
machIneDto.setCreator(dto.getCreator());
machIneDto.setPutInType(dto.getPutInType());
machIneDto.setRemarks(dto.getRemarks());
getAnInt(machIneDto);
res += insertTypePutInStorageInfo(machIneDto);
//根据类型追加ma_type表里面的num
num = updateMaTypeInfo(machIneDto.getTypeId(), machIneDto.getPutInStoreNum());
res += updateMaTypeInfo(machIneDto.getTypeId(), machIneDto.getPutInStoreNum());
}
return num;
return res;
}
}

View File

@ -85,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY mt.type_id) AS subquery4 ON subquery4.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
WHERE mt.`level` = 4
and mt.del_flag = '0'
<if test="typeName != null and typeName != ''">
and mt2.type_name like concat('%',#{typeName},'%')
</if>

View File

@ -14,6 +14,6 @@ var testUrl = '192.168.0.14:21626' //线上
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
//API调用地址
API_ROOT: '"http://' + testUrl + '"',
BASE_URL: '/cockpit-screen/'
// API_ROOT: '"http://' + testUrl + '"',
// BASE_URL: '/cockpit-screen/'
})

View File

@ -20,7 +20,7 @@ module.exports = {
cssSourceMap: true,
proxyTable: {
'/screen': {
target: 'http://112.29.103.165:21626',
target: 'http://112.29.103.165:21624',
changeOrigin: true,
// secure: true, //如果是https接口需要配置这个参数
pathRewrite: {

View File

@ -75,43 +75,30 @@
<el-table v-loading="loading" :data="typeList" height="600" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center"/>
<el-table-column label="名称" align="center" key="typeName" prop="typeName" />
<el-table-column label="计量单位" align="center" key="unitName" prop="unitName"
:show-overflow-tooltip="true"/>
<el-table-column label="内部租赁价" align="center" key="leasePrice" prop="leasePrice"
:show-overflow-tooltip="true"/>
<el-table-column label="原值" align="center" key="buyPrice" prop="buyPrice"
:show-overflow-tooltip="true"/>
<el-table-column label="丢失赔偿" align="center" key="payPrice" prop="payPrice"
width="120"/>
<el-table-column label="库管员" align="center" key="keeperUserName" prop="keeperUserName"
:show-overflow-tooltip="true"/>
<el-table-column label="管理模式" align="center" key="manageType" prop="manageType"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.manageType=='0'">编码管理</span>
<span v-if="scope.row.manageType=='1'">数量管理</span>
</template>
</el-table-column>
<el-table-column label="图片" align="center" key="photoName" prop="photoName"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<span @click="openImg(scope.row.photoUrl)" style="color: #02A7F0;"> {{ scope.row.photoName }} </span>
</template>
</el-table-column>
<el-table-column label="文档资料" align="center" key="documentName" prop="documentName"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<a :href="uploadUrl+scope.row.documentUrl" style="color: #02A7F0;" :download="scope.row.documentName">{{ scope.row.documentName }}</a>
</template>
</el-table-column>
<el-table-column label="资产属性" align="center" key="propName" prop="propName"
:show-overflow-tooltip="true"/>
<el-table-column label="备注信息" align="center" key="remark" prop="remark"
:show-overflow-tooltip="true"/>
<el-table-column label="计量单位" align="center" key="unitName" prop="unitName" :show-overflow-tooltip="true"/>
<el-table-column label="内部租赁价" align="center" key="leasePrice" prop="leasePrice" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="原值" align="center" key="buyPrice" prop="buyPrice" :show-overflow-tooltip="true"/>
<el-table-column label="丢失赔偿" align="center" key="payPrice" prop="payPrice" :show-overflow-tooltip="true"/>
<el-table-column label="库管员" align="center" key="keeperUserName" prop="keeperUserName" :show-overflow-tooltip="true"/>
<el-table-column label="管理模式" align="center" key="manageType" prop="manageType" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.manageType=='0'">编码管理</span>
<span v-if="scope.row.manageType=='1'">数量管理</span>
</template>
</el-table-column>
<el-table-column label="图片" align="center" key="photoName" prop="photoName" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span @click="openImg(scope.row.photoUrl)" style="color: #02A7F0;"> {{ scope.row.photoName }} </span>
</template>
</el-table-column>
<el-table-column label="文档资料" align="center" key="documentName" prop="documentName" :show-overflow-tooltip="true">
<template slot-scope="scope">
<a :href="uploadUrl+scope.row.documentUrl" style="color: #02A7F0;" :download="scope.row.documentName">{{ scope.row.documentName }}</a>
</template>
</el-table-column>
<el-table-column label="资产属性" align="center" key="propName" prop="propName" :show-overflow-tooltip="true"/>
<el-table-column label="厂家规格型号" align="center" key="facModel" prop="facModel" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="备注信息" align="center" key="remark" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column
label="操作"
@ -250,6 +237,18 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="厂家规格型号" prop="facModel">
<el-input v-model="form.facModel" placeholder="请输入厂家规格型号" maxlength="100"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注内容" maxlength="150"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="文档资料" prop="field101">
@ -285,13 +284,7 @@
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注内容" maxlength="150"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>

View File

@ -187,7 +187,7 @@
placeholder="请选择物品类型"
:options="deviceTypeTree"
:props="deviceTypeTreeProps"
v-model="deviceType"
v-model="codeForm.typeId"
@change="deviceTypeChange"
ref="deviceTypeCascader"
style="width: 400px;"
@ -206,7 +206,6 @@
:max="99"
:controls="false"
style="width: 13vw;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -221,7 +220,6 @@
placeholder="请输入前缀"
clearable
style="width: 220px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
@ -233,7 +231,6 @@
clearable
placeholder="请输入后缀范围"
style="width: 185px"
@keyup.enter.native="handleQuery"
@input="changeInput(codeForm.codeSuffixStart)"
/>
</el-form-item>
@ -243,7 +240,6 @@
clearable
placeholder="请输入后缀范围"
style="width: 185px"
@keyup.enter.native="handleQuery"
@input="changeInput(codeForm.codeSuffixEnd)"
/>
</el-form-item>
@ -258,7 +254,6 @@
:min="0"
:controls="false"
style="width: 13vw;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
@ -289,8 +284,7 @@
type="date"
placeholder="请输入检验时间"
style="width: 400px"
@keyup.enter.native="handleQuery">
</el-date-picker>
/>
</el-form-item>
</el-col>
<el-col :span="7">
@ -300,7 +294,6 @@
type="date"
placeholder="请输入检验时间"
style="width: 13vw;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
@ -323,7 +316,6 @@
rows="4"
show-word-limit
:style="{ width: isNumCheck ? '220px' : '400px' }"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
@ -398,7 +390,6 @@
type="date"
placeholder="请输入检验时间"
style="width: 170px"
@keyup.enter.native="handleQuery"
></el-date-picker>
</template>
</el-table-column>
@ -409,7 +400,6 @@
type="date"
placeholder="请输入下次检验时间"
style="width: 170px"
@keyup.enter.native="handleQuery"
></el-date-picker>
</template>
</el-table-column>
@ -423,7 +413,6 @@
:controls="false"
clearable
style="width: 160px"
@keyup.enter.native="handleQuery"
/>
</template>
</el-table-column>
@ -630,10 +619,10 @@ export default {
},
codeFormRules: {
putInType: [
{ required: true, message: "入库来源不能为空", trigger: "blur" }
{ required: true, message: "入库来源不能为空", trigger: "change" }
],
typeId: [
{ required: true, message: "设备/物资类型不能为空", trigger: "blur" }
{ required: true, message: "设备/物资类型不能为空", trigger: "change" }
],
num: [
{ required: true, message: "待入库总数不能为空", trigger: "blur" }
@ -679,7 +668,6 @@ export default {
},
//
cancelCode() {
this.codeOpen = false;
this.cascaderDisabled = false
this.resetCodeForm();
this.deviceType = {}
@ -687,7 +675,7 @@ export default {
this.codeTableList = []
this.numTableList = []
this.$refs['codeForm'].clearValidate()
this.isNumCheck = false;
this.codeOpen = false;
},
//
reset() {
@ -704,9 +692,9 @@ export default {
resetCodeForm() {
this.codeForm = {
checkMan: undefined,
putInType: undefined,
putInType: null,
remarks: undefined,
typeId: undefined,
typeId: null,
num: undefined,
codePrefix: undefined,
codeSuffixStart: undefined,
@ -803,6 +791,7 @@ export default {
this.reset();
this.codeOpen = true;
this.title = "数量盘点入库";
this.resetCodeForm()
},
/** 新增编号盘点按钮操作 */
handleCodeAdd() {
@ -810,6 +799,7 @@ export default {
this.reset();
this.codeOpen = true;
this.title = "编码盘点入库";
this.resetCodeForm()
},
//
handleSelectionChange(selection) {
@ -847,12 +837,11 @@ export default {
//
inputByCode(SavePutInfoDto).then(response => {
this.$message.success('入库成功')
this.codeOpen = false
this.getList()
this.resetCodeForm()
this.reset()
this.numTableList = []
this.deviceType = {}
this.codeOpen = false
this.reset()
this.getList()
})
} else {
//
@ -875,12 +864,11 @@ export default {
//
inputByCode(SavePutInfoDto).then(response => {
this.$message.success('入库成功')
this.codeOpen = false
this.getList()
this.resetCodeForm()
this.reset()
this.codeTableList = []
this.deviceType = {}
this.codeOpen = false
this.reset()
this.getList()
})
}
}