质量异常统计添加审批

This commit is contained in:
z 2025-07-11 17:00:44 +08:00
parent a3e8cffda8
commit 1a5e45fb4d
13 changed files with 187 additions and 17 deletions

View File

@ -159,8 +159,8 @@ public class bdgzsomthingController {
//@Scheduled(cron = "0 2 0 * * ?") //每天十天执行一次
@PostConstruct
public void init() {
selectHasPrice();
selectSafeStorageAndDeliverOneYear();
// selectHasPrice();
// selectSafeStorageAndDeliverOneYear();
// bdgzsomthingService.selectds();
}
@Scheduled(cron = "0 0 2 * * ?")

View File

@ -244,8 +244,13 @@ public class UnqualifiedNotificationController {
@Operation(summary = "获得品质异常单统计分页")
@PreAuthorize("@ss.hasPermission('heli:unqualified-notification:query')")
public CommonResult<PageResult<QualityStatistics>> getUnqualifiedNotificationStatisticPage(@Valid UnqualifiedNotificationPageReqVO pageReqVO) {
PageResult<QualityStatistics> pageResult = unqualifiedNotificationService.getUnqualifiedNotificationStatisticPage(pageReqVO);
return success(pageResult);
try {
PageResult<QualityStatistics> pageResult = unqualifiedNotificationService.getUnqualifiedNotificationStatisticPage(pageReqVO);
return success(pageResult);
} catch (Exception e){
e.printStackTrace();
}
return success(null);
}
@GetMapping("/exportStatisticPage")
@Operation(summary = "导出质量异常统计 Excel")
@ -258,4 +263,10 @@ public class UnqualifiedNotificationController {
ExcelUtils.write(response, "质量异常统计.xls", "数据", QualityStatistics.class,
BeanUtils.toBean(list, QualityStatistics.class));
}
@PostMapping("/review")
@Operation(summary = "质量异常统计审核")
public CommonResult<Boolean> review(@Valid @RequestBody UnqualifiedNotificationPageReqVO pageReqVO) {
unqualifiedNotificationService.review(pageReqVO);
return success(true);
}
}

View File

@ -34,6 +34,8 @@ public class QualityStatistics {
private Integer type;
@ExcelProperty("是否合格")
private String isQua;
@ExcelProperty("异常情况描述 ")
private String remark;
@ExcelProperty("数量")
private BigDecimal amount;
@ExcelProperty("检验人")
@ -54,6 +56,10 @@ public class QualityStatistics {
@ExcelProperty("子项目编码")
private String projectSubNumber;
private Long id;
private String notificationStatus;

View File

@ -350,6 +350,11 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
.eq(TaskDispatchDetailDO::getProcedureId, processId)
.isNull(TaskDispatchDetailDO::getOwner)
);
}else {
i.or(j -> j
.eq(TaskDispatchDetailDO::getPostId, postId)
.isNull(TaskDispatchDetailDO::getOwner)
);
}
}
});

View File

@ -865,7 +865,7 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
BdgzsomthingDO.setThingname(attentiontodoRespVO.getEvent());//事件名称
BdgzsomthingDO.setAttr4("0");//是否点击
BdgzsomthingDO.setThings("计划单号:"+materialPlanBoomDO.getProjectMaterialPlanNo()+" 加工件:"+materialPlanBoomDO.getName()+",临近到货日期");//事件名称
BdgzsomthingDO.setAttr2(null);//因为不用跳转所以为null
BdgzsomthingDO.setAttr2(String.valueOf(materialPlanBoomDO.getId()));//因为不用跳转所以为null
BdgzsomthingDO.setClicktime(attentiontodoRespVO.getRemindtime());//提醒周期
BdgzsomthingDO.setTenantId(attentiontodoRespVO.getTxrid());
// BdgzsomthingDO.setShowname(LocalDateTime.now());//比较创建时间,不用单独填写

View File

