质量异常统计添加审批
This commit is contained in:
parent
a3e8cffda8
commit
1a5e45fb4d
@ -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 * * ?")
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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)
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -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());//比较创建时间,不用单独填写
|
||||
|
@ -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();
|
||||
|
@ -59,4 +59,6 @@ public interface UnqualifiedNotificationService {
|
||||
void operate(UnqualifiedNotificationSaveReqVO operateReqVO);
|
||||
void operateWx(UnqualifiedNotificationSaveReqVO operateReqVO);
|
||||
PageResult<QualityStatistics> getUnqualifiedNotificationStatisticPage(UnqualifiedNotificationPageReqVO pageReqVO);
|
||||
|
||||
void review(UnqualifiedNotificationPageReqVO pageReqVO);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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 })
|
||||
}
|
||||
|
@ -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) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
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>
|
@ -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 () => {
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user