Browse Source

工具 2022-07-05 sxm

master
[li_she] 4 years ago
parent
commit
2b79b69635
  1. 11
      src/main/java/com/gaotao/config/AsyncConfig.java
  2. 9
      src/main/java/com/gaotao/modules/auditManagement/dao/AuthStepMapper.java
  3. 2
      src/main/java/com/gaotao/modules/print/service/impl/RollPrintServiceImpl.java
  4. 4
      src/main/java/com/gaotao/modules/purchaseorder/service/impl/AuthRulePartServiceImpl.java
  5. 7
      src/main/java/com/gaotao/modules/purchaseorder/service/impl/PRHeaderServiceImpl.java
  6. 29
      src/main/resources/mapper/auditManagement/AuthStepMapper.xml

11
src/main/java/com/gaotao/config/AsyncConfig.java

@ -0,0 +1,11 @@
package com.gaotao.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
@Configuration
@EnableAsync
@ComponentScan("com.gaotao.modules")
public class AsyncConfig {
}

9
src/main/java/com/gaotao/modules/auditManagement/dao/AuthStepMapper.java

@ -99,4 +99,13 @@ public interface AuthStepMapper {
* @date 2021/8/13
*/
List<AuthStep> getAuthSteps(AuthStepQuery authStepQuery);
/**
* @author: sxm
* @description: 获取适用于全工具类型的规则
* @param [authStepQuery]
* @return: java.util.List<com.gaotao.modules.auditManagement.entity.AuthStep>
* @date: 2022/7/5 15:44
*/
List<AuthStep> getAuthStepsAllToolType(AuthStepQuery authStepQuery);
}

2
src/main/java/com/gaotao/modules/print/service/impl/RollPrintServiceImpl.java

@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.*;
@ -149,7 +150,6 @@ public class RollPrintServiceImpl implements RollPrintService {
labelprinthistService.insertBatch(histsList);
}
public void rollPrint(RollParamVo rollParamVo) {
Date date = new Date();
List<Labelprinthist> histsList = new ArrayList<>();

4
src/main/java/com/gaotao/modules/purchaseorder/service/impl/AuthRulePartServiceImpl.java

@ -38,7 +38,9 @@ public class AuthRulePartServiceImpl extends ServiceImpl<AuthRulePartDao, AuthRu
// 删除规则对应下的 所有工具类型
lambdaUpdate().eq(AuthRulePart::getAuthRuleId,authRuleParts.get(0).getAuthRuleId()).remove();
// 保存规则对应的工具类型
saveBatch(authRuleParts);
for (AuthRulePart authRulePart : authRuleParts) {
save(authRulePart);
}
}
}
}

7
src/main/java/com/gaotao/modules/purchaseorder/service/impl/PRHeaderServiceImpl.java

@ -1,5 +1,6 @@
package com.gaotao.modules.purchaseorder.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -83,7 +84,13 @@ public class PRHeaderServiceImpl extends ServiceImpl<PRHeaderMapper, PRHeader> i
AuthStepQuery authStepQuery = new AuthStepQuery();
authStepQuery.setRecordTypeDb("87");
authStepQuery.setFamilyId(prDetailQuery.getOrderref1());
// 获取规则
List<AuthStep> authStepList = authStepMapper.getAuthSteps(authStepQuery);
// 没有规则,去获取适用于全类型的规则
if (CollectionUtil.isEmpty(authStepList)){
authStepList = authStepMapper.getAuthStepsAllToolType(authStepQuery);
}
// 获取对应的规则编号
for (int i = 0; i < authStepList.size(); i++) {
AuthorizationHist authorizationHist = new AuthorizationHist();
authorizationHist.setRecordTypeDb(authStepQuery.getRecordTypeDb());

29
src/main/resources/mapper/auditManagement/AuthStepMapper.xml

@ -157,15 +157,26 @@
</where>
</select>
<select id="getAuthSteps" resultType="com.gaotao.modules.auditManagement.entity.AuthStep">
select B.* from auth_rule A
left join auth_step B on A.id = B.rule_id
<where>
<if test="recordTypeDb != null and recordTypeDb != ''">
and A.record_type_db = ( SELECT min(role_item_no) from business_role_list
where record_type_db = #{recordTypeDb,jdbcType=VARCHAR} and family_id = #{familyId,jdbcType=VARCHAR})
</if>
</where>
ORDER BY B.step_id
<!-- select B.* from auth_rule A-->
<!-- left join auth_step B on A.id = B.rule_id-->
<!-- <where>-->
<!-- <if test="recordTypeDb != null and recordTypeDb != ''">-->
<!-- and A.record_type_db = ( SELECT min(role_item_no) from business_role_list-->
<!-- where record_type_db = #{recordTypeDb,jdbcType=VARCHAR} and family_id = #{familyId,jdbcType=VARCHAR})-->
<!-- </if>-->
<!-- </where>-->
<!-- ORDER BY B.step_id-->
select * from auth_step s
where rule_id = ( select top 1 id from auth_rule r
where r.id in ( SELECT auth_rule_id from auth_rule_part WHERE family_id = #{familyId})
order by r.priority desc)
order by s.step_id
</select>
<select id="getAuthStepsAllToolType" resultType="com.gaotao.modules.auditManagement.entity.AuthStep">
</select>
</mapper>
Loading…
Cancel
Save