koushanshan 2 лет назад
Родитель
Сommit
161d1a8446

+ 26 - 9
src/main/java/com/dk/mdm/controller/ivt/InboundOtherController.java

@@ -1,21 +1,27 @@
 package com.dk.mdm.controller.ivt;
 
 
+import com.dk.common.infrastructure.annotaiton.Pagination;
 import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
 import com.dk.common.service.BaseService;
 import com.dk.mdm.model.pojo.ivt.Inbound;
 import com.dk.mdm.model.query.ivt.InboundQuery;
+import com.dk.mdm.model.query.sale.OutReturnItemQuery;
 import com.dk.mdm.model.response.ivt.InboundResponse;
+import com.dk.mdm.model.response.sale.OutReturnItemResponse;
 import com.dk.mdm.model.vo.ivt.InboundVO;
 import com.dk.mdm.service.ivt.InboundOtherService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-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 javax.validation.Valid;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 
 @Api(tags = "其他入库单API接口")
@@ -39,11 +45,22 @@ public class InboundOtherController {
      * @author : 寇珊珊
      */
     @ApiOperation(value = "条件查询", notes = "条件查询")
-    @PostMapping({"select_inbound_and_item"})
-    public ResponseResultVO<PageList<InboundResponse>> selectInboundAndItem(@RequestBody InboundQuery inboundQuery) {
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<InboundResponse>> selectInboundAndItem(@Valid @RequestBody InboundQuery inboundQuery) {
         return inboundOtherService.selectInboundAndItem(inboundQuery);
     }
 
+    /**
+     * @desc   : 查询明细信息
+     * @date   : 2024/3/9 15:45
+     * @author : 寇珊珊
+     */
+    @ApiOperation(value = "明细信息条件查询", notes = "明细信息条件查询")
+    @PostMapping({"select_other_inbound_item_info_by_id/{id}"})
+    public ResponseResultVO<Map<String, Object>> selectOtherInboundItemInfoById(@PathVariable String id) {
+        return inboundOtherService.selectOtherInboundItemInfoById(id);
+    }
+
 
     /**
      * @desc   : 其他入库新建
@@ -55,7 +72,7 @@ public class InboundOtherController {
             notes = "其他入库新建"
     )
     @PostMapping({"other_inbound_insert"})
-    public ResponseResultVO<?> otherInboundInsert(@RequestBody InboundVO inboundVO) {
+    public ResponseResultVO<?> otherInboundInsert(@Valid @RequestBody InboundVO inboundVO) {
         return inboundOtherService.otherInboundInsert(inboundVO);
     }
 
@@ -70,7 +87,7 @@ public class InboundOtherController {
             notes = "其他入库办理"
     )
     @PostMapping({"other_handle_inbound"})
-    public ResponseResultVO<?> otherHandleInbound(@RequestBody InboundVO inboundVO) {
+    public ResponseResultVO<?> otherHandleInbound(@Valid @RequestBody InboundVO inboundVO) {
         return inboundOtherService.otherHandleInbound(inboundVO);
     }
 
@@ -86,7 +103,7 @@ public class InboundOtherController {
             notes = "其它入库撤销"
     )
     @PostMapping({"other_inbound_cancel"})
-    public ResponseResultVO<?> otherInboundCancel(@RequestBody InboundVO inboundVO) {
+    public ResponseResultVO<?> otherInboundCancel(@Valid @RequestBody InboundVO inboundVO) {
         return inboundOtherService.otherInboundCancel(inboundVO);
     }
 

+ 1 - 1
src/main/java/com/dk/mdm/mapper/ivt/InboundItemMapper.xml

@@ -85,7 +85,7 @@
     <sql id="Condition">
         <where>
             <if test="intoId != null and intoId != ''">
-                AND tpii.into_id = #{intoId}
+                AND tpii.into_id = #{intoId}::uuid
             </if>
             <if test="intoType != null and intoType != ''">
                 AND tpii.into_type = #{intoType}

+ 37 - 10
src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml

@@ -197,9 +197,6 @@
             <if test="supId != null and supId != ''">
                 AND tpi.sup_id = #{supId}::uuid
             </if>
-            <if test="intoDate != null">
-                AND tpi.into_date = #{intoDate}
-            </if>
             <if test="makeStaff != null and makeStaff != ''">
                 AND tpi.make_staff = #{makeStaff}
             </if>
@@ -218,7 +215,26 @@
             <if test="cpId != null">
                 AND tpi.cp_id = #{cpId}
             </if>
-
+            <if test="cusPhone != null and cusPhone != ''">
+                AND tmc.cus_phone LIKE concat('%',my_ex.likequery(#{cusPhone}),'%')
+            </if>
+            <if test="cusName != null and cusName != ''">
+                AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
+            </if>
+            <if test="orgIdList != null and orgIdList.size() > 0">
+                AND tmo.org_id  =any(#{orgIdList, typeHandler=uuidListTypeHandler})
+            </if>
+            <if test="staffIdList != null and staffIdList.size() > 0">
+                AND tms.staff_id  =any(#{staffIdList, typeHandler=uuidListTypeHandler})
+            </if>
+            <if test="intoDateStart != null and intoDateEnd != null">
+                AND tpi.make_time &gt;= #{intoDateStart}::timestamp with time zone
+                AND tpi.make_time &lt; #{intoDateEnd}::timestamp with time zone + interval '1 day'
+            </if>
+            <if test="intoStatusList != null and intoStatusList.size()>0">
+                AND tpi.into_status =
+                any(#{intoStatusList, typeHandler= StringListTypeHandler})
+            </if>
         </where>
     </sql>
 
@@ -239,14 +255,13 @@
         tms.staff_name AS "staffName",
         tms.staff_name AS "makeStaffName",
         tmw.wh_name as "whName",
+        tmc.cus_name                                      as "cusName",
+        tmc.cus_phone                                     as "cusPhone",
+        tmc.cus_from                                      as "cusFrom",
+        makestaff.staff_name                              as "makeStaffName",
         sys.f_get_name_i18n(tdk.kind_name_i18n, 'zh_CN') AS  "intoStatusName"
         FROM dkic_b.t_psi_inbound tpi
-        Left join dkic_b.t_mst_org tmo on tmo.org_id = tpi.org_id
-        Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = tpi.sup_id
-        Left join dkic_b.t_mst_staff tms on tms.staff_id = tpi.staff_id
-        Left join dkic_b.t_mst_staff tms1 on tms1.staff_id = tpi.make_staff
-        LEFT JOIN sys.t_data_kind tdk   ON tdk.kind_code = tpi.into_status
-        Left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
+        <include refid="Join_Table"/>
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -258,9 +273,21 @@
         SELECT
         count(1)
         FROM dkic_b.t_psi_inbound
+        <include refid="Join_Table"/>
         <include refid="Condition"/>
     </select>
 
+    <sql id="Join_Table">
+        Left join dkic_b.t_mst_org tmo on tmo.org_id = tpi.org_id
+        Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = tpi.sup_id
+        Left join dkic_b.t_mst_staff tms on tms.staff_id = tpi.staff_id
+        Left join dkic_b.t_mst_staff makestaff on makestaff.staff_id = tpi.make_staff
+        LEFT JOIN sys.t_data_kind tdk   ON tdk.kind_code = tpi.into_status
+        Left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
+        left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
+    </sql>
+
+
     <!-- 根据主键查询表t_psi_inbound的一行数据 -->
     <select id="selectById" resultMap="BaseResultMapResponse">
         SELECT

+ 24 - 138
src/main/java/com/dk/mdm/model/query/ivt/InboundQuery.java

@@ -24,6 +24,7 @@ import java.io.Serializable;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.util.List;
 
 /**
  *  入库单
@@ -128,53 +129,6 @@ public class InboundQuery extends PageInfo<InboundQuery> implements Serializable
     private String intoStatus;
 
 
-    /**
-     * 入库中数量
-     */
-    @Excel(name = "入库中数量")
-    @ApiModelProperty(value = "入库中数量")
-    private BigDecimal intoingQty;
-
-
-    /**
-     * 入库中金额
-     */
-    @Excel(name = "入库中金额")
-    @ApiModelProperty(value = "入库中金额")
-    private BigDecimal intoingAmt;
-
-
-    /**
-     * 已入库数量
-     */
-    @Excel(name = "已入库数量")
-    @ApiModelProperty(value = "已入库数量")
-    private BigDecimal intoQty;
-
-
-    /**
-     * 已入库金额
-     */
-    @Excel(name = "已入库金额")
-    @ApiModelProperty(value = "已入库金额")
-    private BigDecimal intoAmt;
-
-
-    /**
-     * 已入库退货数量
-     */
-    @Excel(name = "已入库退货数量")
-    @ApiModelProperty(value = "已入库退货数量")
-    private BigDecimal returnQty;
-
-
-    /**
-     * 已入库退货金额
-     */
-    @Excel(name = "已入库退货金额")
-    @ApiModelProperty(value = "已入库退货金额")
-    private BigDecimal returnAmt;
-
 
     /**
      * 入库日期
@@ -187,23 +141,6 @@ public class InboundQuery extends PageInfo<InboundQuery> implements Serializable
 
 
     /**
-     * 备注
-     */
-    @Excel(name = "备注")
-    @ApiModelProperty(value = "备注")
-    private String remarks;
-
-
-    /**
-     * 附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
-     */
-    @Excel(name = "附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
-    @ApiModelProperty(value = "附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
-    @TableField(typeHandler = JsonTypeHandler.class)
-    private JSONObject annexPaths;
-
-
-    /**
      * 制单员
      */
     @Excel(name = "制单员")
@@ -222,23 +159,6 @@ public class InboundQuery extends PageInfo<InboundQuery> implements Serializable
     private LocalDateTime makeTime;
 
 
-    /**
-     * 应收款单
-     */
-    @Excel(name = "应收款单")
-    @ApiModelProperty(value = "应收款单")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String receivableId;
-
-
-    /**
-     * 应付款单
-     */
-    @Excel(name = "应付款单")
-    @ApiModelProperty(value = "应付款单")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String payableId;
-
 
     /**
      * 有效标识 (1:正常 0:停用)
@@ -256,79 +176,45 @@ public class InboundQuery extends PageInfo<InboundQuery> implements Serializable
     private Integer cpId;
 
 
-    /**
-     * 创建时间 (触发器自动处理)
-     */
-    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
-    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opCreateTime;
 
 
-    /**
-     * 创建用户 (触发器自动处理)
-     */
-    @Excel(name = "创建用户 (触发器自动处理)")
-    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String opCreateUserId;
 
+    /*
+     * 相关属性
+     * @TableField(exist = false)
+     */
 
-    /**
-     * 修改时间 (触发器自动处理)
+    /*
+     * 关联属性 + 查询条件
+     * @TableField(exist = false)
      */
-    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
-    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opUpdateTime;
 
 
-    /**
-     * 修改用户 (触发器自动处理)
-     */
-    @Excel(name = "修改用户 (触发器自动处理)")
-    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String opUpdateUserId;
+    @ApiModelProperty(value = "客户电话")
+    private String cusPhone;
 
+    @ApiModelProperty(value = "客户名称")
+    private String cusName;
 
-    /**
-     * 数据操作应用 (触发器自动处理)
-     */
-    @Excel(name = "数据操作应用 (触发器自动处理)")
-    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
-    private String opAppCode;
+    @ApiModelProperty(value = "部门List")
+    private List<String> orgIdList;
 
+    @ApiModelProperty(value = "业务员List")
+    private List<String> staffIdList;
 
-    /**
-     * 数据时间戳 (触发器自动处理)
-     */
-    @Excel(name = "数据时间戳 (触发器自动处理)")
-    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opTimestamp;
+    @ApiModelProperty(value = "入库状态List")
+    private List<String> intoStatusList;
 
 
-    /**
-     * 数据操作数据库用户 (触发器自动处理)
-     */
-    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
-    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
-    private String opDbUser;
+    @ApiModelProperty(value = "入库时间开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate intoDateStart;
 
+    @ApiModelProperty(value = "入库时间结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate intoDateEnd;
 
-    /*
-     * 相关属性
-     * @TableField(exist = false)
-     */
 
-    /*
-     * 关联属性 + 查询条件
-     * @TableField(exist = false)
-     */
 
 
     private static final long serialVersionUID = 1L;

+ 20 - 0
src/main/java/com/dk/mdm/service/ivt/InboundOtherService.java

@@ -16,8 +16,10 @@ import com.dk.mdm.model.pojo.ivt.Inbound;
 import com.dk.mdm.model.pojo.ivt.InboundItem;
 import com.dk.mdm.model.query.ivt.InboundItemQuery;
 import com.dk.mdm.model.query.ivt.InboundQuery;
+import com.dk.mdm.model.query.sale.OutReturnItemQuery;
 import com.dk.mdm.model.response.ivt.InboundItemResponse;
 import com.dk.mdm.model.response.ivt.InboundResponse;
+import com.dk.mdm.model.response.sale.OutReturnItemResponse;
 import com.dk.mdm.model.vo.ivt.InboundItemVO;
 import com.dk.mdm.model.vo.ivt.InboundVO;
 import com.dk.mdm.service.common.CommonService;
@@ -26,6 +28,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -71,6 +74,23 @@ public class InboundOtherService extends BaseService<Inbound> {
 				inboundMapper.selectInboundAndItemCountByCond(inboundQuery));
 	}
 
+	/**
+	 * @desc   : 查询明细
+	 * @date   : 2024/3/9 15:43
+	 * @author : 寇珊珊
+	 */
+	@Pagination
+	public ResponseResultVO<Map<String, Object>> selectOtherInboundItemInfoById(String id) {
+		Map<String, Object> result = new HashMap<>();
+		// 商品明细
+		List<InboundItemResponse> inboundItemResponses = inboundItemMapper.selectByCond(new InboundItemQuery().setIntoId(id));
+		result.put("itemList", inboundItemResponses);
+		// 收款
+
+		// 附件
+		return ResponseResultUtil.success(result);
+	}
+
 
 	/**
 	 * @desc   : 其他入库新建