更新附件上传、查看的接口
This commit is contained in:
parent
55aad85480
commit
4cf98d9249
|
|
@ -11,14 +11,7 @@ import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
|||
import com.bonus.material.purchase.dto.PurchaseCheckFileDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
|
|
@ -125,10 +118,10 @@ public class PurchaseCheckDetailsController extends BaseController {
|
|||
*/
|
||||
@ApiOperation(value = "根据任务id查询报告附件")
|
||||
@RequiresPermissions("purchase:details:query")
|
||||
@GetMapping("/fileList/{taskId}")
|
||||
@GetMapping("/fileList")
|
||||
@SysLog(title = "新购验收任务明细报告查询", businessType = OperaType.QUERY, module = "物资新购->根据任务id查询物资报告附件")
|
||||
public AjaxResult getFileList(@PathVariable("taskId") Long taskId) {
|
||||
return success(purchaseCheckDetailsService.selectPurchaseCheckFileListByTaskId(taskId));
|
||||
public AjaxResult getFileList(@RequestParam("taskId") Long taskId, @RequestParam("typeId") Long typeId) {
|
||||
return success(purchaseCheckDetailsService.selectPurchaseCheckFileListByTaskId(taskId, typeId));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ public class PurchaseCheckFileDto {
|
|||
@NotBlank(message = "任务ID不能为空")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "物资类型ID")
|
||||
@NotBlank(message = "物资类型ID不能为空")
|
||||
private Long typeId;
|
||||
|
||||
@ApiModelProperty(value = "字典编码")
|
||||
@NotEmpty(message = "字典编码不能为空")
|
||||
private Integer dictCode;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.purchase.mapper;
|
|||
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
import com.bonus.material.purchase.dto.PurchaseCheckFileDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -16,8 +17,9 @@ public interface PurchaseCheckFileMapper {
|
|||
/**
|
||||
* 根据任务id查询新购验收任务详细报告列表--Join查询
|
||||
* @param taskId 任务id
|
||||
* @param typeId 规格id
|
||||
*/
|
||||
List<PurchaseCheckFileDto> selectPurchaseCheckFileListByTaskId(Long taskId);
|
||||
List<PurchaseCheckFileDto> selectPurchaseCheckFileListByTaskId(@Param("taskId") Long taskId, @Param("typeId") Long typeId);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public interface IPurchaseCheckDetailsService {
|
|||
* 根据任务ID查询报告附件列表
|
||||
* @param taskId 任务id
|
||||
*/
|
||||
List<PurchaseCheckFileDto> selectPurchaseCheckFileListByTaskId(Long taskId);
|
||||
List<PurchaseCheckFileDto> selectPurchaseCheckFileListByTaskId(Long taskId, Long typeId);
|
||||
|
||||
/**
|
||||
* 新增报告附件
|
||||
|
|
|
|||
|
|
@ -59,9 +59,9 @@ public class PurchaseCheckDetailsServiceImpl implements IPurchaseCheckDetailsSer
|
|||
* @param taskId 任务id
|
||||
*/
|
||||
@Override
|
||||
public List<PurchaseCheckFileDto> selectPurchaseCheckFileListByTaskId(Long taskId) {
|
||||
public List<PurchaseCheckFileDto> selectPurchaseCheckFileListByTaskId(Long taskId, Long typeId) {
|
||||
try {
|
||||
return purchaseCheckFileMapper.selectPurchaseCheckFileListByTaskId(taskId);
|
||||
return purchaseCheckFileMapper.selectPurchaseCheckFileListByTaskId(taskId, typeId);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("SQL执行错误:" + e.getMessage());
|
||||
}
|
||||
|
|
@ -76,8 +76,6 @@ public class PurchaseCheckDetailsServiceImpl implements IPurchaseCheckDetailsSer
|
|||
public AjaxResult insertPurchaseCheckFile(PurchaseCheckFileDto purchaseCheckFileDto) {
|
||||
try {
|
||||
if (purchaseCheckFileDto != null) {
|
||||
// TODO: 暂定魔法值,字典表为26,后续抽出定义为常量
|
||||
purchaseCheckFileDto.setModelId(26);
|
||||
purchaseCheckFileDto.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
}
|
||||
return purchaseCheckFileMapper.insertPurchaseCheckFiles(purchaseCheckFileDto) > 0 ? AjaxResult.success() : AjaxResult.error("SQL插入0条");
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM
|
||||
sys_dict_data sdd
|
||||
LEFT JOIN
|
||||
bm_file_info bfi ON bfi.dic_id = sdd.dict_code
|
||||
bm_file_info bfi ON bfi.dic_id = sdd.dict_code
|
||||
WHERE
|
||||
sdd.dict_type = 'purchase_check_report_type'
|
||||
</sql>
|
||||
|
|
@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectPurchaseCheckFileListByTaskId" parameterType="Long" resultMap="PurchaseCheckFileResult">
|
||||
<include refid="selectPurchaseCheckFileJoinVo"/>
|
||||
and bfi.task_id = #{taskId}
|
||||
and bfi.model_id = #{typeId}
|
||||
</select>
|
||||
|
||||
<insert id="insertPurchaseCheckFiles" parameterType="com.bonus.material.purchase.dto.PurchaseCheckFileDto" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
|||
Loading…
Reference in New Issue