@ -544,7 +544,11 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
// Set<String> procedureIds = new HashSet<>();
Map<String,Long> postIds = new HashMap<>();
for (FpUserDetailDO fpUserDetailDO : fpUserDetailDOS) {
postIds.put(fpUserDetailDO.getPostId(), fpUserDetailDO.getProcedureId());
if (ObjectUtil.isNotEmpty(fpUserDetailDO.getPostId())&&ObjectUtil.isNotEmpty(fpUserDetailDO.getProcedureId())){
postIds.put(fpUserDetailDO.getPostId(), fpUserDetailDO.getProcedureId());
}else if (ObjectUtil.isNotEmpty(fpUserDetailDO.getPostId())){
postIds.put(fpUserDetailDO.getPostId(), null);
}
}
PageResult<TaskDispatchDetailDO> taskDispatchDetailDOPageResult = taskDispatchDetailMapper.selectPageWx(pageReqVO, postIds);
List<TaskDispatchDetailDO> list = taskDispatchDetailDOPageResult.getList();

View File

@ -59,4 +59,6 @@ public interface UnqualifiedNotificationService {
void operate(UnqualifiedNotificationSaveReqVO operateReqVO);
void operateWx(UnqualifiedNotificationSaveReqVO operateReqVO);
PageResult<QualityStatistics> getUnqualifiedNotificationStatisticPage(UnqualifiedNotificationPageReqVO pageReqVO);
void review(UnqualifiedNotificationPageReqVO pageReqVO);
}

View File

@ -1,5 +1,6 @@
package com.chanko.yunxi.mes.module.heli.service.unqualifiednotification;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
@ -43,6 +44,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.INVALID_OPERATE;
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.UNQUALIFIED_NOTIFICATION_NOT_EXISTS;
@ -299,4 +301,25 @@ try {
return new PageResult<>(qualityStatistics, page.getTotal());
}
@Override
public void review(UnqualifiedNotificationPageReqVO pageReqVO) {
if ("0".equals(pageReqVO.getType())){
LambdaUpdateWrapper<BgMasterLineDO> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(BgMasterLineDO::getId, pageReqVO.getId())
.set(BgMasterLineDO::getNotificationStatus, 3)
.set(BgMasterLineDO::getAuditor, getLoginUser().getId())
.set(BgMasterLineDO::getAudit_time, LocalDateTime.now())
.set(BgMasterLineDO::getAuditOpinion, pageReqVO.getAuditOpinion());
bgMasterLineMapper.update( updateWrapper);
}else {
LambdaUpdateWrapper<ZjBgMasterLineDO> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(ZjBgMasterLineDO::getId, pageReqVO.getId())
.set(ZjBgMasterLineDO::getNotificationStatus, 3)
.set(ZjBgMasterLineDO::getAuditor, getLoginUser().getId())
.set(ZjBgMasterLineDO::getAudit_time, LocalDateTime.now())
.set(ZjBgMasterLineDO::getAuditOpinion, pageReqVO.getAuditOpinion());
zjBgMasterLineMapper.update( updateWrapper);
}
}
}

View File

