Commit 6be234b3 by 徐高华

审批加企微参数

parent 22ce39e1
......@@ -43,5 +43,5 @@ public interface AuditApiService {
boolean judgeHavePhoneNumberOrCode(String enterpriseId,String clerkCode,String phoneNumber);
int getAuditCount(String enterpriseId , String clerkId) ;
int getAuditCount(String wxEnterpriseId,String enterpriseId , String clerkId) ;
}
......@@ -15,7 +15,7 @@ public interface TabHaobanAuditMapper {
int updateByPrimaryKeySelective(TabHaobanAudit record);
Page<TabHaobanAudit> page(@Param("auditType")Integer auditType, @Param("storeIds")List<String> storeIds,@Param("searchParams") String search, @Param("enterpriseId")String enterpriseId,@Param("auditStatus")Integer auditStatus,@Param("auditFlag")Integer auditFlag );
Page<TabHaobanAudit> page(@Param("wxEnterpriseId")String wxEnterpriseId , @Param("auditType")Integer auditType, @Param("storeIds")List<String> storeIds,@Param("searchParams") String search, @Param("enterpriseId")String enterpriseId,@Param("auditStatus")Integer auditStatus,@Param("auditFlag")Integer auditFlag );
List<TabHaobanAudit> listByStoreId(String storeId);
......@@ -29,5 +29,5 @@ public interface TabHaobanAuditMapper {
List<TabHaobanAudit> judgeHavePhoneNumberOrCode(@Param("enterpriseId")String enterpriseId,@Param("clerkCode")String clerkCode, @Param("phoneNumber")String phoneNumber);
int getAuditCount(@Param("enterpriseId")String enterpriseId , @Param("storeIds")List<String> storeIds) ;
int getAuditCount(@Param("wxEnterpriseId")String wxEnterpriseId,@Param("enterpriseId")String enterpriseId , @Param("storeIds")List<String> storeIds) ;
}
\ No newline at end of file
......@@ -96,7 +96,7 @@ public class AuditApiServiceImpl implements AuditApiService {
List<String> storeIdList = this.getStoreIdList(enterpriseId, clerkId) ;
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
com.github.pagehelper.Page<TabHaobanAudit> page = new com.github.pagehelper.Page<TabHaobanAudit>();
page = auditMapper.page(auditType, storeIdList, search, enterpriseId, auditStatus, auditFlag);
page = auditMapper.page(wxEnterpriseId,auditType, storeIdList, search, enterpriseId, auditStatus, auditFlag);
if (CollectionUtil.isNotEmpty(page.getResult())) {
List<String> commitStaffIds = page.getResult().stream().filter(item->StringUtils.isBlank(item.getCommitStaffName())).map(s -> s.getCommitStaffId()).collect(Collectors.toList());
logger.info(JSON.toJSONString(commitStaffIds));
......@@ -480,10 +480,10 @@ public class AuditApiServiceImpl implements AuditApiService {
return !CollectionUtil.isEmpty(list);
}
public int getAuditCount(String enterpriseId , String clerkId) {
public int getAuditCount(String wxEnterpriseId,String enterpriseId , String clerkId) {
// 如果null,说明是所有门店
List<String> storeIdList = this.getStoreIdList(enterpriseId, clerkId) ;
return this.auditMapper.getAuditCount(enterpriseId, storeIdList) ;
return this.auditMapper.getAuditCount(wxEnterpriseId,enterpriseId, storeIdList) ;
}
@SuppressWarnings("unchecked")
......
......@@ -141,7 +141,7 @@
select
<include refid="Base_Column_List" />
from tab_haoban_audit
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
where wx_enterprise_id=#{wxEnterpriseId} and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
<if test = "auditType != null">
and audit_type = #{auditType,jdbcType=INTEGER}
</if>
......@@ -161,43 +161,6 @@
order by commit_time desc
</select>
<select id="pageForStoreIdsAndstaffIds" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_audit
where 1=1
<if test = "wxEnterpriseId != null">
and wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</if>
<if test = "enterpriseId != null and enterpriseId !=''">
and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
</if>
<if test = "auditType != null">
and audit_type = #{auditType,jdbcType=INTEGER}
</if>
<if test = "auditFlag != null and auditFlag == 0">
and audit_status = 0
</if>
<if test = "auditFlag != null and auditFlag != 0">
and audit_status in (1,2,4,5)
</if>
<if test = "auditStatus != null">
and audit_status = #{auditStatus,jdbcType=INTEGER}
</if>
and ( commit_store_id in
<foreach collection="storeIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
or commit_staff_id in
<foreach collection="staffIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
order by commit_time desc
</select>
<select id="listByStoreId" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
......@@ -284,7 +247,7 @@
</select>
<select id="getAuditCount" resultType="int">
select count(*) from tab_haoban_audit where enterprise_id=#{enterpriseId}
select count(*) from tab_haoban_audit where wx_enterprise_id=#{wxEnterpriseId} and enterprise_id=#{enterpriseId}
<if test="null != storeIds">
and
( commit_store_id in
......
......@@ -72,13 +72,14 @@ public class AuditController extends WebBaseController{
}
//分页查找
@RequestMapping("find-page")
public HaobanResponse findPage(String wxEnterpriseId,String search,BasePageInfo pageInfo ,Integer auditType,Integer auditStatus,Integer auditFlag ) {
public HaobanResponse findPage(String search,BasePageInfo pageInfo ,Integer auditType,Integer auditStatus,Integer auditFlag ) {
if(auditFlag == null){
return resultResponse(HaoBanErrCode.ERR_2);
}
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser() ;
String enterpriseId = loginUser.getEnterpriseId() ;
String clerkId = AuthWebRequestUtil.getLoginUser().getClerkId() ;
String wxEnterpriseId = loginUser.getWxEnterpriseId() ;
Page<AuditDTO> page = auditApiService.page(auditType, search, wxEnterpriseId,enterpriseId, auditStatus,auditFlag, pageInfo ,clerkId);
List<AuditDTO> list = page.getResult();
List<String> storeIds = list.stream().map(s->s.getCommitStoreId()).collect(Collectors.toList());
......@@ -241,7 +242,8 @@ public class AuditController extends WebBaseController{
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String eid = login.getEnterpriseId() ;
String clerkId = login.getClerkId() ;
int count = this.auditApiService.getAuditCount(eid,clerkId) ;
String wxEnterpriseId = login.getWxEnterpriseId() ;
int count = this.auditApiService.getAuditCount(wxEnterpriseId,eid,clerkId) ;
return this.success(count) ;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment