Showing
3 changed files
with
50 additions
and
4 deletions
| 1 | 1 | package com.lframework.xingyun.sc.procurement.mappers.credit; |
| 2 | 2 | |
| 3 | +import com.lframework.starter.web.core.annotations.permission.DataPermission; | |
| 4 | +import com.lframework.starter.web.core.annotations.permission.DataPermissions; | |
| 3 | 5 | import com.lframework.starter.web.core.mapper.BaseMapper; |
| 6 | +import com.lframework.starter.web.inner.components.permission.OrderDataPermissionDataPermissionType; | |
| 4 | 7 | import com.lframework.xingyun.sc.procurement.dto.DomesticReviewerDto; |
| 5 | 8 | import com.lframework.xingyun.sc.procurement.entity.ProcurementDomesticCustomerCredit; |
| 6 | 9 | import com.lframework.xingyun.sc.procurement.vo.credit.QueryProcurementDomesticCustomerCreditVo; |
| ... | ... | @@ -9,6 +12,15 @@ import org.apache.ibatis.annotations.Param; |
| 9 | 12 | |
| 10 | 13 | public interface ProcurementDomesticCustomerCreditMapper extends BaseMapper<ProcurementDomesticCustomerCredit> { |
| 11 | 14 | |
| 15 | + /** | |
| 16 | + * 开启权限 | |
| 17 | + * | |
| 18 | + * @param vo | |
| 19 | + * @return | |
| 20 | + */ | |
| 21 | + @DataPermissions(type = OrderDataPermissionDataPermissionType.class, value = { | |
| 22 | + @DataPermission(template = "order", alias = "tb") | |
| 23 | + }) | |
| 12 | 24 | List<ProcurementDomesticCustomerCredit> query(@Param("vo") QueryProcurementDomesticCustomerCreditVo vo); |
| 13 | 25 | |
| 14 | 26 | ProcurementDomesticCustomerCredit findById(@Param("id") String id); | ... | ... |
| 1 | 1 | package com.lframework.xingyun.sc.procurement.mappers.credit; |
| 2 | 2 | |
| 3 | +import com.lframework.starter.web.core.annotations.permission.DataPermission; | |
| 4 | +import com.lframework.starter.web.core.annotations.permission.DataPermissions; | |
| 3 | 5 | import com.lframework.starter.web.core.mapper.BaseMapper; |
| 6 | +import com.lframework.starter.web.inner.components.permission.OrderDataPermissionDataPermissionType; | |
| 4 | 7 | import com.lframework.xingyun.sc.procurement.dto.ForeignTradeReviewerDto; |
| 5 | 8 | import com.lframework.xingyun.sc.procurement.entity.ProcurementForeignTradeCredit; |
| 6 | 9 | import com.lframework.xingyun.sc.procurement.vo.credit.QueryProcurementForeignTradeCreditVo; |
| ... | ... | @@ -10,6 +13,15 @@ import java.util.List; |
| 10 | 13 | |
| 11 | 14 | public interface ProcurementForeignTradeCreditMapper extends BaseMapper<ProcurementForeignTradeCredit> { |
| 12 | 15 | |
| 16 | + /** | |
| 17 | + * 开启权限 | |
| 18 | + * | |
| 19 | + * @param vo | |
| 20 | + * @return | |
| 21 | + */ | |
| 22 | + @DataPermissions(type = OrderDataPermissionDataPermissionType.class, value = { | |
| 23 | + @DataPermission(template = "order", alias = "tb") | |
| 24 | + }) | |
| 13 | 25 | List<ProcurementForeignTradeCredit> query(@Param("vo") QueryProcurementForeignTradeCreditVo vo); |
| 14 | 26 | |
| 15 | 27 | ProcurementForeignTradeCredit findById(@Param("id") String id); | ... | ... |
xingyun-sc/src/main/resources/mappers/procurement/credit/ProcurementDomesticCustomerCreditMapper.xml
| ... | ... | @@ -180,10 +180,32 @@ |
| 180 | 180 | </select> |
| 181 | 181 | |
| 182 | 182 | <select id="getReviewerById" resultType="com.lframework.xingyun.sc.procurement.dto.DomesticReviewerDto"> |
| 183 | - SELECT business_id, | |
| 184 | - JSON_UNQUOTE(JSON_EXTRACT(def_json, '$.nodeList[2].extMap.handleInfos[0].createBy')) AS procurementOffice, | |
| 185 | - JSON_UNQUOTE(JSON_EXTRACT(def_json, '$.nodeList[3].extMap.handleInfos[0].createBy')) AS supplyManagementSection, | |
| 186 | - JSON_UNQUOTE(JSON_EXTRACT(def_json, '$.nodeList[4].extMap.handleInfos[0].createBy')) AS supplyDepartment | |
| 183 | + SELECT | |
| 184 | + business_id, | |
| 185 | + -- 1. 采购处主管 (动态获取) | |
| 186 | + JSON_UNQUOTE( | |
| 187 | + JSON_EXTRACT(def_json, CONCAT( | |
| 188 | + REPLACE(JSON_SEARCH(def_json, 'one', 'domestic_customer_credit_cgczg_%'), '.nodeCode', ''), | |
| 189 | + '.extMap.handleInfos[0].createBy' | |
| 190 | + )) | |
| 191 | + ) AS procurementOffice, | |
| 192 | + | |
| 193 | + -- 2. 供应管理科主管 (domestic_customer_credit_gyglk) | |
| 194 | + JSON_UNQUOTE( | |
| 195 | + JSON_EXTRACT(def_json, CONCAT( | |
| 196 | + REPLACE(JSON_SEARCH(def_json, 'one', 'domestic_customer_credit_gyglk'), '.nodeCode', ''), | |
| 197 | + '.extMap.handleInfos[0].createBy' | |
| 198 | + )) | |
| 199 | + ) AS supplyManagementSection, | |
| 200 | + | |
| 201 | + -- 3. 供应部主管 (domestic_customer_credit_gybzg) | |
| 202 | + JSON_UNQUOTE( | |
| 203 | + JSON_EXTRACT(def_json, CONCAT( | |
| 204 | + REPLACE(JSON_SEARCH(def_json, 'one', 'domestic_customer_credit_gybzg'), '.nodeCode', ''), | |
| 205 | + '.extMap.handleInfos[0].createBy' | |
| 206 | + )) | |
| 207 | + ) AS supplyDepartment | |
| 208 | + | |
| 187 | 209 | FROM flow_instance |
| 188 | 210 | WHERE business_id = #{id} |
| 189 | 211 | ORDER BY create_time DESC LIMIT 1 | ... | ... |