dongke před 2 roky
rodič
revize
0825c07e73

+ 15 - 1
src/main/java/com/dk/mdm/controller/ivt/InboundController.java

@@ -6,8 +6,10 @@ import com.dk.common.response.ResponseResultVO;
 import com.dk.mdm.model.pojo.ivt.Inbound;
 import com.dk.common.service.BaseService;
 import com.dk.mdm.model.query.ivt.InboundQuery;
+import com.dk.mdm.model.query.pur.PurchaseQuery;
 import com.dk.mdm.model.response.ivt.InboundResponse;
 
+import com.dk.mdm.model.response.pur.PurchaseResponse;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -32,7 +34,19 @@ public class InboundController{
 
 
 
-
+    /**
+     * @desc   : 条件查询
+     * @author : 王英杰
+     * @date   : 2024/3/8 10:58
+     */
+    @ApiOperation(
+            value = "分页、关联、条件查询",
+            notes = "分页、关联、条件查询"
+    )
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<PurchaseResponse>> selectByCond(@RequestBody InboundQuery inboundQuery) {
+        return inboundService.selectByCond(inboundQuery);
+    }
     /**
      * @desc : 查看来源单据,总单加明细  采购退货用
      * @author : 于继渤

+ 13 - 0
src/main/java/com/dk/mdm/controller/pur/PurchaseController.java

@@ -42,6 +42,19 @@ public class PurchaseController{
         return purchaseService.selectByCond(purchaseQuery);
     }
 
+    /**
+     * @desc   : 采购订单 待入库查询
+     * @author : 王英杰
+     * @date   : 2024/2/28 9:46
+     */
+    @ApiOperation(
+            value = "分页、关联、条件查询",
+            notes = "分页、关联、条件查询"
+    )
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<PurchaseResponse>> noStoredSelectByCond(@RequestBody PurchaseQuery purchaseQuery) {
+        return purchaseService.noStoredSelectByCond(purchaseQuery);
+    }
     @ApiOperation(
             value = "新建",
             notes = "新建"

+ 1 - 1
src/main/java/com/dk/mdm/generator/Generator.java

@@ -95,7 +95,7 @@ public class Generator {
         //4、策略配置
         StrategyConfig strategy = new StrategyConfig();
         strategy.setTablePrefix("t_psi");                                             //表名前缀
-        strategy.setInclude("t_psi_outbound_item");                                        //设置要映射的表名,只需改这里即可,可以是一个数组,一次性生成多张表。
+        strategy.setInclude("t_psi_inbound");                                        //设置要映射的表名,只需改这里即可,可以是一个数组,一次性生成多张表。
         strategy.setNaming(NamingStrategy.underline_to_camel);                      //转驼峰
         strategy.setColumnNaming(NamingStrategy.underline_to_camel);                //字段下划线转驼峰
         strategy.setEntityLombokModel(true);                                        //是否使用lombok开启注解

+ 16 - 0
src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.java

@@ -4,7 +4,9 @@ import com.dk.mdm.model.pojo.ivt.Inbound;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.pojo.ivt.InboundItem;
 import com.dk.mdm.model.query.ivt.InboundQuery;
+import com.dk.mdm.model.query.pur.PurchaseQuery;
 import com.dk.mdm.model.response.mst.DictionaryDataResponse;
+import com.dk.mdm.model.response.pur.PurchaseResponse;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -33,5 +35,19 @@ public interface InboundMapper extends BaseMapper<Inbound>{
 
 
     int  updateAmount(Inbound inbound);
+
+    /**
+     * @desc   : 条件查询 (采购入库用)
+     * @author : 王英杰
+     * @date   : 2024/3/8 10:58
+     */
+    List<PurchaseResponse> selectByCond(InboundQuery inboundQuery);
+
+    /**
+     * @desc   : 条件查询个数 (采购入库用)
+     * @author : 王英杰
+     * @date   : 2024/3/8 10:58
+     */
+    Long countByCond(InboundQuery inboundQuery);
 }
 

+ 83 - 4
src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml

@@ -8,6 +8,40 @@
         into_id
         , into_no, into_type, from_id, from_no, org_id, staff_id, cus_id, sup_id, into_status, intoing_qty, intoing_amt, into_qty, into_amt, return_qty, return_amt, into_date, remarks, annex_paths, make_staff, make_time, receivable_id, payable_id, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
     </sql>
+    <sql id="Base_Column_List_tpi">
+        tpi.into_id
+        , tpi.into_no
+    , tpi.into_type
+    , tpi.from_id
+    , tpi.from_no
+    , tpi.org_id
+    , tpi.staff_id
+    , tpi.cus_id
+    , tpi.sup_id
+    , tpi.into_status
+    , tpi.intoing_qty
+    , tpi.intoing_amt
+    , tpi.into_qty
+    , tpi.into_amt
+    , tpi.return_qty
+    , tpi.return_amt
+    , tpi.into_date
+    , tpi.remarks
+    , tpi.annex_paths
+    , tpi.make_staff
+    , tpi.make_time
+    , tpi.receivable_id
+    , tpi.payable_id
+    , tpi.flg_valid
+    , tpi.cp_id
+    , tpi.op_create_time
+    , tpi.op_create_user_id
+    , tpi.op_update_time
+    , tpi.op_update_user_id
+    , tpi.op_app_code
+    , tpi.op_timestamp
+    , tpi.op_db_user
+    </sql>
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.ivt.Inbound">
@@ -45,6 +79,41 @@
         <result column="op_db_user" property="opDbUser"/>
     </resultMap>
 
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMapResponse" type="com.dk.mdm.model.response.ivt.InboundResponse">
+        <id column="into_id" property="intoId"/>
+        <result column="into_no" property="intoNo"/>
+        <result column="into_type" property="intoType"/>
+        <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
+        <result column="from_no" property="fromNo"/>
+        <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
+        <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
+        <result column="cus_id" property="cusId" typeHandler="UuidTypeHandler"/>
+        <result column="sup_id" property="supId" typeHandler="UuidTypeHandler"/>
+        <result column="into_status" property="intoStatus"/>
+        <result column="intoing_qty" property="intoingQty"/>
+        <result column="intoing_amt" property="intoingAmt"/>
+        <result column="into_qty" property="intoQty"/>
+        <result column="into_amt" property="intoAmt"/>
+        <result column="return_qty" property="returnQty"/>
+        <result column="return_amt" property="returnAmt"/>
+        <result column="into_date" property="intoDate" typeHandler="TimestampTypeHandler"/>
+        <result column="remarks" property="remarks"/>
+        <result column="annex_paths" property="annexPaths" typeHandler="JsonTypeHandler"/>
+        <result column="make_staff" property="makeStaff" typeHandler="UuidTypeHandler"/>
+        <result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
+        <result column="receivable_id" property="receivableId" typeHandler="UuidTypeHandler"/>
+        <result column="payable_id" property="payableId" typeHandler="UuidTypeHandler"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="cp_id" property="cpId"/>
+        <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
+        <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
+        <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
+        <result column="op_app_code" property="opAppCode"/>
+        <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
+        <result column="op_db_user" property="opDbUser"/>
+    </resultMap>
 
 
 
@@ -308,11 +377,21 @@
     </sql>
 
     <!-- 查询表t_psi_inbound,(条件查询+分页)列表 -->
-    <select id="selectByCond" resultMap="BaseResultMap">
+    <select id="selectByCond" resultMap="BaseResultMapResponse">
         SELECT
-        <include refid="Base_Column_List"/>
-        FROM dkic_b.t_psi_inbound
-        <include refid="Condition"/>
+        <include refid="Base_Column_List_tpi"/>,
+        tmo.org_name AS "orgName",
+        tmp.sup_name AS "supplierName",
+        tms.staff_name AS "staffName",
+        tms.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
+        <include refid="Condition_Join"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>

+ 14 - 0
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.java

@@ -38,5 +38,19 @@ public interface PurchaseMapper extends BaseMapper<Purchase>{
      */
     PurchaseResponse  selectById(@Param("purId") String purId);
 
+    /**
+     * @desc   : 采购订单 待入库查询
+     * @author : 王英杰
+     * @date   : 2024/2/28 9:46
+     */
+    List<PurchaseResponse> noStoredSelectByCond(PurchaseQuery purchaseQuery);
+
+    /**
+     * @desc   : 采购订单 待入库查询 个数
+     * @author : 王英杰
+     * @date   : 2024/2/28 9:46
+     */
+    Long noStoredCountByCond(PurchaseQuery purchaseQuery);
+
 }
 

+ 31 - 0
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.xml

@@ -458,4 +458,35 @@
         FROM dkic_b.t_psi_purchase tpp
         <include refid="Condition_1"/>
     </select>
+
+
+    <!-- 查询表dkic_b.t_psi_purchase,(条件查询+分页)列表 -->
+    <select id="noStoredSelectByCond" resultMap="BaseResultMapResponse">
+        SELECT
+        <include refid="Base_Column_List_Left_join"/>
+        ,tmo.org_name as "orgName"
+        ,tms.staff_name as "staffName"
+        ,tms1.staff_name as "makeStaffName"
+        ,tmp.sup_name as "supplierName"
+        ,tmw.wh_name as "whName"
+        FROM dkic_b.t_psi_purchase tpp
+        Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
+        Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
+        Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
+        Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
+        Left join dkic_b.t_mst_warehouse tmw on tpp.wh_id = tmw.wh_id
+        <include refid="Condition_1"/>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表dkic_b.t_psi_purchase,(条件查询)个数 -->
+    <select id="noStoredCountByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM dkic_b.t_psi_purchase tpp
+        <include refid="Condition_1"/>
+    </select>
+
 </mapper>

+ 37 - 0
src/main/java/com/dk/mdm/model/response/ivt/InboundResponse.java

@@ -321,6 +321,43 @@ public class InboundResponse extends PageInfo<InboundResponse> implements Serial
     private String opDbUser;
 
 
+    /**
+     * 组织名称
+     */
+    @Excel(name = "组织名称",width = 20, type = 10)
+    @ApiModelProperty(value = "组织名称")
+    private String orgName;
+
+    /**
+     * 员工名称
+     */
+    @Excel(name = "员工名称", width = 20, type = 10)
+    @ApiModelProperty(value = "员工名称")
+    private String staffName;
+
+    /**
+     * 员工名称
+     */
+    @Excel(name = "制单员", width = 20, type = 10)
+    @ApiModelProperty(value = "制单员")
+    private String makeStaffName;
+
+
+    /**
+     * 供应商名称
+     */
+    @Excel(name = "供应商名称")
+    @ApiModelProperty(value = "供应商名称")
+    private String supplierName;
+
+    /**
+     * 供应商名称
+     */
+    @Excel(name = "入库状态名称")
+    @ApiModelProperty(value = "入库状态名称")
+    private String intoStatusName;
+
+
     /*
      * 相关属性
      * @TableField(exist = false)

+ 11 - 0
src/main/java/com/dk/mdm/service/ivt/InboundService.java

@@ -8,7 +8,9 @@ import com.dk.mdm.mapper.ivt.InboundMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.ivt.InboundQuery;
+import com.dk.mdm.model.query.pur.PurchaseQuery;
 import com.dk.mdm.model.response.ivt.InboundResponse;
+import com.dk.mdm.model.response.pur.PurchaseResponse;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -28,6 +30,15 @@ public class InboundService extends BaseService<Inbound> {
 	private InboundMapper inboundMapper;
 
 
+	/**
+	 * @desc   : 条件查询 (采购入库用)
+	 * @author : 王英杰
+	 * @date   : 2024/3/8 10:58
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<PurchaseResponse>> selectByCond(InboundQuery inboundQuery) {
+		return super.mergeListWithCount(inboundQuery, inboundMapper.selectByCond(inboundQuery), inboundMapper.countByCond(inboundQuery));
+	}
 
 
 	/**

+ 9 - 1
src/main/java/com/dk/mdm/service/pur/PurchaseService.java

@@ -79,7 +79,15 @@ public class PurchaseService extends BaseService<Purchase> {
 	public ResponseResultVO<PageList<PurchaseResponse>> selectByCond(PurchaseQuery purchaseQuery) {
 		return super.mergeListWithCount(purchaseQuery, purchaseMapper.selectByCond(purchaseQuery), purchaseMapper.countByCond(purchaseQuery));
 	}
-
+	/**
+	 * @desc   : 采购订单 待入库查询
+	 * @author : 王英杰
+	 * @date   : 2024/2/28 9:46
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<PurchaseResponse>> noStoredSelectByCond(PurchaseQuery purchaseQuery) {
+		return super.mergeListWithCount(purchaseQuery, purchaseMapper.noStoredSelectByCond(purchaseQuery), purchaseMapper.noStoredCountByCond(purchaseQuery));
+	}
 	/**
 	 * @desc   : 新建
 	 * @author : 常皓宁