Преглед изворни кода

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

于继渤 пре 2 година
родитељ
комит
325f9fa526

+ 15 - 4
src/main/java/com/dk/mdm/controller/common/CommonController.java

@@ -1400,9 +1400,9 @@ public class CommonController extends BaseController<Map<String, Object>> {
     }
 
     /**
-     * @desc   : 获取供应商
+     * @desc : 获取供应商
      * @author : 常皓宁
-     * @date   : 2024/3/1 9:19
+     * @date : 2024/3/1 9:19
      */
     @ApiOperation(
             value = "获取供应商",
@@ -1414,9 +1414,9 @@ public class CommonController extends BaseController<Map<String, Object>> {
     }
 
     /**
-     * @desc   : 获取供应商分页
+     * @desc : 获取供应商分页
      * @author : 常皓宁
-     * @date   : 2024/3/1 9:19
+     * @date : 2024/3/1 9:19
      */
     @ApiOperation(
             value = "获取供应商(分页)",
@@ -1426,6 +1426,17 @@ public class CommonController extends BaseController<Map<String, Object>> {
     public ResponseResultVO<PageList<Map<String, Object>>> getSupplierByPage(@RequestBody Map<String, Object> param) {
         return commonService.getSupplierByPage(param);
     }
+
+    /**
+     * @desc : 获取渠道
+     * @author : 付斌
+     * @date : 2024-03-02 10:18
+     */
+    @ApiOperation(value = "获取渠道", notes = "获取渠道")
+    @PostMapping({"get_channel"})
+    public ResponseResultVO<List<Map<String, Object>>> getChannel(@RequestBody Map<String, Object> param) {
+        return commonService.getChannel(param);
+    }
 }
 
 

+ 7 - 0
src/main/java/com/dk/mdm/mapper/common/CommonMapper.java

@@ -973,4 +973,11 @@ public interface CommonMapper extends BaseMapper<Map<String, Object>> {
      * @date   : 2024/3/1 9:21
      */
     Long countSupplier(Map<String, Object> param);
+
+    /**
+     * @desc   : 获取渠道
+     * @author : 付斌
+     * @date   : 2024-03-02 10:18
+     */
+    List<Map<String, Object>> getChannel(Map param);
 }

+ 91 - 62
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -20,13 +20,15 @@
     </select>
 
     <!--获取编码-->
-    <select id="getUniqueCode"  resultType="java.util.Map">
-        select out_id AS "outId",out_code AS "outNote" from dkic_b.f_create_code_id(#{cpId},#{docName});
+    <select id="getUniqueCode" resultType="java.util.Map">
+        select out_id AS "outId", out_code AS "outNote"
+        from dkic_b.f_create_code_id(#{cpId}, #{docName});
     </select>
 
     <!--获取单号-->
-    <select id="getUniqueNote"  resultType="java.util.Map">
-        select out_id AS "outId",out_note AS "outNote" from dkic_b.f_create_note_id(#{cpId},#{docName});
+    <select id="getUniqueNote" resultType="java.util.Map">
+        select out_id AS "outId", out_note AS "outNote"
+        from dkic_b.f_create_note_id(#{cpId}, #{docName});
     </select>
 
     <resultMap id="BaseResultMap" type="java.util.Map">
@@ -628,7 +630,7 @@
         select sku_id   as "skuId",
                sku_code as "skuCode",
                sku_name as "skuName",
-               remarks     as "remarks"
+               remarks  as "remarks"
         from mst.t_erp_sku
         where flg_valid
           and fty_id = #{ftyId}
@@ -681,16 +683,16 @@
 
     <!-- 获取数据字典 -->
     <select id="getDictionaryData" resultType="java.util.Map">
-        select tdd.data_id AS "dataId",
-        tdd.data_value as "dataValue",
-        tdd.dict_code AS "dictCode"
-        from core.t_dictionary_data as tdd
-        where tdd.flg_valid
-        and (tdd.fty_id = #{ftyId} OR tdd.fty_id = 0)
-        <if test="dictCode != null and dictCode != ''">
-            and tdd.dict_code = #{dictCode}
-        </if>
-        order by tdd.display_no
+        select dd.data_id     as "dataId",
+               dd.dict_code   as "dictCode",
+               dd.data_code   as "dataCode",
+               dd.data_value  as "dataValue",
+               dd.flg_default as "flgDefault"
+        from dkic_b.t_mst_dictionary_data as dd
+        where dd.flg_valid
+          and dd.cp_id = #{cpId}
+          and dd.dict_code = #{dictCode}
+        order by dd.display_no
     </select>
 
     <!-- 获取数据类型 -->
@@ -1208,17 +1210,18 @@
 
     <!-- 查询损坯原因/产品缺陷/开模损原因-->
     <select id="getProductDefect" resultMap="getProductDefectMap">
-        select tpd.defect_id                                    AS "defectId",
-               tpd.defect_name                                  AS "defectName",
-               tpd.defect_code                                  AS "defectCode",
-               sys.f_code_name(tpd.defect_code,tpd.defect_name) AS "codeName",
-               tpd.defect_types                                 as "defectTypes",
+        select tpd.defect_id                                     AS "defectId",
+               tpd.defect_name                                   AS "defectName",
+               tpd.defect_code                                   AS "defectCode",
+               sys.f_code_name(tpd.defect_code, tpd.defect_name) AS "codeName",
+               tpd.defect_types                                  as "defectTypes",
                (
                    select json_agg(jsonb_build_object('fineId', fine_id, 'fineName', fine_name,
-                                                      'deductNum', deduct_num,'fineCodeName',sys.f_code_name(fine_code,fine_name)))
+                                                      'deductNum', deduct_num, 'fineCodeName',
+                                                      sys.f_code_name(fine_code, fine_name)))
                    from mst.t_product_defect_fine
-                   where fine_id = any(tpd.defect_fines)
-               ) as "defectFines"
+                   where fine_id = any (tpd.defect_fines)
+               )                                                 as "defectFines"
         from mst.t_product_defect tpd
         where tpd.fty_id = #{ftyId}
           and tpd.flg_valid
@@ -2119,7 +2122,7 @@
         select appm.menu_uuid                                         AS "menuUuid"
              , appm.menu_name                                         as name
              , sys.f_get_name_i18n_lang(appm.menu_name_i18n, #{i18n}) as "menuName"
-             , appm.fun_uuid                                            AS "funUuid"
+             , appm.fun_uuid                                          AS "funUuid"
              , appm.object_code                                       AS "objectCode"
              , appm.menu_type                                         AS "menuType"
         from sys.t_app_menu appm
@@ -2200,13 +2203,15 @@
         SELECT kind_code as "kindCode", sys.f_get_name_i18n_lang(kind_name_i18n, #{i18n}) as "kindName"
         FROM sys.t_data_kind t
         where t.kind_type = '型号种类'
-          and t.kind_tags -> 'used' ?? '标签' and flg_valid
+          and t.kind_tags - > 'used' ?? '标签' and flg_valid
         order by t.display_no
     </select>
 
     <select id="getModelProductLabelType" resultType="java.util.Map">
-        SELECT kind_code as "kindCode", sys.f_get_name_i18n_lang(kind_name_i18n,#{i18n}) as "kindName"
-        from sys.t_data_kind t where t.kind_type='验证标签' and (t.kind_tags->>'source')='产品型号'
+        SELECT kind_code as "kindCode", sys.f_get_name_i18n_lang(kind_name_i18n, #{i18n}) as "kindName"
+        from sys.t_data_kind t
+        where t.kind_type = '验证标签'
+          and (t.kind_tags ->>'source') = '产品型号'
     </select>
 
     <!-- 获取窑炉类型 -->
@@ -2406,14 +2411,13 @@
 
     <!-- 获取计量单位 -->
     <select id="getModelUnits" resultType="java.util.Map">
-        select
-                tmu.unit_id AS "unitId",
-                tmu.unit_code as "unitCode",
-                tmu.unit_name as "unitName",
-                tmu.unit_scale as "unitScale"
+        select tmu.unit_id    AS "unitId",
+               tmu.unit_code  as "unitCode",
+               tmu.unit_name  as "unitName",
+               tmu.unit_scale as "unitScale"
         from mst.t_model_units as tmu
         where tmu.flg_valid
-              and tmu.fty_id = #{ftyId}
+          and tmu.fty_id = #{ftyId}
         order by tmu.display_no
     </select>
 
@@ -2455,15 +2459,15 @@
 
     <!-- 获取报工项目-->
     <select id="getWorkProject" resultType="java.util.Map">
-        select p.project_id   as "projectIid",
-               p.project_code as "projectCode",
-               p.project_name as "projectName",
-               p.project_kind as "projectKind",
-               sys.f_get_name_i18n_lang(tdk.kind_name_i18n,#{i18n}) as "projectkindName",
-               p.item_kind    as "itemKind",
-               p.station_id   as "stationId",
-               p.pdt_grades   as "pdtGrades",
-               p.pdt_defects  as "pdtDefects",
+        select p.project_id                                          as "projectIid",
+               p.project_code                                        as "projectCode",
+               p.project_name                                        as "projectName",
+               p.project_kind                                        as "projectKind",
+               sys.f_get_name_i18n_lang(tdk.kind_name_i18n, #{i18n}) as "projectkindName",
+               p.item_kind                                           as "itemKind",
+               p.station_id                                          as "stationId",
+               p.pdt_grades                                          as "pdtGrades",
+               p.pdt_defects                                         as "pdtDefects",
                p.remarks
         from mst.t_work_project p
                  left join sys.t_data_kind as tdk
@@ -2538,15 +2542,14 @@
         select count(1)
         from mst.t_product_defect tpd
         where tpd.fty_id = #{ftyId}
-        and tpd.flg_valid
+          and tpd.flg_valid
     </select>
 
 
     <!-- 获取应用-->
     <select id="getApplication" resultType="java.util.Map">
-        select
-        app_code as "appCode",
-        app_name as "appName"
+        select app_code as "appCode",
+               app_name as "appName"
         from sys.t_application
     </select>
 
@@ -2562,17 +2565,16 @@
 
     <!--获取工位打印机-->
     <select id="getWsPrinter" resultType="java.util.Map">
-        select
-            ptwp.wsp_id as "wspId",
-            ptwp.printer_id as "printerId",
-            mtlp.printer_code as "printerCode",
-            mtlp.printer_name   as "printerName",
-            sys.f_code_name(mtlp.printer_code,mtlp.printer_name) AS "printerCodeName"
+        select ptwp.wsp_id                                           as "wspId",
+               ptwp.printer_id                                       as "printerId",
+               mtlp.printer_code                                     as "printerCode",
+               mtlp.printer_name                                     as "printerName",
+               sys.f_code_name(mtlp.printer_code, mtlp.printer_name) AS "printerCodeName"
         from pdm.t_ws_printer ptwp
-            left join mst.t_label_printer mtlp on mtlp.printer_id = ptwp.printer_id
+                 left join mst.t_label_printer mtlp on mtlp.printer_id = ptwp.printer_id
         where ptwp.fty_id = #{ftyId}
           and ptwp.station_id = #{stationId}
-          and  ptwp.flg_valid
+          and ptwp.flg_valid
     </select>
 
     <!--获取仓库-->
@@ -2655,16 +2657,16 @@
 
     <!--获取下拉选-->
     <select id="getSelectType" resultType="java.util.Map">
-        SELECT select_id as "selectId",
-        select_name as "selectName"
+        SELECT select_id   as "selectId",
+               select_name as "selectName"
         FROM mst.t_custom_select_type
         WHERE fty_id = #{ftyId}
-        and flg_valid
+          and flg_valid
     </select>
 
     <!--获取下拉选-->
     <select id="getSelectMagnifier" resultType="java.util.Map">
-        SELECT magnifier_id as "magnifierId",
+        SELECT magnifier_id   as "magnifierId",
                magnifier_name as "magnifierName"
         FROM mst.t_custom_select_magnifier
         WHERE fty_id = #{ftyId}
@@ -2901,13 +2903,15 @@
         tms.sup_name              as "supplierName",
         tms.sup_id                as "supplierId",
         tms.sup_type              as "supplierType",
+        tms.contact_name          as "contactName",
+        tms.contact_phone         as "contactPhone",
         tms.flg_valid             as "flgValid"
         from dkic_b.t_mst_supplier tms
         where tms.cp_id = #{cpId}
-        <if test="supplierName!=null and supplierName!=''" >
+        <if test="supplierName!=null and supplierName!=''">
             AND tms.sup_name LIKE concat('%', #{supplierName}, '%')
         </if>
-        <if test="supplierCode!=null and supplierCode!=''" >
+        <if test="supplierCode!=null and supplierCode!=''">
             AND tms.sup_code LIKE concat('%', #{supplierCode}, '%')
         </if>
         order by tms.sup_code
@@ -2924,11 +2928,36 @@
         select count(1)
         from dkic_b.t_mst_supplier tms
         where tms.cp_id = #{cpId}
-        <if test="supplierName!=null and supplierName!=''" >
+        <if test="supplierName!=null and supplierName!=''">
             AND tms.sup_name LIKE concat('%', #{supplierName}, '%')
         </if>
-        <if test="supplierCode!=null and supplierCode!=''" >
+        <if test="supplierCode!=null and supplierCode!=''">
             AND tms.sup_code LIKE concat('%', #{supplierCode}, '%')
         </if>
     </select>
+
+    <!--获取渠道 -->
+    <select id="getChannel" resultType="java.util.Map">
+        select c.channel_id   as "channelId",
+               c.channel_code as "channelCode",
+               c.channel_name as "channelName",
+               c.sys_code     as "sysCode",
+               c.display_no   as "displayNo"
+        from dkic_b.t_mst_sale_channel as c
+        where c.flg_valid
+          and c.cp_id = #{cpId}
+        <if test="channel_code!=null and channel_code!=''">
+            AND c.channel_code LIKE concat('%', #{channelCode}, '%')
+        </if>
+        <if test="channel_name!=null and channel_name!=''">
+            AND c.channel_name LIKE concat('%', #{channelName}, '%')
+        </if>
+        order by c.display_no
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+        <if test="limit != null and limit != 0 ">
+            limit #{limit}
+        </if>
+    </select>
 </mapper>

+ 1 - 1
src/main/java/com/dk/mdm/mapper/pur/PurchaseItemMapper.xml

@@ -14,7 +14,7 @@
         tppi.item_index,
         tppi.sku_id,
         tppi.item_qty,
-        tppi.price_std,
+        tppi.price_std as "pricePurchase",
         tppi.amt_std,
         tppi.price_pur,
         tppi.item_amt,

+ 2 - 12
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.java

@@ -33,20 +33,10 @@ public interface PurchaseMapper extends BaseMapper<Purchase>{
 
     /**
      * @desc   : 根据id查询
-     * @date   : 2023/6/28 14:06
-     * @author : 寇珊珊
-     */
-    PurchaseResponse  selectById(@Param("purId") String purId);
-
-
-
-    /**
-     * @desc   : 采购订单号赋值
      * @author : 常皓宁
-     * @date   : 2024/2/28 13:18
+     * @date   : 2024/3/2 11:39
      */
-    void updatePurNO(PurchaseVO purchasevo);
-
+    PurchaseResponse  selectById(@Param("purId") String purId);
 
 }
 

+ 13 - 15
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.xml

@@ -380,11 +380,13 @@
         ,tmo.org_name as "orgName"
         ,tms.staff_name as "staffName"
         ,tms1.staff_name as "makeStaffName"
+        ,tmp.sup_name as "supplierName"
         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
-        <include refid="Condition"/>
+        <include refid="Condition_1"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>
@@ -394,8 +396,16 @@
     <!-- 根据主键查询表dkic_b.t_psi_purchase的一行数据 -->
     <select id="selectById" resultMap="BaseResultMapResponse">
         SELECT
-        <include refid="Base_Column_List"/>
-        FROM dkic_b.t_psi_purchase
+        <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"
+        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
         WHERE pur_id = #{purId}::uuid
     </select>
 
@@ -424,16 +434,4 @@
         FROM dkic_b.t_psi_purchase tpp
         <include refid="Condition_1"/>
     </select>
-
-
-    <!--修改采购订单号-->
-    <update id="updatePurNO" parameterType="com.dk.mdm.model.pojo.pur.Purchase">
-        update dkic_b.t_psi_purchase
-        <set>
-            <if test="purNo != null">
-                pur_no= #{purNo},
-            </if>
-        </set>
-        where pur_id = #{purId}::uuid
-    </update>
 </mapper>

+ 7 - 0
src/main/java/com/dk/mdm/model/response/pur/PurchaseItemResponse.java

@@ -293,6 +293,13 @@ public class PurchaseItemResponse extends PageInfo<PurchaseItemResponse> impleme
     @ApiModelProperty(value = "商品型号")
     private String skuModel;
 
+    /**
+     * 采购标价
+     */
+    @Excel(name = "采购标价")
+    @ApiModelProperty(value = "采购标价")
+    private BigDecimal pricePurchase;
+
     /*
      * 相关属性
      * @TableField(exist = false)

+ 7 - 0
src/main/java/com/dk/mdm/model/response/pur/PurchaseResponse.java

@@ -386,6 +386,13 @@ public class PurchaseResponse extends PageInfo<PurchaseResponse> implements Seri
     @TableField(typeHandler = UuidTypeHandler.class)
     private String whId;
 
+    /**
+     * 供应商名称
+     */
+    @Excel(name = "供应商名称")
+    @ApiModelProperty(value = "供应商名称")
+    private String supplierName;
+
 
     @ApiModelProperty(value = "采购订单明细")
     private List<PurchaseItemResponse> purchaseItemResponseList;

+ 11 - 0
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -1386,4 +1386,15 @@ public class CommonService extends BaseService<Map<String, Object>> {
         data.setPageSize((int) param.get("pageSize")).setCurrentPage((int) param.get("currentPage")).setList(list).setTotal(total);
         return ResponseResultUtil.success(data);
     }
+
+    /**
+     * @desc   : 获取渠道
+     * @author : 付斌
+     * @date   : 2024-03-02 10:18
+     */
+    public ResponseResultVO<List<Map<String, Object>>> getChannel(Map<String, Object> param) {
+        // 获取公司
+        List<Map<String, Object>> list = commonMapper.getChannel(param);
+        return ResponseResultUtil.success(list);
+    }
 }

+ 0 - 1
src/main/java/com/dk/mdm/service/sale/OrderService.java

@@ -106,7 +106,6 @@ public class OrderService extends BaseService<Order> {
         Order order = orderConvert.convertToPo(orderVO);
         order.setOrderNo(UUID.randomUUID().toString());
         order.setOrderType(Constant.DocumentType.ORDER_CHASE.getName());
-        order.setSalesChannel("10112024-0228-0000-0000-00000173ec3a");
         // 订单总单保存
         super.insert(order);