@ -16,17 +16,20 @@
FROM
(
SELECT
t.id as id,
t.notification_status as notificationStatus,
t.create_time as createTime,
p.project_name AS projectName,
c.NAME AS customerName,
pg.project_sub_name AS projectSubName,
pg.bom_name AS bomName,
t.remark AS remark,
0 AS type,
CASE
WHEN t.is_qua = 1 THEN
'是'
WHEN t.is_qua = 0 THEN
'是'
WHEN t.is_qua = 1 THEN
'否' ELSE '未知'
END AS isQua,
t.amount AS amount,
@ -52,22 +55,26 @@
group by t.id
UNION ALL
SELECT
t.id as id,
t.notification_status as notificationStatus,
t.create_time as createTime,
pg.project_name AS projectName,
c.NAME AS customerName,
pg.project_sub_name AS projectSubName,
'' AS bomName,
t.remark AS remark,
1 AS type,
CASE
WHEN t.is_qua = 1 THEN
'是'
WHEN t.is_qua = 0 THEN
'是'
WHEN t.is_qua = 1 THEN
'否' ELSE '未知'
END AS isQua,
t.amount AS amount,
u1.nickname AS userName,
DATE_FORMAT(t.create_time, '%Y-%m-%d') AS testingTime,
'' AS procedureName,
u2.nickname AS auditorName,

View File

@ -57,3 +57,7 @@ export const getUnqualifiedNotificationStatisticPage = async (params) => {
export const exportStatisticPage = async (params) => {
return await request.download({ url: `/heli/unqualified-notification/exportStatisticPage`, params })
}
// 新增入/出库
export const review = async (data) => {
return await request.post({ url: `/heli/unqualified-notification/review`, data })
}

View File

@ -0,0 +1,91 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="500">
<el-form
ref="formRef"
:model="formData"
label-width="100px"
v-loading="formLoading"
>
<el-row>
<el-col :span="24">
<el-form-item label="审核意见" prop="auditOpinion">
<el-select v-model="formData.auditOpinion" placeholder="请选择">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.HELI_UNQUALIFIED_NOTIFICATION_OPINION)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as RgApi from "@/api/heli/rg";
import * as PnApi from "@/api/heli/pn";
import * as WarehouseApi from "@/api/heli/warehouse";
import * as StorageApi from '@/api/heli/storage'
import {DICT_TYPE, getStrDictOptions} from "@/utils/dict";
import * as UnqualifiedNotificationApi from "@/api/heli/unqualifiednotification";
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('审核') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
type:undefined,
auditOpinion:undefined
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (id: number, type: number) => {
dialogVisible.value = true
resetForm()
formData.value.id=id;
formData.value.type=type;
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
await UnqualifiedNotificationApi.review(formData.value)
message.success("审核成功");
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
type:undefined,
auditOpinion:undefined
}
formRef.value?.resetFields()
}
</script>

View File

@ -69,6 +69,7 @@
</el-table-column>
<el-table-column label="是否合格" align="center" prop="isQua" width="100" />
<el-table-column label="数量" align="center" prop="amount" width="100" />
<el-table-column label="异常情况描述 " align="center" prop="remark" width="200" />
<el-table-column label="检验人" align="center" prop="userName" width="100" />
<el-table-column label="检验时间" align="center" prop="testingTime" width="140" />
<el-table-column label="工序" align="center" prop="procedureName" width="140" />
@ -82,24 +83,32 @@
</el-table-column>
<el-table-column label="项目编号" align="center" prop="projectCode" width="220" />
<el-table-column label="子项目编号" align="center" prop="projectSubNumber" width="260" />
<el-table-column label="操作" align="center" fixed="right" min-width="80">
<template #header>
<span style="margin-right: 30%">操作</span>
</template>
<template #default="scope">
<el-button link type="primary" @click="review(scope.row.id,scope.row.type)" v-if="scope.row.notificationStatus!=3">
审核
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
@pagination="getList" />
</ContentWrap>
</el-card>
<from ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import * as UnqualifiedNotificationApi from '@/api/heli/unqualifiednotification'
import { useCommonStore } from "@/store/modules/common";
import {
exportStatisticPage,
getUnqualifiedNotificationStatisticPage
} from "@/api/heli/unqualifiednotification";
import download from "@/utils/download";
import from from "@/views/heli/unqualifiednotification/from.vue";
defineOptions({ name: 'UnqualifiedNotificationStatistic' })
@ -132,7 +141,8 @@ const queryParams = reactive({
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 添加/修改操作 */
const formRef = ref()
/** 查询列表 */
const getList = async () => {
loading.value = true
@ -155,6 +165,13 @@ const getDictLabel = (dictType, value) => {
const dict = intDictOptions.find(item => item.value == value)
return dict?.label || value //
}
const review = async (id,type) => {
formRef.value.open( id,type)
// message.success("")
await getList()
}
/** 导出按钮操作 */
const handleExportDetail = async () => {

View File

@ -106,7 +106,7 @@ const getHomeCategory = async () => {
e.auth = !!target;
});
}
categoryList.value = categoryList.value.filter(item => item.auth == true);
// categoryList.value = categoryList.value.filter(item => item.auth == true);
const unReadCount = await getUnreadMessage();