相关配套文件
This commit is contained in:
parent
2e6c4d6a32
commit
12bb2ed637
|
|
@ -6,8 +6,11 @@ import com.bonus.common.core.utils.ServletUtils;
|
|||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.basic.domain.BmFileInfo;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.part.domain.*;
|
||||
import com.bonus.material.part.mapper.PartArrivedMapper;
|
||||
|
|
@ -150,4 +153,13 @@ public class partArrivedController extends BaseController {
|
|||
return toAjax(partArrivedService.deletePartInfo(partTypeQueryDto));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询附件列表")
|
||||
// @RequiresPermissions("basic:file:manage")
|
||||
@GetMapping("/getPartFilelist")
|
||||
public AjaxResult getPartFilelist(BmPartFileInfo bmPartFileInfo)
|
||||
{
|
||||
List<BmPartFileInfo> list = partArrivedService.getPartFilelist(bmPartFileInfo);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
package com.bonus.material.part.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
对象 bm_file_info
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-10
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class BmPartFileDetail extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 任务类型, 参考数据字典 tm_task_type */
|
||||
@Excel(name = "任务类型")
|
||||
@ApiModelProperty(value = "任务类型")
|
||||
private Integer taskType;
|
||||
|
||||
/** 任务id */
|
||||
@Excel(name = "任务id")
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private Long taskId;
|
||||
|
||||
/** 模块id */
|
||||
@Excel(name = "模块id")
|
||||
@ApiModelProperty(value = "模块id")
|
||||
private Long modelId;
|
||||
|
||||
/** 文件名称 */
|
||||
@Excel(name = "文件名称")
|
||||
@ApiModelProperty(value = "文件名称")
|
||||
private String name;
|
||||
|
||||
/** 文件路径 */
|
||||
@Excel(name = "文件路径")
|
||||
@ApiModelProperty(value = "文件路径")
|
||||
private String url;
|
||||
|
||||
/** 文件类型, 参考数据字典 bm_file_type */
|
||||
@Excel(name = "文件类型")
|
||||
@ApiModelProperty(value = "文件类型")
|
||||
private Long fileType;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.bonus.material.part.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
对象 bm_file_info
|
||||
*
|
||||
* @author hongchao
|
||||
* @date 2025-01-10
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class BmPartFileInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 任务类型, 参考数据字典 tm_task_type */
|
||||
@Excel(name = "任务类型")
|
||||
@ApiModelProperty(value = "任务类型")
|
||||
private Integer taskType;
|
||||
|
||||
/** 任务id */
|
||||
@Excel(name = "任务id")
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private Long taskId;
|
||||
|
||||
/** 模块id */
|
||||
@Excel(name = "模块id")
|
||||
@ApiModelProperty(value = "模块id")
|
||||
private Long modelId;
|
||||
|
||||
|
||||
/** 文件类型, 参考数据字典 bm_file_type */
|
||||
@Excel(name = "文件类型")
|
||||
@ApiModelProperty(value = "文件类型")
|
||||
private Long fileType;
|
||||
|
||||
@ApiModelProperty(value = "文件列表")
|
||||
private List<BmPartFileDetail> fileDetailList;
|
||||
}
|
||||
|
|
@ -1,10 +1,7 @@
|
|||
package com.bonus.material.part.mapper;
|
||||
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.part.domain.PartTypeCheckDetails;
|
||||
import com.bonus.material.part.domain.PartTypeCheckInfo;
|
||||
import com.bonus.material.part.domain.PartTypeDto;
|
||||
import com.bonus.material.part.domain.PartTypeQueryDto;
|
||||
import com.bonus.material.part.domain.*;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseQueryDto;
|
||||
|
|
@ -82,6 +79,8 @@ public interface PartArrivedMapper
|
|||
|
||||
int deletePartTypeCheckDetailsByParentIds(Long taskId);
|
||||
|
||||
int deleteByParentIds(Long taskId);
|
||||
|
||||
int deleteTmTask(Long taskId);
|
||||
|
||||
/**
|
||||
|
|
@ -92,4 +91,22 @@ public interface PartArrivedMapper
|
|||
*/
|
||||
int deletePartTypCheckInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询附件列表
|
||||
*
|
||||
* @param bmPartFileInfo 查询附件列表
|
||||
* @return 查询附件列表
|
||||
*/
|
||||
List<BmPartFileInfo> getPartFilelist(BmPartFileInfo bmPartFileInfo);
|
||||
|
||||
/**
|
||||
* 查询附件列表详情
|
||||
*
|
||||
* @param bmPartFileInfo 查询附件列表详情
|
||||
* @return 查询附件列表详情
|
||||
*/
|
||||
List<BmPartFileDetail> getPartFileDetail(BmPartFileInfo bmPartFileInfo);
|
||||
|
||||
//删除附件文件相关任务文件
|
||||
int deleteBmFileList(Long taskId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package com.bonus.material.part.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.part.domain.PartTypeCheckDto;
|
||||
import com.bonus.material.part.domain.PartTypeCheckInfo;
|
||||
import com.bonus.material.part.domain.PartTypeDto;
|
||||
import com.bonus.material.part.domain.PartTypeQueryDto;
|
||||
import com.bonus.material.part.domain.*;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseCheckDto;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseQueryDto;
|
||||
|
|
@ -67,4 +64,12 @@ public interface IPartArrivedService {
|
|||
* @return 结果
|
||||
*/
|
||||
int deletePartInfo(PartTypeQueryDto partTypeQueryDto);
|
||||
|
||||
/**
|
||||
* 查询附件列表
|
||||
*
|
||||
* @param bmPartFileInfo 查询附件列表
|
||||
* @return 查询附件列表
|
||||
*/
|
||||
List<BmPartFileInfo> getPartFilelist(BmPartFileInfo bmPartFileInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,10 +224,33 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
|||
if(null != partTypeCheckInfo){
|
||||
List<PartTypeCheckDetails> partTypeCheckDetailsList = partArrivedMapper.selectPartTypeCheckDetailsListByQueryDto(partTypeQueryDto);
|
||||
PartTypeCheckDto.setPartTypeCheckDetailsList(partTypeCheckDetailsList);
|
||||
//查询是否存在附件,给前端用于文件颜色判断
|
||||
extractedExitFile(partTypeCheckDetailsList);
|
||||
}
|
||||
return PartTypeCheckDto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询是否存在附件,给前端用于文件颜色判断
|
||||
* @param partTypeCheckDetailsList
|
||||
*/
|
||||
private void extractedExitFile(List<PartTypeCheckDetails> partTypeCheckDetailsList) {
|
||||
if (!CollectionUtils.isEmpty(partTypeCheckDetailsList)) {
|
||||
for (PartTypeCheckDetails partTypeCheckDetails : partTypeCheckDetailsList) {
|
||||
final BmFileInfo fileInfo = new BmFileInfo();
|
||||
fileInfo.setTaskType(13);
|
||||
fileInfo.setModelId(partTypeCheckDetails.getPartId());
|
||||
fileInfo.setTaskId(partTypeCheckDetails.getTaskId());
|
||||
final List<BmFileInfo> bmFileInfoList = bmFileInfoMapper.selectBmFileInfoList(fileInfo);
|
||||
if (!CollectionUtils.isEmpty(bmFileInfoList)) {
|
||||
partTypeCheckDetails.setIsExitFile(0);
|
||||
}else {
|
||||
partTypeCheckDetails.setIsExitFile(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改新购验收任务
|
||||
*
|
||||
|
|
@ -239,6 +262,7 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
|||
public boolean updatePartTypeCheckInfo(PartTypeCheckDto partTypeCheckDto) {
|
||||
partTypeCheckDto.getPartTypeCheckInfo().setUpdateTime(DateUtils.getNowDate());
|
||||
partTypeCheckDto.getPartTypeCheckInfo().setUpdateBy(SecurityUtils.getUsername());
|
||||
partArrivedMapper.deleteBmFileList(partTypeCheckDto.getPartTypeCheckInfo().getTaskId());
|
||||
if (!CollectionUtils.isEmpty(partTypeCheckDto.getPartTypeCheckDetailsList())) {
|
||||
partTypeCheckDto.getPartTypeCheckDetailsList().removeIf(Objects::isNull);
|
||||
partTypeCheckDto.getPartTypeCheckDetailsList().removeIf(o -> Objects.isNull(o.getStatus()));
|
||||
|
|
@ -275,7 +299,24 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
|||
if(count==0){
|
||||
AjaxResult.error("删除失败");
|
||||
}
|
||||
partArrivedMapper.deletePartTypeCheckDetailsByParentIds(partTypeQueryDto.getTaskId());
|
||||
partArrivedMapper.deleteByParentIds(partTypeQueryDto.getTaskId());
|
||||
return partArrivedMapper.deletePartTypCheckInfoById(partTypeQueryDto.getId());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询附件列表
|
||||
*
|
||||
* @param bmPartFileInfo 查询附件列表
|
||||
* @return 查询附件列表
|
||||
*/
|
||||
@Override
|
||||
public List<BmPartFileInfo> getPartFilelist(BmPartFileInfo bmPartFileInfo) {
|
||||
List<BmPartFileInfo> list = partArrivedMapper.getPartFilelist(bmPartFileInfo);
|
||||
for (BmPartFileInfo listEach : list) {
|
||||
List<BmPartFileDetail> fileDetailList = partArrivedMapper.getPartFileDetail(listEach);
|
||||
listEach.setFileDetailList(fileDetailList);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,6 +146,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_part_type mpt2 on mpt.parent_id = mpt2.pa_id and mpt2.del_flag = 0
|
||||
left join ma_part_type mpt3 on mpt2.parent_id = mpt3.pa_id and mpt3.del_flag = 0
|
||||
where ppd.task_id = #{taskId} and ppd.del_flag = 0
|
||||
<if test="partId != null">
|
||||
and ppd.part_id = #{partId}
|
||||
</if>
|
||||
<if test="productionTime != null">
|
||||
and date_format(ppd.production_time,'%y%m%d') = date_format(#{productionTime},'%y%m%d')
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectPartTypeCheckInfoById" resultType="com.bonus.material.part.domain.PartTypeCheckInfo">
|
||||
select
|
||||
|
|
@ -161,6 +167,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
delete from purchase_part_details ppd where task_id = #{taskId} and ppd.status = 0
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="deleteByParentIds" parameterType="Long">
|
||||
delete from purchase_part_details ppd where task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTmTask" parameterType="Long">
|
||||
delete from tm_task where task_id = #{taskId}
|
||||
</delete>
|
||||
|
|
@ -168,4 +179,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<delete id="deletePartTypCheckInfoById" parameterType="Long">
|
||||
delete from purchase_part_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getPartFilelist" resultType="com.bonus.material.part.domain.BmPartFileInfo">
|
||||
select
|
||||
distinct task_type as taskType,task_id as taskId,model_id as modelId, file_type as fileType
|
||||
from bm_file_info bfi
|
||||
where task_type = #{taskType} and task_id = #{taskId} and model_id = #{modelId}
|
||||
</select>
|
||||
|
||||
<select id="getPartFileDetail" resultType="com.bonus.material.part.domain.BmPartFileDetail">
|
||||
select
|
||||
id,task_type as taskType,task_id as taskId,model_id as modelId, file_type as fileType,name,url
|
||||
from bm_file_info bfi
|
||||
where task_type = #{taskType} and task_id = #{taskId} and model_id = #{modelId} and file_type = #{fileType}
|
||||
</select>
|
||||
|
||||
<delete id="deleteBmFileList" parameterType="Long">
|
||||
delete from bm_file_info bfi where task_id = #{taskId} and task_type = 13
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue