增加新购数据查询
This commit is contained in:
parent
aab9be1388
commit
47e7bcbafe
|
|
@ -2,9 +2,12 @@ package com.bonus.sgzb.material.controller;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInputDto;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInputVo;
|
||||
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
|
|
@ -12,6 +15,7 @@ import com.bonus.sgzb.material.service.PurchaseCheckServiceCenterService;
|
|||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
|
|
@ -46,6 +50,19 @@ public class PurchaseCheckInfoController extends BaseController {
|
|||
startPage();
|
||||
return getDataTable(purchaseCheckInfoService.selectPutInListList(purchaseCheckInfo));
|
||||
}
|
||||
@ApiOperation("查询新购入库数据列表")
|
||||
@GetMapping("/getPutInList")
|
||||
public TableDataInfo getPutInList(PurchaseInputDto purchaseInputDto) {
|
||||
startPage();
|
||||
return getDataTable(purchaseCheckInfoService.getPutInList(purchaseInputDto));
|
||||
}
|
||||
@ApiOperation("导出新购入库数据列表")
|
||||
@PostMapping("/exportPutInList")
|
||||
public void exportPutInList(HttpServletResponse response, PurchaseInputDto purchaseInputDto) {
|
||||
List<PurchaseInputDto> list = purchaseCheckInfoService.getPutInList(purchaseInputDto);
|
||||
ExcelUtil<PurchaseInputDto> util = new ExcelUtil<PurchaseInputDto>(PurchaseInputDto.class);
|
||||
util.exportExcel(response, list, "新购入库数据列表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 成套机具明细查看
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新购工机具入库
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-10
|
||||
*/
|
||||
@Data
|
||||
public class PurchaseInputDto {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Long id;
|
||||
/**
|
||||
* 采购单号
|
||||
*/
|
||||
@ApiModelProperty(value = "采购单号")
|
||||
@Excel(name = "采购单号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
@Excel(name = "数量")
|
||||
private String checkNum;
|
||||
|
||||
@ApiModelProperty(value = "采购日期")
|
||||
@Excel(name = "采购日期")
|
||||
private String purchaseTime;
|
||||
|
||||
@ApiModelProperty(value = "入库日期")
|
||||
@Excel(name = "入库日期")
|
||||
private String inputTime;
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
@Excel(name = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
@Excel(name = "规格型号")
|
||||
private String typeModelName;
|
||||
|
||||
@ApiModelProperty(value = "采购人")
|
||||
@Excel(name = "采购人")
|
||||
private String purchaser;
|
||||
|
||||
@ApiModelProperty(value = "入库人")
|
||||
@Excel(name = "入库人")
|
||||
private String inputUser;
|
||||
|
||||
private String keyWord;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
private String startTime1;
|
||||
private String endTime1;
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.bonus.sgzb.base.api.domain.MachinePart;
|
|||
import com.bonus.sgzb.material.domain.BmNoticeInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInputDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -138,4 +139,6 @@ public interface PurchaseCheckInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
int deletePurchaseMacodeInfoByTaskId(String code);
|
||||
|
||||
List<PurchaseInputDto> getPutInList(PurchaseInputDto purchaseInputDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.sgzb.material.service;
|
|||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInputDto;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInputVo;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
|
||||
|
|
@ -10,11 +11,11 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 新购验收任务purchase_check_infoService接口
|
||||
*
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-10
|
||||
*/
|
||||
public interface IPurchaseCheckInfoService
|
||||
public interface IPurchaseCheckInfoService
|
||||
{
|
||||
/**
|
||||
* 查询新购验收任务purchase_check_info
|
||||
|
|
@ -26,7 +27,7 @@ public interface IPurchaseCheckInfoService
|
|||
|
||||
/**
|
||||
* 查询新购验收任务purchase_check_info列表
|
||||
*
|
||||
*
|
||||
* @param purchaseCheckInfo 新购验收任务purchase_check_info
|
||||
* @return 新购验收任务purchase_check_info集合
|
||||
*/
|
||||
|
|
@ -34,7 +35,7 @@ public interface IPurchaseCheckInfoService
|
|||
|
||||
/**
|
||||
* 新增新购验收任务purchase_check_info
|
||||
*
|
||||
*
|
||||
* @param purchaseCheckInfo 新购验收任务purchase_check_info
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -50,7 +51,7 @@ public interface IPurchaseCheckInfoService
|
|||
|
||||
/**
|
||||
* 批量删除新购验收任务purchase_check_info
|
||||
*
|
||||
*
|
||||
* @param taskIds 需要删除的新购验收任务purchase_check_info主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -58,7 +59,7 @@ public interface IPurchaseCheckInfoService
|
|||
|
||||
/**
|
||||
* 删除新购验收任务purchase_check_info信息
|
||||
*
|
||||
*
|
||||
* @param taskId 新购验收任务purchase_check_info主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -110,4 +111,6 @@ public interface IPurchaseCheckInfoService
|
|||
List<PurchaseCheckInfo> selectPutInListExamine(PurchaseCheckInfo purchaseCheckInfo);
|
||||
|
||||
List<MachinePart> getWholeSetDetails(PurchaseCheckInfo purchaseCheckInfo);
|
||||
|
||||
List<PurchaseInputDto> getPutInList(PurchaseInputDto purchaseInputDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,6 +171,11 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
return purchaseCheckInfoMapper.getWholeSetDetails(purchaseCheckInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PurchaseInputDto> getPutInList(PurchaseInputDto purchaseInputDto) {
|
||||
return purchaseCheckInfoMapper.getPutInList(purchaseInputDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询新购验收任务列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper">
|
||||
|
||||
|
||||
<resultMap type="com.bonus.sgzb.material.domain.PurchaseCheckInfo" id="PurchaseCheckInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
|
|
@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP BY pcd.task_id
|
||||
order by pci.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectPurchaseCheckInfoByTaskId" parameterType="Long" resultMap="PurchaseCheckInfoResult">
|
||||
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time,
|
||||
pci.update_by, pci.update_time, pci.remark, pci.company_id, tk.code
|
||||
|
|
@ -65,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join tm_task tk on pci.task_id = tk.task_id
|
||||
where pci.task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertPurchaseCheckInfo" parameterType="com.bonus.sgzb.material.domain.PurchaseCheckInfo" useGeneratedKeys="true" keyProperty="taskId">
|
||||
insert into purchase_check_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -115,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deletePurchaseCheckInfoByTaskIds" parameterType="String">
|
||||
delete from purchase_check_info where task_id in
|
||||
delete from purchase_check_info where task_id in
|
||||
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
|
|
@ -385,4 +385,44 @@ WHERE ma_machine.ma_code =
|
|||
WHERE
|
||||
task_id=#{taskId}
|
||||
</select>
|
||||
</mapper>
|
||||
<select id="getPutInList" resultType="com.bonus.sgzb.material.domain.PurchaseInputDto">
|
||||
SELECT
|
||||
pcd.check_num checkNum,
|
||||
pci.purchase_time purchaseTime,
|
||||
tk.update_time inputTime,
|
||||
mt.type_name typeName,
|
||||
mt1.type_name typeModelName,
|
||||
tk.CODE as code,
|
||||
su.nick_name purchaser,
|
||||
us.nick_name inputUser
|
||||
FROM
|
||||
purchase_check_details pcd
|
||||
LEFT JOIN purchase_check_info pci ON pcd.task_id = pci.task_id
|
||||
LEFT JOIN ma_type mt ON pcd.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN ma_supplier_info msi ON pcd.supplier_id = msi.supplier_id
|
||||
LEFT JOIN tm_task tk ON pcd.task_id = tk.task_id
|
||||
left join sys_user su on pci.purchaser = su.user_id
|
||||
LEFT JOIN sys_user us on us.user_id = tk.update_by
|
||||
WHERE
|
||||
tk.task_type = 23
|
||||
AND tk.task_status = 28
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
mt.type_name LIKE CONCAT('%', #{keyWord}, '%')
|
||||
OR mt1.type_name LIKE CONCAT('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
and tk.code like concat('%', #{code}, '%')
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
and pci.purchase_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||
</if>
|
||||
<if test="startTime1 != null and startTime1 != '' and endTime1 != null and endTime1 != ''">
|
||||
and tk.update_time BETWEEN CONCAT(#{startTime1}, ' 00:00:00') AND CONCAT(#{endTime1}, ' 23:59:59')
|
||||
</if>
|
||||
ORDER BY
|
||||
pci.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue