add 企业管理员查询工作组

This commit is contained in:
lijiarao
2022-08-15 15:09:35 +08:00
parent b8341a84dd
commit 41906eebc2
6 changed files with 117 additions and 63 deletions
@@ -138,4 +138,6 @@ public class LoginUser {
*/ */
private Boolean isCompanyManager; private Boolean isCompanyManager;
private String companyId;
} }
@@ -171,6 +171,23 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
if(Objects.isNull(sysUser)){ if(Objects.isNull(sysUser)){
return Result.error("没有查到用户信息!"); return Result.error("没有查到用户信息!");
} }
Page<PayWorkingGroupSubItem> page = new Page<>(pageNo, pageSize);
List<Integer> listNeedInvoice = new ArrayList<>();
if(!Objects.isNull(payWorkingGroupSubItem.getNeedInvoice())){
// 需要发票 : 3为 需要发票,小程序需要
if(Objects.equals(payWorkingGroupSubItem.getNeedInvoice(),PayProjectCommon.NEED_INVOICE3)){
listNeedInvoice.add(1);
listNeedInvoice.add(2);
}else{
listNeedInvoice.add(payWorkingGroupSubItem.getNeedInvoice());
}
}
if(!StringUtils.isBlank(payWorkingGroupSubItem.getChargeProject())){
payWorkingGroupSubItem.setChargeProject(oConvertUtils.replaceAllPercent(payWorkingGroupSubItem.getChargeProject()));
}
IPage<PayWorkingGroupSubItem> pageList;
//非企业管理员
if (!sysUser.getIsCompanyManager()) {
List<String> listProjectIds = new ArrayList<>(); List<String> listProjectIds = new ArrayList<>();
// 工作组的企业联系人 // 工作组的企业联系人
@@ -233,21 +250,13 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
}else{ }else{
listProjectIdsNew.add(""); listProjectIdsNew.add("");
} }
Page<PayWorkingGroupSubItem> page = new Page<>(pageNo, pageSize); pageList = payWorkingGroupSubItemService.queryCompanyPageList(page, payWorkingGroupSubItem,listNeedInvoice,listProjectIdsNew);
List<Integer> listNeedInvoice = new ArrayList<>();
if(!Objects.isNull(payWorkingGroupSubItem.getNeedInvoice())){
// 需要发票 : 3为 需要发票,小程序需要
if(Objects.equals(payWorkingGroupSubItem.getNeedInvoice(),PayProjectCommon.NEED_INVOICE3)){
listNeedInvoice.add(1);
listNeedInvoice.add(2);
}else{ }else{
listNeedInvoice.add(payWorkingGroupSubItem.getNeedInvoice()); pageList = payWorkingGroupSubItemService.queryCompanyPageListByCompanyManager(page, payWorkingGroupSubItem,listNeedInvoice,sysUser.getCompanyId());
} }
}
if(!StringUtils.isBlank(payWorkingGroupSubItem.getChargeProject())){
payWorkingGroupSubItem.setChargeProject(oConvertUtils.replaceAllPercent(payWorkingGroupSubItem.getChargeProject()));
}
IPage<PayWorkingGroupSubItem> pageList = payWorkingGroupSubItemService.queryCompanyPageList(page, payWorkingGroupSubItem,listNeedInvoice,listProjectIdsNew);
if(!CollectionUtils.isEmpty(pageList.getRecords())){ if(!CollectionUtils.isEmpty(pageList.getRecords())){
List<PayWorkingGroupSubItem> list = pageList.getRecords(); List<PayWorkingGroupSubItem> list = pageList.getRecords();
List<String> listIds = list.stream().map(PayWorkingGroupSubItem::getWorkingGroupId).collect(Collectors.toList()); List<String> listIds = list.stream().map(PayWorkingGroupSubItem::getWorkingGroupId).collect(Collectors.toList());
@@ -49,6 +49,10 @@ public interface PayWorkingGroupSubItemMapper extends BaseMapper<PayWorkingGroup
*/ */
IPage<PayWorkingGroupSubItem> queryCompanyPageList(Page<PayWorkingGroupSubItem> page,@Param("payWorkingGroupSubItem") PayWorkingGroupSubItem payWorkingGroupSubItem,@Param("listNeedInvoice") List<Integer> listNeedInvoice,@Param("listProjectIds") List<String> listProjectIds); IPage<PayWorkingGroupSubItem> queryCompanyPageList(Page<PayWorkingGroupSubItem> page,@Param("payWorkingGroupSubItem") PayWorkingGroupSubItem payWorkingGroupSubItem,@Param("listNeedInvoice") List<Integer> listNeedInvoice,@Param("listProjectIds") List<String> listProjectIds);
IPage<PayWorkingGroupSubItem> queryCompanyPageList(Page<PayWorkingGroupSubItem> page,@Param("payWorkingGroupSubItem") PayWorkingGroupSubItem payWorkingGroupSubItem,@Param("listProjectIds") List<String> listProjectIds); IPage<PayWorkingGroupSubItem> queryCompanyPageList(Page<PayWorkingGroupSubItem> page,@Param("payWorkingGroupSubItem") PayWorkingGroupSubItem payWorkingGroupSubItem,@Param("listProjectIds") List<String> listProjectIds);
/**
* 企业端-管理员-我的工作组分页查询
*/
IPage<PayWorkingGroupSubItem> queryCompanyPageListByCompanyManager(Page<PayWorkingGroupSubItem> page,@Param("payWorkingGroupSubItem") PayWorkingGroupSubItem payWorkingGroupSubItem,@Param("listNeedInvoice") List<Integer> listNeedInvoice,@Param("companyId") String companyId);
List<PayWorkGroupSubletStatistics> importExcelStatistics2(@Param("payWorkingGroupSubletSearch") PayWorkingGroupSubletSearch payWorkingGroupSubletSearch,@Param("id") String id,@Param("selections") ArrayList<String> selections); List<PayWorkGroupSubletStatistics> importExcelStatistics2(@Param("payWorkingGroupSubletSearch") PayWorkingGroupSubletSearch payWorkingGroupSubletSearch,@Param("id") String id,@Param("selections") ArrayList<String> selections);
@@ -278,4 +278,32 @@
</where> </where>
group by pwgs.id order by pwgs.create_time desc group by pwgs.id order by pwgs.create_time desc
</select> </select>
<select id="queryCompanyPageListByCompanyManager" resultType="com.jero.project.entity.PayWorkingGroupSubItem">
select pwgs.*,pwg.working_group_project as chargeProject from pay_working_group_subitem pwgs
left join pay_working_group pwg ON pwgs.working_group_id = pwg.id
<where>
<if test="payWorkingGroupSubItem.chargeProject != null and payWorkingGroupSubItem.chargeProject != ''">
AND pwg.working_group_project like concat('%',concat(#{payWorkingGroupSubItem.chargeProject},'%'))
</if>
<if test="payWorkingGroupSubItem.pack != null">
AND pwgs.pack = #{payWorkingGroupSubItem.pack}
</if>
<if test="payWorkingGroupSubItem.year != null and payWorkingGroupSubItem.year != ''">
AND pwg.year = #{payWorkingGroupSubItem.year}
</if>
<if test="listNeedInvoice != null and listNeedInvoice.size() > 0">
AND pwgs.need_invoice in
<foreach collection="listNeedInvoice" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="companyId != null and companyId != ''">
and pwgs.charge_company_id = #{companyId}
</if>
</where>
group by pwgs.id order by pwgs.create_time desc
</select>
</mapper> </mapper>
@@ -99,6 +99,11 @@ public interface IPayWorkingGroupSubItemService extends IService<PayWorkingGroup
*/ */
IPage<PayWorkingGroupSubItem> queryCompanyPageList(Page<PayWorkingGroupSubItem> page,PayWorkingGroupSubItem payWorkingGroupSubItem,List<Integer> listNeedInvoice,List<String> listProjectIds); IPage<PayWorkingGroupSubItem> queryCompanyPageList(Page<PayWorkingGroupSubItem> page,PayWorkingGroupSubItem payWorkingGroupSubItem,List<Integer> listNeedInvoice,List<String> listProjectIds);
/**
* 企业端-管理员-我的工作组分页查询
*/
IPage<PayWorkingGroupSubItem> queryCompanyPageListByCompanyManager(Page<PayWorkingGroupSubItem> page, PayWorkingGroupSubItem payWorkingGroupSubItem, List<Integer> listNeedInvoice, String companyId);
List<PayWorkGroupSubletStatistics> importExcelStatistics2(PayWorkingGroupSubletSearch payWorkingGroupSubletSearch, String id, ArrayList<String> selections); List<PayWorkGroupSubletStatistics> importExcelStatistics2(PayWorkingGroupSubletSearch payWorkingGroupSubletSearch, String id, ArrayList<String> selections);
/** /**
* @Description 设置收费通知 * @Description 设置收费通知
@@ -112,4 +117,5 @@ public interface IPayWorkingGroupSubItemService extends IService<PayWorkingGroup
AllMoney queryPageList233(PayWorkingGroupSubletSearch payWorkingGroupSubletSearch, String id); AllMoney queryPageList233(PayWorkingGroupSubletSearch payWorkingGroupSubletSearch, String id);
} }
@@ -897,6 +897,11 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
return payWorkingGroupSubItemMapper.queryCompanyPageList( page, payWorkingGroupSubItem,listNeedInvoice, listProjectIds); return payWorkingGroupSubItemMapper.queryCompanyPageList( page, payWorkingGroupSubItem,listNeedInvoice, listProjectIds);
} }
@Override
public IPage<PayWorkingGroupSubItem> queryCompanyPageListByCompanyManager(Page<PayWorkingGroupSubItem> page, PayWorkingGroupSubItem payWorkingGroupSubItem, List<Integer> listNeedInvoice,String companyId) {
return payWorkingGroupSubItemMapper.queryCompanyPageListByCompanyManager( page, payWorkingGroupSubItem,listNeedInvoice,companyId);
}
@Override @Override
public List<PayWorkGroupSubletStatistics> importExcelStatistics2(PayWorkingGroupSubletSearch payWorkingGroupSubletSearch, String id, ArrayList<String> selections) { public List<PayWorkGroupSubletStatistics> importExcelStatistics2(PayWorkingGroupSubletSearch payWorkingGroupSubletSearch, String id, ArrayList<String> selections) {
return payWorkingGroupSubItemMapper.importExcelStatistics2(payWorkingGroupSubletSearch,id,selections); return payWorkingGroupSubItemMapper.importExcelStatistics2(payWorkingGroupSubletSearch,id,selections);