Commit d75633da by 徐高华

审批条数

parent b0b6de5a
package com.gic.haoban.manage.api.service; package com.gic.haoban.manage.api.service;
import java.util.List; import java.util.List;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.AuditDTO; import com.gic.haoban.manage.api.dto.AuditDTO;
import com.gic.haoban.manage.api.dto.BatchAuditLogDTO; import com.gic.haoban.manage.api.dto.BatchAuditLogDTO;
/** /**
* Created by tgs on 2020/2/9. * Created by tgs on 2020/2/9.
*/ */
public interface AuditApiService { public interface AuditApiService {
Page<AuditDTO> page(Integer auditType, String search,String wxEnterpriseId,String enterpriseId,Integer auditStatus,Integer auditFlag,BasePageInfo pageInfo); Page<AuditDTO> page(Integer auditType, String search,String wxEnterpriseId,String enterpriseId,Integer auditStatus,Integer auditFlag,BasePageInfo pageInfo , String clerkId);
String audit(String batchId,String auditId,String aduitName,String optStaffId); String audit(String batchId,String auditId,String aduitName,String optStaffId);
void refuse(String auditId,String auditReason,String aduitStaffId,String aduitName); void refuse(String auditId,String auditReason,String aduitStaffId,String aduitName);
int save(Integer auditType,String wxEnterpriseId,String enterpriseId,String commitStaffId,String commitStoreId,String changeField,String oldValue,String newValue); int save(Integer auditType,String wxEnterpriseId,String enterpriseId,String commitStaffId,String commitStoreId,String changeField,String oldValue,String newValue);
void editStoreInfo(String storeId,String changeField,String oldValue, String newValue); void editStoreInfo(String storeId,String changeField,String oldValue, String newValue);
List<AuditDTO> listByStoreId(String storeId); List<AuditDTO> listByStoreId(String storeId);
AuditDTO findByStoreIdAndChangeField(String storeId,String changeField); AuditDTO findByStoreIdAndChangeField(String storeId,String changeField);
void insert(AuditDTO audit); void insert(AuditDTO audit);
Page<AuditDTO> listByStaffId(String staffId,Integer auditType,Integer auditStatus, BasePageInfo pageInfo); Page<AuditDTO> listByStaffId(String staffId,Integer auditType,Integer auditStatus, BasePageInfo pageInfo);
Page<AuditDTO> pageStoreListByParams(String storeId, BasePageInfo pageInfo, Integer auditType, Integer auditStatus); Page<AuditDTO> pageStoreListByParams(String storeId, BasePageInfo pageInfo, Integer auditType, Integer auditStatus);
AuditDTO findById(String auditId); AuditDTO findById(String auditId);
void update(AuditDTO audit); void update(AuditDTO audit);
List<BatchAuditLogDTO> listBatchLog(String batchId); List<BatchAuditLogDTO> listBatchLog(String batchId);
AuditDTO findByBindRelatedIdAndAuditType(String relatedId,int auditType); AuditDTO findByBindRelatedIdAndAuditType(String relatedId,int auditType);
boolean judgeHavePhoneNumberOrCode(String enterpriseId,String clerkCode,String phoneNumber); boolean judgeHavePhoneNumberOrCode(String enterpriseId,String clerkCode,String phoneNumber);
}
int getAuditCount(String enterpriseId , String clerkId) ;
}
...@@ -23,7 +23,6 @@ public interface TabHaobanAuditMapper { ...@@ -23,7 +23,6 @@ public interface TabHaobanAuditMapper {
Page<TabHaobanAudit> page(@Param("auditType")Integer auditType, @Param("storeIds")List<String> storeIds,@Param("staffIds")List<String>staffIds,@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId,@Param("auditStatus")Integer auditStatus,@Param("auditFlag")Integer auditFlag ); Page<TabHaobanAudit> page(@Param("auditType")Integer auditType, @Param("storeIds")List<String> storeIds,@Param("staffIds")List<String>staffIds,@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId,@Param("auditStatus")Integer auditStatus,@Param("auditFlag")Integer auditFlag );
Page<TabHaobanAudit> pageForStoreIdsAndstaffIds(@Param("auditType")Integer auditType, @Param("storeIds")List<String> storeIds,@Param("staffIds")List<String>staffIds,@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId,@Param("auditStatus")Integer auditStatus,@Param("auditFlag")Integer auditFlag ); Page<TabHaobanAudit> pageForStoreIdsAndstaffIds(@Param("auditType")Integer auditType, @Param("storeIds")List<String> storeIds,@Param("staffIds")List<String>staffIds,@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId,@Param("auditStatus")Integer auditStatus,@Param("auditFlag")Integer auditFlag );
List<TabHaobanAudit> listByStoreId(String storeId); List<TabHaobanAudit> listByStoreId(String storeId);
...@@ -37,5 +36,5 @@ public interface TabHaobanAuditMapper { ...@@ -37,5 +36,5 @@ public interface TabHaobanAuditMapper {
List<TabHaobanAudit> judgeHavePhoneNumberOrCode(@Param("enterpriseId")String enterpriseId,@Param("clerkCode")String clerkCode, @Param("phoneNumber")String phoneNumber); List<TabHaobanAudit> judgeHavePhoneNumberOrCode(@Param("enterpriseId")String enterpriseId,@Param("clerkCode")String clerkCode, @Param("phoneNumber")String phoneNumber);
int getAuditCount(String enterpriseId , @Param("storeIds")List<String> storeIds) ; int getAuditCount(@Param("enterpriseId")String enterpriseId , @Param("storeIds")List<String> storeIds) ;
} }
\ No newline at end of file
...@@ -30,6 +30,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanAudit; ...@@ -30,6 +30,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanAudit;
import com.gic.haoban.manage.service.entity.TabHaobanBatchAuditLog; import com.gic.haoban.manage.service.entity.TabHaobanBatchAuditLog;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -72,9 +74,8 @@ public class AuditApiServiceImpl implements AuditApiService { ...@@ -72,9 +74,8 @@ public class AuditApiServiceImpl implements AuditApiService {
@Override @Override
public Page<AuditDTO> page(Integer auditType, String search, String wxEnterpriseId, public Page<AuditDTO> page(Integer auditType, String search, String wxEnterpriseId,
String enterpriseId, Integer auditStatus, Integer auditFlag, BasePageInfo pageInfo) { String enterpriseId, Integer auditStatus, Integer auditFlag, BasePageInfo pageInfo , String clerkId) {
//部门关联表修改,服务层调整 //部门关联表修改,服务层调整
List<String> departmentIds = new ArrayList<>();
List<String> staffIds = new ArrayList<>(); List<String> staffIds = new ArrayList<>();
List<String> storeIds = new ArrayList<>(); List<String> storeIds = new ArrayList<>();
if (StringUtils.isNotEmpty(search)) { if (StringUtils.isNotEmpty(search)) {
...@@ -503,5 +504,13 @@ public class AuditApiServiceImpl implements AuditApiService { ...@@ -503,5 +504,13 @@ public class AuditApiServiceImpl implements AuditApiService {
List<TabHaobanAudit> list = auditMapper.judgeHavePhoneNumberOrCode(enterpriseId, clerkCode, phoneNumber); List<TabHaobanAudit> list = auditMapper.judgeHavePhoneNumberOrCode(enterpriseId, clerkCode, phoneNumber);
return !CollectionUtil.isEmpty(list); return !CollectionUtil.isEmpty(list);
} }
public int getAuditCount(String enterpriseId , String clerkId) {
List<String> storeIdList = null ;
if(CollectionUtils.isEmpty(storeIdList)) {
storeIdList = null ;
}
return this.auditMapper.getAuditCount(enterpriseId, storeIdList) ;
}
} }
...@@ -444,8 +444,17 @@ ...@@ -444,8 +444,17 @@
) )
</select> </select>
<select id="getAuditCount"> <select id="getAuditCount" resultType="int">
select count(*) from tab_haoban_audit where enterprise_id=#{enterpriseId}
<if test="null != storeIds">
and
( commit_store_id in
<foreach collection="storeIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
and audit_status = 0
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -79,7 +79,8 @@ public class AuditController extends WebBaseController{ ...@@ -79,7 +79,8 @@ public class AuditController extends WebBaseController{
if(StringUtils.isAnyBlank(wxEnterpriseId)){ if(StringUtils.isAnyBlank(wxEnterpriseId)){
return resultResponse(HaoBanErrCode.ERR_2); return resultResponse(HaoBanErrCode.ERR_2);
} }
Page<AuditDTO> page = auditApiService.page(auditType, search, wxEnterpriseId,enterpriseId, auditStatus,auditFlag, pageInfo); String clerkId = AuthWebRequestUtil.getLoginUser().getClerkId() ;
Page<AuditDTO> page = auditApiService.page(auditType, search, wxEnterpriseId,enterpriseId, auditStatus,auditFlag, pageInfo ,clerkId);
List<AuditDTO> list = page.getResult(); List<AuditDTO> list = page.getResult();
List<String> storeIds = list.stream().map(s->s.getCommitStoreId()).collect(Collectors.toList()); List<String> storeIds = list.stream().map(s->s.getCommitStoreId()).collect(Collectors.toList());
String[] array=storeIds.toArray(new String[storeIds.size()]); String[] array=storeIds.toArray(new String[storeIds.size()]);
...@@ -236,4 +237,13 @@ public class AuditController extends WebBaseController{ ...@@ -236,4 +237,13 @@ public class AuditController extends WebBaseController{
List<BatchAuditLogDTO> list = auditApiService.listBatchLog(batchId); List<BatchAuditLogDTO> list = auditApiService.listBatchLog(batchId);
return resultResponse(HaoBanErrCode.ERR_1,list); return resultResponse(HaoBanErrCode.ERR_1,list);
} }
@RequestMapping("get-audit-count")
public HaobanResponse getAuditCount() {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String eid = login.getEnterpriseId() ;
String clerkId = login.getClerkId() ;
int count = this.auditApiService.getAuditCount(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