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

This commit is contained in:
15856 2024-04-03 16:41:21 +08:00
commit 2b22485a41
10 changed files with 155 additions and 62 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

@ -13,6 +13,7 @@ import java.util.List;
/**
* 退料接收-app
*
* @author bns_han
*/
@RestController
@ -32,8 +33,14 @@ public class BackReceiveController extends BaseController {
@GetMapping("getbackReceiveList")
public AjaxResult getbackReceiveList(BackApplyInfo record) {
try {
if (record.getFlag() == 0) {
List<BackApplyInfo> list = backReceiveService.getbackReceiveList(record);
return success(list);
} else {
startPage();
List<BackApplyInfo> list = backReceiveService.getbackReceiveList(record);
return success(getDataTable(list));
}
} catch (Exception e) {
throw new RuntimeException(e);
}

View File

@ -51,6 +51,10 @@ public class BackApplyInfo {
* 类型名称
*/
private String typeName;
/**
* 协议号
*/
private String agreementCode;
/**
* 规格编号
*/
@ -159,4 +163,7 @@ public class BackApplyInfo {
* 退料数量
*/
private String preNum;
private String startTime;
private String endTime;
private Integer flag;
}

View File

@ -583,35 +583,69 @@
SELECT
bai.id,
bai.`code`,
bai.task_id as taskId,
bai.back_person as backPerson,
bai.task_id AS taskId,
bai.back_person AS backPerson,
bai.phone,
bpl.lot_id,
bpl.lot_name as lotName,
bui.unit_id as unitId,
bui.unit_name as unitName,
bai.back_time as backTime,
tt.task_status as taskStatus,
tta.agreement_id as agreementId,
GROUP_CONCAT(DISTINCT bad.type_id) as typeId,
bpl.lot_name AS lotName,
bui.unit_id AS unitId,
bui.unit_name AS unitName,
bai.back_time AS backTime,
bagi.agreement_code AS agreementCode,
tt.task_status AS taskStatus,
sd.`name` AS taskName,
tta.agreement_id AS agreementId,
GROUP_CONCAT( DISTINCT bad.type_id ) AS typeId,
GROUP_CONCAT( mt2.type_name, '' ) AS typeName
FROM
back_apply_info bai
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
LEFT JOIN tm_task tt on tt.task_id=bai.task_id
LEFT JOIN tm_task_agreement tta on tta.task_id=tt.task_id
LEFT JOIN bm_agreement_info bagi on bagi.agreement_id=tta.agreement_id
LEFT JOIN bm_project_lot bpl on bpl.lot_id=bagi.project_id
LEFT JOIN bm_unit_info bui on bui.unit_id=bagi.unit_id
LEFT JOIN sys_user us on us.user_id=bai.create_by
LEFT JOIN back_apply_details bad ON bad.parent_id = bai.id
LEFT JOIN tm_task tt ON tt.task_id = bai.task_id
LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bagi.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bagi.unit_id
LEFT JOIN sys_user us ON us.user_id = bai.create_by
LEFT JOIN ma_type mt1 ON mt1.type_id = bad.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
LEFT JOIN sys_dic sd ON sd.id = tt.task_status
WHERE
tt.task_status in (38,39,40)
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
ORDER BY tt.task_status asc ,bai.create_time desc
tt.task_status IN ( 37, 38, 39, 40 )
<if test="keyWord != null and keyWord != ''">
and (bai.code like concat('%', #{keyWord}, '%') or
bagi.agreement_code like concat('%', #{keyWord}, '%'))
</if>
<if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId}
</if>
<if test="lotId != null and lotId != ''">
and bpl.lot_id = #{lotId}
</if>
<if test="agreementCode != null and agreementCode != ''">
and bagi.agreement_code like concat('%', #{agreementCode}, '%')
</if>
<if test="taskStatus != null and taskStatus != ''">
and tt.task_status = #{taskStatus}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND bai.back_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
GROUP BY
bai.id,
us.user_name,
bai.phone,
bpl.lot_name,
bui.unit_name,
bagi.plan_start_time
<if test="typeId != null and typeId != ''">
HAVING
FIND_IN_SET(#{typeId}, GROUP_CONCAT(DISTINCT bad.type_id))
</if>
ORDER BY
tt.task_status ASC,
bai.create_time DESC
</select>
<select id="receiveView" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
@ -620,7 +654,8 @@
bai.task_id as taskId,
tta.agreement_id as agreementId,
mt.type_id as typeId,
mt.type_name typeCode,
mt.type_name as typeCode,
mt.unit_name as unitName,
mt2.type_name AS typeName,
IFNULL(bad.audit_num,0)-(IFNULL(aa.back_num,0)) as num,
mt.manage_type as manageType,

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

@ -84,11 +84,17 @@ public class BackApplyController extends BaseController {
*/
@ApiOperation(value = "退料申请(查看)")
@GetMapping("/getViewByApply")
public TableDataInfo getViewByApply(BackApplyInfo bean) {
public AjaxResult getViewByApply(BackApplyInfo bean) {
if (bean.getViewWeb() == 1) {
bean.setFlag(0);
List<BackApplyInfo> list = backApplyService.getViewByApply(bean);
return AjaxResult.success(list);
} else {
startPage();
bean.setFlag(0);
List<BackApplyInfo> list = backApplyService.getViewByApply(bean);
return getDataTable(list);
return AjaxResult.success(getDataTable(list));
}
}
/**

View File

@ -245,4 +245,6 @@ public class BackApplyInfo extends BaseEntity {
/** 前端条件查询所传退料时间 */
private String time;
private int viewWeb;
}

View File

@ -86,7 +86,7 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
}
} catch (Exception e) {
log.error("保存入库盘点异常:{}",e.getMessage());
// 添加事务回滚逻辑
// 添加事务回滚逻辑保证入库全部成功或者全部失败
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return AjaxResult.error(ExceptionEnum.SAVE_TO_DATABASE.getCode(), ExceptionEnum.SAVE_TO_DATABASE.getMsg());
}

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

@ -278,9 +278,9 @@
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="检验时间" label-width="130px" prop="thisCheckFixTime" v-if="!isNumCheck">
<el-form-item label="检验时间" label-width="130px" prop="thisCheckTime" v-if="!isNumCheck">
<el-date-picker
v-model="codeForm.thisCheckFixTime"
v-model="codeForm.thisCheckTime"
type="date"
placeholder="请输入检验时间"
style="width: 400px"
@ -288,9 +288,9 @@
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="下次检验时间" label-width="130px" prop="nextCheckFixTime" v-if="!isNumCheck">
<el-form-item label="下次检验时间" label-width="130px" prop="nextCheckTime" v-if="!isNumCheck">
<el-date-picker
v-model="codeForm.nextCheckFixTime"
v-model="codeForm.nextCheckTime"
type="date"
placeholder="请输入检验时间"
style="width: 13vw;"
@ -383,20 +383,20 @@
</el-select>
</template>
</el-table-column>
<el-table-column label="检验日期" align="center" prop="thisCheckFixTime" :show-overflow-tooltip="true">
<el-table-column label="检验日期" align="center" prop="thisCheckTime" :show-overflow-tooltip="true">
<template v-slot:default="{ row }" v-if="!isNumCheck">
<el-date-picker
v-model="row.thisCheckFixTime"
v-model="row.thisCheckTime"
type="date"
placeholder="请输入检验时间"
style="width: 170px"
></el-date-picker>
</template>
</el-table-column>
<el-table-column label="下次检验日期" align="center" prop="nextCheckFixTime" :show-overflow-tooltip="true">
<el-table-column label="下次检验日期" align="center" prop="nextCheckTime" :show-overflow-tooltip="true">
<template v-slot:default="{ row }" v-if="!isNumCheck">
<el-date-picker
v-model="row.nextCheckFixTime"
v-model="row.nextCheckTime"
type="date"
placeholder="请输入下次检验时间"
style="width: 170px"
@ -603,8 +603,8 @@ export default {
codeSuffixEnd: undefined,
buyPrice: undefined,
codeFactory: undefined,
thisCheckFixTime: undefined,
nextCheckFixTime: undefined,
thisCheckTime: undefined,
nextCheckTime: undefined,
pageNum: 1,
pageSize: 10,
},
@ -676,6 +676,7 @@ export default {
this.numTableList = []
this.$refs['codeForm'].clearValidate()
this.codeOpen = false;
this.getList()
},
//
reset() {
@ -701,8 +702,8 @@ export default {
codeSuffixEnd: undefined,
buyPrice: undefined,
codeFactory: undefined,
thisCheckFixTime: undefined,
nextCheckFixTime: undefined,
thisCheckTime: undefined,
nextCheckTime: undefined,
pageNum: 1,
pageSize: 10,
}
@ -741,20 +742,18 @@ export default {
const outFacCode = ''
//
const maVender = this.supplierList.find(item => item.supplierId == this.codeForm.codeFactory)?.supplier || ''
// : codeForm.thisCheckFixTime, yyyy-MM-dd
let thisCheckFixTime = new Date(this.codeForm.thisCheckFixTime).toLocaleDateString('zh-CN', {year: 'numeric', month: '2-digit', day: '2-digit'}).replace(/\//g, '-')
if (thisCheckFixTime == 'Invalid Date') thisCheckFixTime = ''
// : codeForm.nextCheckFixTime
let nextCheckFixTime = new Date(this.codeForm.nextCheckFixTime).toLocaleDateString('zh-CN', {year: 'numeric', month: '2-digit', day: '2-digit'}).replace(/\//g, '-')
if (nextCheckFixTime == 'Invalid Date') nextCheckFixTime = ''
// : codeForm.thisCheckTime
const thisCheckTime = this.codeForm.thisCheckTime
// : codeForm.nextCheckTime
const nextCheckTime = this.codeForm.nextCheckTime
// : codeForm.buyPrice
const buyPrice = this.codeForm.buyPrice || 0
this.codeTableList.push({
maCode,
outFacCode,
maVender,
thisCheckFixTime,
nextCheckFixTime,
thisCheckTime,
nextCheckTime,
buyPrice
})
}
@ -774,8 +773,8 @@ export default {
row.maCode = ''
row.outFacCode = ''
row.maVender = ''
row.thisCheckFixTime = ''
row.nextCheckFixTime = ''
row.thisCheckTime = ''
row.nextCheckTime = ''
row.buyPrice = 0
},
@ -792,6 +791,9 @@ export default {
this.codeOpen = true;
this.title = "数量盘点入库";
this.resetCodeForm()
this.$nextTick(() => {
this.$refs['codeForm'].clearValidate()
})
},
/** 新增编号盘点按钮操作 */
handleCodeAdd() {
@ -800,6 +802,9 @@ export default {
this.codeOpen = true;
this.title = "编码盘点入库";
this.resetCodeForm()
this.$nextTick(() => {
this.$refs['codeForm'].clearValidate()
})
},
//
handleSelectionChange(selection) {
@ -822,9 +827,9 @@ export default {
this.$refs['codeForm'].validate(valid => {
if (valid) {
let SavePutInfoDto = {}
console.log('🚀 ~ this.codeForm:', this.codeForm);
console.log('🚀 ~ this.codeTableList:', this.codeTableList);
console.log('🚀 ~ this.numTableList:', this.numTableList);
// console.log('🚀 ~ this.codeForm:', this.codeForm);
// console.log('🚀 ~ this.numTableList:', this.numTableList);
// console.log('🚀 ~ this.codeTableList:', this.codeTableList);
if (this.isNumCheck) {
//
SavePutInfoDto = {
@ -844,6 +849,19 @@ export default {
this.getList()
})
} else {
// yyyy-MM-dd
this.codeTableList.forEach(item => {
if (item.thisCheckTime) {
item.thisCheckTime = new Date(item.thisCheckTime).toLocaleDateString('zh-CN', {year: 'numeric', month: '2-digit', day: '2-digit'}).replace(/\//g, '-')
} else {
item.thisCheckTime = ''
}
if (item.nextCheckTime) {
item.nextCheckTime = new Date(item.nextCheckTime).toLocaleDateString('zh-CN', {year: 'numeric', month: '2-digit', day: '2-digit'}).replace(/\//g, '-')
} else {
item.nextCheckTime = ''
}
})
//
SavePutInfoDto = {
isCode: true, //