Merge remote-tracking branch 'origin/branch20211008'

# Conflicts:
#	jero-boot-incoming-payment/src/main/java/com/jero/company/controller/PayContactsManagementController.java
#	jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDepartController.java
This commit is contained in:
lijiarao
2021-10-28 11:14:55 +08:00
28 changed files with 389 additions and 114 deletions
@@ -99,7 +99,7 @@ public class ProjectPackServiceImpl implements ProjectPackService {
throw new JeroBootException("企业不匹配!");
}
//审核不通过不允许打包
if (!Objects.equals(payMeetingSituationOld.getCheckResult(), MeetingSubitemCommon.SIGNUP_STATUS_1)) {
if (!Objects.equals(payMeetingSituationOld.getRegisterCheckResult(), MeetingSubitemCommon.SIGNUP_STATUS_1)) {
throw new JeroBootException("项目未审核通过!");
}
LambdaUpdateWrapper<PayMeetingSituation> payMeetingSituation = new LambdaUpdateWrapper<>();
@@ -634,10 +634,8 @@ public class PayContactsManagementController extends JeroController<PayContactsM
* @return
*/
@ApiOperation(value="联系人管理-通过id查询-会议对外开放接口", notes="联系人管理-通过id查询-会议对外开放接口")
@GetMapping(value = "/queryByIdMeeting")
public Result<?> queryByIdMeeting(@RequestParam(name="id") String id) {
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
// if(sysUser.getId().equals(id)) {
@GetMapping(value = "/queryByIdGetContract")
public Result<?> queryByIdGetContract(@RequestParam(name="id") String id) {
PayContactsManagement payContactsManagement = payContactsManagementService.getById(id);
if (payContactsManagement == null) {
return Result.error("未找到对应数据");
@@ -649,9 +647,34 @@ public class PayContactsManagementController extends JeroController<PayContactsM
payContactsManagement.setEmail(PasswordUtil.decrypt(payContactsManagement.getEmail()));
}
return Result.OK(payContactsManagement);
// }else {
// return Result.OK("权限异常");
// }
}
/**
* 企业端通过id查询联系人信息
*
* @param id
* @return
*/
@ApiOperation(value="企业端-通过id查询联系人信息", notes="企业端-通过id查询联系人信息")
@GetMapping(value = "/queryByIdMeeting")
public Result<?> queryByIdMeeting(@RequestParam(name="id") String id) {
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
if(sysUser.getId().equals(id)) {
PayContactsManagement payContactsManagement = payContactsManagementService.getById(id);
if (payContactsManagement == null) {
return Result.error("未找到对应数据");
}
if (!StringUtils.isBlank(payContactsManagement.getPhone())) {
payContactsManagement.setPhone(PasswordUtil.decrypt(payContactsManagement.getPhone()));
}
if (!StringUtils.isBlank(payContactsManagement.getEmail())) {
payContactsManagement.setEmail(PasswordUtil.decrypt(payContactsManagement.getEmail()));
}
return Result.OK(payContactsManagement);
}else{
return Result.OK("权限异常");
}
}
/**
@@ -701,6 +724,44 @@ public class PayContactsManagementController extends JeroController<PayContactsM
return Result.OK(list);
}
/**
* 小程序-通过企业id查询用户
*
* @param companyId 企业id
* @return
*/
@ApiOperation(value="联系人管理-小程序-通过企业id查询用户", notes="联系人管理-小程序-通过企业id查询用户")
@GetMapping(value = "/queryWXByCompany")
public Result<?> queryWXByCompany(@RequestParam(name="companyId") String companyId,
@RequestParam(name="name",required = false) String name,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
if(!StringUtils.isBlank(name)){
name = oConvertUtils.replaceAllPercent(name);
}
Page<PayContactsManagement> page = new Page<>(pageNo, pageSize);
LambdaQueryWrapper<PayContactsManagement> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PayContactsManagement::getCompanyId,companyId);
queryWrapper.eq(PayContactsManagement::getName,name);
if(!StringUtils.isEmpty(name)){
queryWrapper.like(PayContactsManagement::getName,name);
}
IPage<PayContactsManagement> listPayContactsManagement = payContactsManagementService.page(page,queryWrapper);
if(!CollectionUtils.isEmpty(listPayContactsManagement.getRecords())){
List<PayContactsManagement> list = listPayContactsManagement.getRecords();
list.forEach(p->{
if(!StringUtils.isBlank(p.getPhone())){
p.setPhone(PasswordUtil.decrypt(p.getPhone()));
}
if(!StringUtils.isBlank(p.getEmail())){
p.setEmail(PasswordUtil.decrypt(p.getEmail()));
}
});
listPayContactsManagement.setRecords(list);
}
return Result.OK(listPayContactsManagement);
}
/**
* 通过企业id查询用户
*
@@ -551,6 +551,10 @@ public class PayIncomeContractController extends JeroController<PayIncomeContrac
if(Objects.equals(chargeStatus,PayIncomeContractCommon.CHARGE_STATUS0)){
chargeStatus = "";
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY)){
payIncomeContract.setPrincipalId(sysUser.getId());
}
List<PayIncomeContract> pageList = payIncomeContractService.queryList( payIncomeContract,chargeStatus,projectName,startTime,endTime);
List<PayIncomeContract> exportList = null;
@@ -562,6 +566,7 @@ public class PayIncomeContractController extends JeroController<PayIncomeContrac
} else {
exportList = pageList;
}
List<Map<String,String>> list = new ArrayList<>();
// excel字段长度
Map<String,Integer> mapCount = new HashMap<>();
@@ -3,15 +3,12 @@ package com.jero.contract.controller;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
@@ -20,11 +17,9 @@ import com.jero.common.common.RoleCommon;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.DateUtils;
import com.jero.common.util.oConvertUtils;
import com.jero.contract.common.PayIncomeContractCommon;
import com.jero.contract.entity.*;
import com.jero.contract.service.IPaySpendingContractInstallmentService;
import com.jero.contract.service.IPaySpendingContractService;
@@ -39,9 +34,7 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
import org.jeecgframework.poi.excel.view.JeecgMapExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
@@ -261,8 +254,11 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
@RequestParam(name="startTime",required = false) String startTime,
@RequestParam(name="endTime",required = false) String endTime) {
List<PaySpendingContract> pageList = paySpendingContractService.queryList( paySpendingContract.getContractNum(),
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!sysUser.getRoleCode().contains(RoleCommon.CWRY)){
paySpendingContract.setPrincipalId(sysUser.getId());
}
List<PaySpendingContract> pageList = paySpendingContractService.queryList(paySpendingContract.getPrincipalId(), paySpendingContract.getContractNum(),
paySpendingContract.getContractName(),startTime,endTime);
List<PaySpendingContract> exportList = null;
@@ -36,7 +36,7 @@ public interface PaySpendingContractMapper extends BaseMapper<PaySpendingContrac
* @Return
* @Exception
*/
List<PaySpendingContract> queryList(@Param("contractNum") String contractNum,
List<PaySpendingContract> queryList(@Param("principalId") String principalId, @Param("contractNum") String contractNum,
@Param("contractName") String contractName,@Param("startTime") String startTime,
@Param("endTime") String endTime);
@@ -295,6 +295,9 @@
<if test="projectName != null and projectName != ''">
AND aa.associatedProject LIKE CONCAT('%',CONCAT(#{projectName},'%'))
</if>
<if test="payIncomeContract.principalId != null and payIncomeContract.principalId != ''">
AND aa.principalId = #{payIncomeContract.principalId}
</if>
</where>
ORDER BY aa.chargeStatus desc,aa.statusOrder desc, aa.createTime desc
</select>
@@ -109,6 +109,9 @@
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{endTime}
</if>
<if test="principalId != null and principalId != ''">
AND principal_id = #{principalId}
</if>
</where>
ORDER BY chargeStatus desc,create_time desc
</select>
@@ -79,5 +79,5 @@ public interface IPaySpendingContractService extends IService<PaySpendingContrac
* @Return
* @Exception
*/
List<PaySpendingContract> queryList(String contractNum,String contractName,String startTime,String endTime);
List<PaySpendingContract> queryList(String principalId, String contractNum,String contractName,String startTime,String endTime);
}
@@ -520,8 +520,8 @@ public class PaySpendingContractServiceImpl extends ServiceImpl<PaySpendingContr
}
@Override
public List<PaySpendingContract> queryList(String contractNum, String contractName, String startTime, String endTime) {
return paySpendingContractMapper.queryList( contractNum, contractName, startTime, endTime);
public List<PaySpendingContract> queryList(String principalId,String contractNum, String contractName, String startTime, String endTime) {
return paySpendingContractMapper.queryList(principalId, contractNum, contractName, startTime, endTime);
}
@@ -132,7 +132,7 @@ public class PayCaseCommitteeController extends JeroController<PayCaseCommittee,
byte[] buff = new byte[1024];
BufferedInputStream bis = null;
// 读取filename
bis = new BufferedInputStream(new FileInputStream(new File(upLoadPath+"\\"+url)));
bis = new BufferedInputStream(new FileInputStream(new File(upLoadPath+File.separator+url)));
int i = bis.read(buff);
while (i != -1) {
outputStream.write(buff, 0, buff.length);
@@ -8,8 +8,10 @@ import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.aspect.annotation.DictPoint;
import com.jero.common.exception.JeroBootException;
import com.jero.common.service.RolePermissionService;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.AuthenticationUtils;
import com.jero.common.util.PasswordUtil;
import com.jero.common.util.ValidUtil;
@@ -19,7 +21,9 @@ import com.jero.company.entity.PayContactsManagement;
import com.jero.company.service.IPayCompanyManagementService;
import com.jero.company.service.IPayContactsManagementService;
import com.jero.meeting.common.MeetingCommon;
import com.jero.meeting.entity.PayMeeting;
import com.jero.meeting.entity.PayMeetingSituation;
import com.jero.meeting.service.IPayMeetingService;
import com.jero.meeting.service.IPayMeetingSituationService;
import com.jero.meeting.vo.*;
import com.jero.meeting.vo.excel.*;
@@ -28,6 +32,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
@@ -56,11 +61,15 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@Resource
private IPayMeetingSituationService payMeetingSituationService;
@Resource
private AuthenticationUtils authenticationUtils;
@Resource
private IPayContactsManagementService contactsManagementService;
@Resource
private IPayCompanyManagementService companyManagementService;
@Resource
private IPayMeetingService meetingService;
@Resource
private RolePermissionService rolePermissionService;
private final Integer MEETING_TYPE = MeetingCommon.COMMITTEE_MEETING_INT;
/**
* 分页列表查询
*/
@@ -72,20 +81,29 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
String meetingId = payMeetingSituation.getMeetingId();
if (StringUtils.isBlank(meetingId)) {
throw new JeroBootException("会议id不能为空");
}
QueryWrapper<PayMeetingSituation> queryWrapper = QueryGenerator.initQueryWrapper(payMeetingSituation, req.getParameterMap());
String particularYear = req.getParameter("particularYear");
if (StringUtils.isNotBlank(particularYear)){
queryWrapper.eq("DATE_FORMAT( ppr.payment_date, '%Y' )",particularYear);
if (StringUtils.isNotBlank(particularYear)) {
queryWrapper.eq("DATE_FORMAT( ppr.payment_date, '%Y' )", particularYear);
}
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if (!rolePermissionService.getRolePermission("committeeMeetingSituation:search")) {
queryWrapper.eq("pm.director_id", loginUser.getId());
}
queryWrapper.eq("pm.meeting_type",MEETING_TYPE);
Page<PayMeetingSituation> page = new Page<>(pageNo, pageSize);
IPage<PayMeetingSituation> pageList = payMeetingSituationService.pageListContract(page, queryWrapper);
List<PayMeetingSituation> situationList = pageList.getRecords();
for (PayMeetingSituation meetingSituation : situationList) {
Integer payMode = meetingSituation.getPayMode();
//汇款并且缴费凭证为空
if (Objects.equals(payMode,1) && StringUtils.isBlank(meetingSituation.getPaymentRecord())){
if (Objects.equals(payMode, 1) && StringUtils.isBlank(meetingSituation.getPaymentRecord())) {
meetingSituation.setIdentification(PayProjectCommon.YES);
}else {
} else {
meetingSituation.setIdentification(PayProjectCommon.NO);
}
}
@@ -100,6 +118,11 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@ApiOperation(value = "参会人员信息-添加参会人", notes = "参会人员信息-添加参会人")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody PayMeetingSituation payMeetingSituation) {
String meetingId = payMeetingSituation.getMeetingId();
PayMeeting payMeeting = meetingService.getById(meetingId);
if (!Objects.equals(payMeeting.getMeetingType(),MEETING_TYPE)){
throw new JeroBootException("数据权限不足");
}
payMeetingSituationService.add(payMeetingSituation);
return Result.OK("添加成功!");
}
@@ -124,6 +147,7 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@ApiOperation(value = "参会人员信息-编辑", notes = "参会人员信息-编辑")
@PostMapping(value = "/edit")
public Result<?> edit(@RequestBody PayMeetingSituationVO payMeetingSituationVO) {
payMeetingSituationService.checkCan(payMeetingSituationVO.getId(),MEETING_TYPE);
payMeetingSituationService.editById(payMeetingSituationVO);
return Result.OK("编辑成功!");
}
@@ -136,6 +160,7 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@ApiOperation(value = "参会人员信息-通过id删除", notes = "参会人员信息-通过id删除")
@GetMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id") String id) {
payMeetingSituationService.checkCan(id,MEETING_TYPE);
payMeetingSituationService.deleteById(id);
return Result.OK("删除成功!");
}
@@ -148,7 +173,11 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@ApiOperation(value = "参会人员信息-批量删除", notes = "参会人员信息-批量删除")
@GetMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids") String ids) {
this.payMeetingSituationService.deleteByIds(Arrays.asList(ids.split(",")));
List<String> stringList = Arrays.asList(ids.split(","));
for (String id : stringList) {
payMeetingSituationService.checkCan(id,MEETING_TYPE);
}
this.payMeetingSituationService.deleteByIds(stringList);
return Result.OK("批量删除成功!");
}
@@ -160,6 +189,7 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@ApiOperation(value = "参会人员信息-通过id查询", notes = "参会人员信息-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id") String id) {
payMeetingSituationService.checkCan(id,MEETING_TYPE);
PayMeetingSituation payMeetingSituation = payMeetingSituationService.queryById(id);
if (payMeetingSituation == null) {
return Result.error("未找到对应数据");
@@ -188,6 +218,11 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@RequiresPermissions("committeeMeetingSituation:export")
@GetMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PayMeetingSituation payMeetingSituation) {
String meetingId = payMeetingSituation.getMeetingId();
PayMeeting payMeeting = meetingService.getById(meetingId);
if (!Objects.equals(payMeeting.getMeetingType(),MEETING_TYPE)){
throw new JeroBootException("数据权限不足");
}
QueryWrapper<PayMeetingSituation> queryWrapper = QueryGenerator.initQueryWrapper(payMeetingSituation, request.getParameterMap());
List<PayMeetingSituation> pageList = payMeetingSituationService.list(queryWrapper);
// 过滤选中数据
@@ -277,6 +312,10 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@ApiOperation(value = "设置对接人", notes = "设置对接人")
@PostMapping(value = "/addDock")
public Result<?> addDock(@RequestBody AddDockVO addDockVO) {
List<String> meetingSituationIds = addDockVO.getMeetingSituationIds();
for (String id : meetingSituationIds) {
payMeetingSituationService.checkCan(id,MEETING_TYPE);
}
payMeetingSituationService.addDock(addDockVO);
return Result.OK("设置对接人成功!");
}
@@ -289,6 +328,7 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@ApiOperation(value = "审核付款凭证")
@PostMapping(value = "/check")
public Result<?> check(@RequestBody CheckVO checkVO) {
payMeetingSituationService.checkCan(checkVO.getId(),MEETING_TYPE);
payMeetingSituationService.check(checkVO);
return Result.OK("审核成功!");
}
@@ -301,6 +341,7 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
@ApiOperation(value = "审核报名信息")
@PostMapping(value = "/checkRegister")
public Result<?> checkRegister(@RequestBody CheckVO checkVO) {
payMeetingSituationService.checkCan(checkVO.getId(),MEETING_TYPE);
payMeetingSituationService.checkRegister(checkVO);
return Result.OK("审核成功!");
}
@@ -316,6 +357,4 @@ public class CommitteeMeetingSituationController extends JeroController<PayMeeti
payMeetingSituationService.mergePayBill(mergePayBillVO);
return Result.OK("合并开票成功!");
}
}
@@ -155,6 +155,7 @@
<select id="pageListContract" resultMap="PayMeetingSituationResultMap">
select distinct pms.*
from pay_meeting_situation pms
left join pay_meeting pm on pms.meeting_id = pm.id
left JOIN pay_payment_record ppr ON ppr.project_id = pms.id
${ew.customSqlSegment}
</select>
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.meeting.common.MeetingCommon;
import com.jero.meeting.entity.PayMeetingSituation;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.meeting.vo.*;
@@ -77,4 +78,6 @@ public interface IPayMeetingSituationService extends IService<PayMeetingSituatio
void editTerminal(PayMeetingSituationVO payMeetingSituationVO);
IPage<PayMeetingSituation> pageListContract(Page<PayMeetingSituation> page, QueryWrapper<PayMeetingSituation> queryWrapper);
void checkCan(String situationId, Integer meetingCommon);
}
@@ -15,6 +15,7 @@ import com.jero.common.dto.SendMessageDTO;
import com.jero.common.enums.CompanyMessageEnums;
import com.jero.common.enums.ManagementMessageEnums;
import com.jero.common.exception.JeroBootException;
import com.jero.common.service.RolePermissionService;
import com.jero.common.service.SendMessageService;
import com.jero.common.service.ContractCreateProjectSendMessageService;
import com.jero.common.system.api.ISysBaseAPI;
@@ -113,6 +114,8 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
private ContractCreateProjectSendMessageService contractCreateProjectSendMessageService;
@Resource
private IPayIncomeContractService payIncomeContractService;
@Resource
private RolePermissionService rolePermissionService;
private static final String[] CAN_MODIFY_LIST = new String[]{"arrivalTime", "departureTime", "checkInHotel"};
@@ -121,6 +124,12 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
*/
@Override
public void add(PayMeetingSituation payMeetingSituation) {
String meetingId1 = payMeetingSituation.getMeetingId();
PayMeeting payMeeting1 = meetingService.getById(meetingId1);
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if (!Objects.equals(payMeeting1.getDirectorId(),loginUser.getId())) {
throw new JeroBootException("只有会议负责人可以新增参会人");
}
payMeetingSituation.setStatus(MeetingSubitemCommon.STATUS_3);
//payMeetingSituation.setNeedInvoice(PayProjectCommon.NO);
payMeetingSituation.setAmountReceivable(new BigDecimal("0"));
@@ -131,7 +140,7 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
// 收入合同创建项目发送消息到项目负责人
if (Objects.equals(ProjectCommon.FLAG, payMeetingSituation.getFlag())) {
PayMeeting payMeeting = meetingService.getById(payMeetingSituation.getMeetingId());
PayMeeting payMeeting = meetingService.getById(meetingId1);
contractCreateProjectSendMessageService.ContractCreateProjectSendMessageService(payMeeting.getMeetingName() + "的" + payMeetingSituation1.getCompanyContactName(), payMeetingSituation1.getId(), payMeeting.getDirectorId());
}
String meetingId = payMeetingSituation1.getMeetingId();
@@ -1125,11 +1134,17 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
}
String username = user.getUsername();
List<String> meetingSituationIds = addDockVO.getMeetingSituationIds();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String sysUserId = sysUser.getId();
for (String meetingSituationId : meetingSituationIds) {
PayMeetingSituation payMeetingSituation = getById(meetingSituationId);
String meetingId = payMeetingSituation.getMeetingId();
PayMeeting payMeeting = meetingService.getById(meetingId);
Integer meetingType = payMeeting.getMeetingType();
//只有会议负责人可以设置对接人
if (!payMeeting.getDirectorId().equals(sysUserId)) {
throw new JeroBootException("只有会议负责人可以设置对接人");
}
//只有国际研讨会议可以设置对接人
if (!meetingType.equals(Integer.parseInt(MeetingCommon.INTERNATIONAL_MEETING))) {
throw new JeroBootException("只有国际研讨会议可以设置对接人");
@@ -1161,4 +1176,13 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
return date.after(begin) && date.before(end);
}
@Override
public void checkCan(String situationId, Integer meetingCommon){
PayMeetingSituation payMeetingSituation = getById(situationId);
String meetingId = payMeetingSituation.getMeetingId();
PayMeeting payMeeting = meetingService.getById(meetingId);
if (!Objects.equals(payMeeting.getMeetingType(),meetingCommon)) {
throw new JeroBootException("数据权限不足");
}
}
}
@@ -8,49 +8,35 @@ import java.util.zip.ZipOutputStream;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.service.RolePermissionService;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.PasswordUtil;
import com.jero.common.util.ValidUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.company.entity.PayContactsManagement;
import com.jero.company.service.IPayContactsManagementService;
import com.jero.data.entity.PayFileDownloadRecord;
import com.jero.data.service.IPayFileDownloadRecordService;
import com.jero.meeting.entity.PayMeeting;
import com.jero.meeting.service.IPayMeetingService;
import com.jero.modules.message.handle.impl.EmailSendMsgHandle;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.project.common.PayProjectCommon;
import com.jero.project.entity.PayWorkingGroup;
import com.jero.project.entity.PayWorkingGroupDataFile;
import com.jero.project.service.IPayWorkingGroupDataFileService;
import com.jero.project.service.IPayWorkingGroupService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -69,6 +55,11 @@ public class PayWorkingGroupDataFileController extends JeroController<PayWorking
private IPayWorkingGroupDataFileService payWorkingGroupDataFileService;
@Resource
private IOSSFileService iossFileService;
@Resource
private RolePermissionService rolePermissionService;
@Resource
private IPayWorkingGroupService payWorkingGroupService;
@Value("${jero.path.upload}")
private String upLoadPath;
@@ -95,6 +86,20 @@ public class PayWorkingGroupDataFileController extends JeroController<PayWorking
&& payWorkingGroupDataFile.getProjectType() != PayProjectCommon.PROJECT_TYPE_FILE2){
return Result.error("项目状态不正确!");
}
if(payWorkingGroupDataFile.getProjectType() == PayProjectCommon.PROJECT_TYPE_FILE1){
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupDataFile.getProjectId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission("fileMaintenance:search")
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
throw new JeroBootException("资料不可操作!");
}
}
if(!StringUtils.isBlank(payWorkingGroupDataFile.getFileName())){
payWorkingGroupDataFile.setFileName(oConvertUtils.replaceAllPercent(payWorkingGroupDataFile.getFileName()));
}
@@ -173,6 +178,23 @@ public class PayWorkingGroupDataFileController extends JeroController<PayWorking
if(StringUtils.isBlank(id)){
return Result.error("id不能为空!");
}
PayWorkingGroupDataFile payWorkingGroupDataFile = payWorkingGroupDataFileService.getById(id);
if(Objects.isNull(payWorkingGroupDataFile)){
return Result.error("资料不存在!");
}
if(payWorkingGroupDataFile.getProjectType() == PayProjectCommon.PROJECT_TYPE_FILE1){
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupDataFile.getProjectId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission("fileMaintenance:delete")
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
throw new JeroBootException("资料不可操作!");
}
}
payWorkingGroupDataFileService.removeById(id);
return Result.OK("删除成功!");
}
@@ -191,10 +213,28 @@ public class PayWorkingGroupDataFileController extends JeroController<PayWorking
return Result.error("id不能为空!");
}
String[] s = ids.split(",");
StringBuilder msg = new StringBuilder();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
for (String s1 : s) {
if(StringUtils.isBlank(s1)){
return Result.error("id不能为空!");
}
PayWorkingGroupDataFile payWorkingGroupDataFile = payWorkingGroupDataFileService.getById(s1);
if(Objects.isNull(payWorkingGroupDataFile)){
return Result.error("资料不存在!");
}else{
if(payWorkingGroupDataFile.getProjectType() == PayProjectCommon.PROJECT_TYPE_FILE1){
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupDataFile.getProjectId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
if(!rolePermissionService.getRolePermission("fileMaintenance:batchDel")
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
throw new JeroBootException("资料不可操作!");
}
}
}
}
this.payWorkingGroupDataFileService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
@@ -248,6 +288,18 @@ public class PayWorkingGroupDataFileController extends JeroController<PayWorking
&& !Objects.equals(payWorkingGroupDataFile.getProjectType(),PayProjectCommon.PROJECT_TYPE_FILE2)){
throw new JeroBootException("项目状态不正确!");
}
if(payWorkingGroupDataFile.getProjectType() == PayProjectCommon.PROJECT_TYPE_FILE1){
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupDataFile.getProjectId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
if(!rolePermissionService.getRolePermission("fileMaintenance:export")
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
throw new JeroBootException("资料不可操作!");
}
}
// Step.1 组装查询条件
QueryWrapper<PayWorkingGroupDataFile> queryWrapper = QueryGenerator.initQueryWrapper(payWorkingGroupDataFile, request.getParameterMap());
@@ -156,7 +156,7 @@ public class PayWorkingGroupDistributionRecordController extends JeroController<
zipos = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
zipos.setMethod(ZipOutputStream.DEFLATED); //设置压缩方法
for (OSSFile ossFile : listOSSFile) {
File file = new File(upLoadPath + "\\" + ossFile.getUrl());
File file = new File(upLoadPath + File.separator + ossFile.getUrl());
if(file.exists()){
try {
//添加ZipEntry,并ZipEntry中写入文件流w
@@ -15,6 +15,7 @@ import com.jero.common.dto.SendMessageDTO;
import com.jero.common.enums.CompanyMessageEnums;
import com.jero.common.exception.JeroBootException;
import com.jero.common.service.ProjectDetailService;
import com.jero.common.service.RolePermissionService;
import com.jero.common.service.SendMessageService;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.vo.LoginUser;
@@ -85,6 +86,8 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
private IPayMailBillProjectService payMailBillProjectService;
@Resource
private IPayIncomeContractAssociatedService payIncomeContractAssociatedService;
@Resource
private RolePermissionService rolePermissionService;
/**
* 分页列表查询
@@ -111,6 +114,16 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
if(!StringUtils.isBlank(payWorkingGroupSubItem.getChargeCompanyTemporaryName())){
payWorkingGroupSubItem.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubItem.getChargeCompanyTemporaryName()));
}
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupSubItem.getWorkingGroupId());
if(Objects.isNull(payWorkingGroup)){
return Result.error("工作组不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission("workingGroupMember:search")
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
return Result.error("工作组成员不可操作!");
}
Page<PayWorkingGroupSubItem> page = new Page<>(pageNo, pageSize);
IPage<PayWorkingGroupSubItem> pageList = payWorkingGroupSubItemService.queryPageList(page, payWorkingGroupSubItem, paymentDate);
if(!CollectionUtils.isEmpty(pageList.getRecords())){
@@ -302,6 +315,7 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
if (StringUtils.isBlank(payWorkingGroupSubItem.getProjectIds())) {
return Result.error("id不能为空!");
}
String[] s = payWorkingGroupSubItem.getProjectIds().split(",");
for (String s1 : s) {
if (StringUtils.isBlank(s1)) {
@@ -316,12 +330,18 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
if(Objects.isNull(payWorkingGroup)){
return Result.error("工作组不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission("workingGroupMember:setDunningReminder")
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
throw new JeroBootException("工作组成员不可操作!");
}
List<String> listContacts = listPayWorkingGroupSubItem.stream().map(PayWorkingGroupSubItem::getContactsTemporaryIdOne).collect(Collectors.toList());
List<PayContactsManagementTemporary> listPayContactsManagementTemporary = payContactsManagementTemporaryService.listByIds(listContacts);
if(CollectionUtils.isEmpty(listPayContactsManagementTemporary)){
return Result.error("联系人不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
listPayWorkingGroupSubItem.forEach(p->{
List<PayContactsManagementTemporary> listContactsInfo = listPayContactsManagementTemporary.stream().filter(item->Objects.equals(p.getContactsTemporaryIdOne(),item.getId())).collect(Collectors.toList());
if(CollectionUtils.isEmpty(listContactsInfo)){
@@ -469,6 +489,16 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
@GetMapping(value = "/exportXls")
@ApiOperation(value = "工作组成员-导出excel", notes = "工作组成员-导出excel")
public ModelAndView exportXls(HttpServletRequest request, PayWorkingGroupSubItem payWorkingGroupSubItem) {
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupSubItem.getWorkingGroupId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission("workingGroupMember:export")
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
throw new JeroBootException("工作组成员不可操作!");
}
return super.exportXls(request, payWorkingGroupSubItem, PayWorkingGroupSubItem.class, "工作组成员");
}
@@ -274,6 +274,9 @@ public class PayCommonProjectServiceImpl extends ServiceImpl<PayCommonProjectMap
private StringBuilder deleteProject(String id,String perms){
StringBuilder sb = new StringBuilder();
PayCommonProject payCommonProject = payCommonProjectService.getById(id);
if(Objects.isNull(payCommonProject)){
throw new JeroBootException("普通项目不存在!");
}
// 项目负责人权限最底层,其他任何权限都可直接操作,不需要认证当前项目是否为项目负责人
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission(perms) && !Objects.equals(payCommonProject.getPrincipalId(), sysUser.getId())){
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.dto.SendMessageDTO;
import com.jero.common.enums.CompanyMessageEnums;
import com.jero.common.exception.JeroBootException;
import com.jero.common.service.RolePermissionService;
import com.jero.common.service.SendMessageService;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.PasswordUtil;
@@ -75,6 +76,8 @@ public class PayWorkingGroupDistributionRecordServiceImpl extends ServiceImpl<Pa
private IPayCaseCommitteeSubitemService payCaseCommitteeSubitemService;
@Resource
private PayWorkingGroupDistributionRecordMapper payWorkingGroupDistributionRecordMapper;
@Resource
private RolePermissionService rolePermissionService;
@Override
@Transactional
@@ -93,7 +96,7 @@ public class PayWorkingGroupDistributionRecordServiceImpl extends ServiceImpl<Pa
}
PayWorkingGroupDataFile payWorkingGroupDataFile = payWorkingGroupDataFileService.getById(payWorkingGroupDistributionRecord.getDataId());
if(Objects.isNull(payWorkingGroupDataFile)){
throw new JeroBootException("没有找到文件!");
throw new JeroBootException("资料不存在!");
}
OSSFile byId = iossFileService.getById(payWorkingGroupDataFile.getFileId());
if(Objects.isNull(byId)){
@@ -108,6 +111,16 @@ public class PayWorkingGroupDistributionRecordServiceImpl extends ServiceImpl<Pa
String msg = "";
List<PayWorkingGroupDistributionRecord> listPayWorkingGroupDistributionRecord = new ArrayList<>();
if(payWorkingGroupDistributionRecord.getProjectType() == PayProjectCommon.PROJECT_TYPE_FILE1){
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupDistributionRecord.getProjectId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission("fileMaintenance:distribute")
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
throw new JeroBootException("资料不可操作!");
}
setRecord( payWorkingGroupDistributionRecord,s,listPayWorkingGroupDistributionRecord, byId);
LambdaQueryWrapper<PayContactsManagementTemporary> queryPayContactsManagementTemporary = new LambdaQueryWrapper<>();
queryPayContactsManagementTemporary.in(PayContactsManagementTemporary::getId, Arrays.asList(s));
@@ -115,10 +128,6 @@ public class PayWorkingGroupDistributionRecordServiceImpl extends ServiceImpl<Pa
if(!CollectionUtils.isEmpty(listContacts)){
list = listContacts;
}
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupDistributionRecord.getProjectId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
msg = payWorkingGroup.getWorkingGroupProject();
}else if(payWorkingGroupDistributionRecord.getProjectType() == PayProjectCommon.PROJECT_TYPE_FILE2){
LambdaQueryWrapper<PayContactsManagement> queryPayContactsManagement = new LambdaQueryWrapper<>();
@@ -228,6 +237,16 @@ public class PayWorkingGroupDistributionRecordServiceImpl extends ServiceImpl<Pa
List<PayContactsManagementTemporary> list = new ArrayList<>();
List<PayWorkingGroupDistributionRecord> listPayWorkingGroupDistributionRecord = new ArrayList<>();
if(payWorkingGroupDistributionRecord.getProjectType() == PayProjectCommon.PROJECT_TYPE_FILE1){
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupDistributionRecord.getProjectId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission("fileMaintenance:distribute")
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
throw new JeroBootException("资料不可操作!");
}
listPayWorkingGroupDataFile.forEach(p->{
OSSFile byId = iossFileService.getById(p.getFileId());
if(Objects.isNull(byId)){
@@ -245,10 +264,6 @@ public class PayWorkingGroupDistributionRecordServiceImpl extends ServiceImpl<Pa
if(!CollectionUtils.isEmpty(listContacts)){
list = listContacts;
}
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupDistributionRecord.getProjectId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
msg = payWorkingGroup.getWorkingGroupProject();
}else if(payWorkingGroupDistributionRecord.getProjectType() == PayProjectCommon.PROJECT_TYPE_FILE2){
// 查询分标委成员
@@ -91,7 +91,7 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
PayWorkingGroup payWorkingGroupOld = payWorkingGroupService.getById(id);
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission("workingGroupProject:edit") && !Objects.equals(payWorkingGroupOld.getPrincipalIdA(),sysUser.getId())){
if(!rolePermissionService.getRolePermission("workingGroupProject:delete") && !Objects.equals(payWorkingGroupOld.getPrincipalIdA(),sysUser.getId())){
throw new JeroBootException(payWorkingGroupOld.getWorkingGroupProject() + "工作组项目不可操作!");
}
@@ -115,8 +115,11 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
StringBuilder sb1 = new StringBuilder();
ids.forEach(p->{
PayWorkingGroup payWorkingGroupOld = payWorkingGroupService.getById(p);
if(Objects.isNull(payWorkingGroupOld)){
throw new JeroBootException("工作组不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission("workingGroupProject:edit") && !Objects.equals(payWorkingGroupOld.getPrincipalIdA(),sysUser.getId())){
if(!rolePermissionService.getRolePermission("workingGroupProject:batchDel") && !Objects.equals(payWorkingGroupOld.getPrincipalIdA(),sysUser.getId())){
sb.append(payWorkingGroupOld.getWorkingGroupProject() + "工作组项目不可操作!<br/>");
}
LambdaQueryWrapper<PayWorkingGroupSubItem> query = new LambdaQueryWrapper<>();
@@ -158,7 +161,7 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
throw new JeroBootException("工作组不存在!");
}
if(payWorkingGroupOld.getWorkingGroupProject().length() == 50){
throw new JeroBootException("工作组名称长度为50位,不可复制,请修改之后在复制!");
throw new JeroBootException("工作组名称长度为50位,不可复制,请修改之后再复制!");
}
String str = payWorkingGroupOld.getWorkingGroupProject() + "-副本";
LambdaQueryWrapper<PayWorkingGroup> queryPayWorkingGroup = new LambdaQueryWrapper<>();
@@ -4,10 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.common.ProjectCommon;
import com.jero.common.exception.JeroBootException;
import com.jero.common.service.ContractCreateProjectSendMessageService;
import com.jero.common.service.ProjectDetailService;
import com.jero.common.service.RolePermissionService;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.ImportExcelUtil;
import com.jero.common.util.ValidUtil;
import com.jero.common.vo.ProjectStatusVO;
@@ -33,6 +36,7 @@ import com.jero.temporary.service.IPayContactsManagementTemporaryService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.ExcelImportCheckUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ImportParams;
@@ -43,7 +47,6 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@@ -81,6 +84,8 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
private IPayMeetingRemindRecordService payMeetingRemindRecordService;
@Resource
private ContractCreateProjectSendMessageService contractCreateProjectSendMessageService;
@Resource
private RolePermissionService rolePermissionService;
@Override
@@ -181,6 +186,16 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
if(Objects.isNull(payWorkingGroupSubItemOld)){
throw new JeroBootException("项目不存在!");
}
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupSubItem.getWorkingGroupId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission("workingGroupMember:edit")
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
throw new JeroBootException("工作组成员不可操作!");
}
// 项目为打包状态 || 到账!=0 || 开票!=0 || 邮寄!=0
if(!Objects.equals(payWorkingGroupSubItem.getChargeCompanyId(),payWorkingGroupSubItemOld.getChargeCompanyId())
&& (Objects.equals(payWorkingGroupSubItem.getPack(),PayProjectCommon.PACKAGING1)
@@ -205,10 +220,7 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
throw new JeroBootException("应收金额不能为空");
}
}
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupSubItem.getWorkingGroupId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
try {
// 编辑保存前再次校验来款项目是否存在
LambdaQueryWrapper<PayWorkingGroupSubItem> queryWrapper = new LambdaQueryWrapper<>();
@@ -566,7 +578,7 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
if (StringUtils.isBlank(id)) {
throw new JeroBootException("id不能为空!");
}
deleteProject(id);
deleteProject(id,"workingGroupMember:delete");
payWorkingGroupSubItemService.removeById(id);
}
@@ -581,7 +593,7 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
if (StringUtils.isBlank(s1)) {
throw new JeroBootException("id不能为空!");
}
deleteProject(s1);
deleteProject(s1,"workingGroupMember:batchDel");
}
payWorkingGroupSubItemService.removeByIds(Arrays.asList(ids.split(",")));
}
@@ -604,7 +616,7 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
* @Return
* @Exception
*/
private void deleteProject(String id){
private void deleteProject(String id,String perm){
PayWorkingGroupSubItem payWorkingGroupSubItem = payWorkingGroupSubItemService.getById(id);
// 到账!=0
if(!Objects.equals(payWorkingGroupSubItem.getInAccount(),PayProjectCommon.IN_ACCOUNT0)){
@@ -618,6 +630,16 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
if(!Objects.equals(payWorkingGroupSubItem.getMail(),PayProjectCommon.MAIL0)){
throw new JeroBootException("项目已有邮寄信息不可删除!");
}
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(payWorkingGroupSubItem.getWorkingGroupId());
if(Objects.isNull(payWorkingGroup)){
throw new JeroBootException("工作组不存在!");
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!rolePermissionService.getRolePermission(perm)
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
&& !Objects.equals(payWorkingGroup.getPrincipalIdB(),sysUser.getId())){
throw new JeroBootException("工作组成员不可操作!");
}
// 校验项目是否已关联合同 抛异常
payIncomeContractService.getPayIncomeContractAssociated(Collections.singletonList(payWorkingGroupSubItem.getId()));
// 如果已打报,同步删除打包关联
@@ -96,7 +96,7 @@ public class AllProjectStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
return Result.OK();
}
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageList(page,allProjectStatisticsSearch, idList );
@@ -167,7 +167,7 @@ public class AllProjectStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
return Result.OK();
}
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListForProject(page,allProjectStatisticsSearch,idList);
@@ -236,7 +236,8 @@ public class AllProjectStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
ArrayList<AllProjectStatistics> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, AllProjectStatistics.class, "所领导统计");
}
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
@@ -275,7 +276,8 @@ public class AllProjectStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
ArrayList<AllProjectStatistics> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, AllProjectStatistics.class, "所领导统计");
}
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
@@ -325,7 +327,8 @@ public class AllProjectStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
ArrayList<AllProjectStatistics> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, AllProjectStatistics.class, "企业来款统计");
}
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, idList);
if (pageList != null) {
@@ -84,7 +84,7 @@ public class CompanyComeMoneyStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
return Result.OK();
}
Page<CompanyComeMoneyList> page = new Page<>(pageNo, pageSize);
IPage<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompany(page,companyComeMoneySearch,idList);
@@ -148,7 +148,7 @@ public class CompanyComeMoneyStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
return Result.OK();
}
Page<CompanyComeMoneyDetail> page = new Page<>(pageNo, pageSize);
IPage<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetail(page, companyComeMoneyDetailSearch,idList);
@@ -210,7 +210,8 @@ public class CompanyComeMoneyStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
ArrayList<CompanyComeMoneyList> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, CompanyComeMoneyList.class, "企业来款统计");
}
List<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompanyExcel(companyComeMoneySearch, idList);
@@ -244,7 +245,8 @@ public class CompanyComeMoneyStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
ArrayList<CompanyComeMoneyDetail> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, CompanyComeMoneyDetail.class, "企业来款详情统计");
}
List<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetailExcel(companyComeMoneyDetailSearch, idList);
for (CompanyComeMoneyDetail s : pageList) {
@@ -22,6 +22,7 @@ import com.jero.project.entity.PayWorkingGroupStatistics;
import com.jero.project.entity.PayWorkingGroupSubletSearch;
import com.jero.project.service.IPayWorkingGroupService;
import com.jero.project.service.IPayWorkingGroupSubItemService;
import com.jero.statistics.entity.CompanyComeMoneyDetail;
import com.jero.util.AmountUtil;
import com.jero.util.SearchUtil;
import io.swagger.annotations.Api;
@@ -95,7 +96,7 @@ public class PayWorkingGroupStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
return Result.OK();
}
IPage<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatistics(page, payWorkingGroupSearch,idList);
List<PayWorkingGroupStatistics> records = pageList.getRecords();
@@ -161,7 +162,8 @@ public class PayWorkingGroupStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
ArrayList<PayWorkingGroupStatistics> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, PayWorkingGroupStatistics.class, "工作组项目统计");
}
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, idList);
//处理为空数据为0
@@ -198,7 +200,8 @@ public class PayWorkingGroupStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
ArrayList<PayWorkingGroupStatistics> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, PayWorkingGroupStatistics.class, "工作组项目统计");
}
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, idList,strings);
//处理为空数据为0
@@ -18,6 +18,7 @@ import com.jero.mail.entity.PayMailBillProject;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.project.entity.PayWorkGroupSubletStatistics;
import com.jero.project.entity.PayWorkingGroupStatistics;
import com.jero.project.service.IPayWorkingGroupService;
import com.jero.statistics.entity.*;
import com.jero.util.AmountUtil;
@@ -92,7 +93,7 @@ public class PrincipalPeopleStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
return Result.OK();
}
Page<PrincipalPeopleList> page = new Page<>(pageNo, pageSize);
@@ -205,7 +206,8 @@ public class PrincipalPeopleStatisticsController {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
ArrayList<PrincipalPeopleList> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, PrincipalPeopleList.class, "个人来款");
}
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch, idList);
@@ -421,30 +421,32 @@ public class SysDepartController {
List<String> errorMessage = new ArrayList<>();
int num = 0;
for (SysDepartExcel sysDepart : listSysDeparts) {
String orgCode = sysDepart.getOrgCode();
if(orgCode.length() > codeLength) {
String parentCode = orgCode.substring(0, orgCode.length()-codeLength);
QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<SysDepart>();
queryWrapper.eq("org_code", parentCode);
SysDepart parentDept = sysDepartService.getOne(queryWrapper);
if(parentDept != null) {
sysDepart.setParentId(parentDept.getId());
} else {
int lineNumber = num +1;
List<String> errorList = ValidUtil.validateReturnList(sysDepart);
if (!errorList.isEmpty()){
errorMessage.add("第 " + lineNumber + " 行:"+ StringUtils.join(errorList,","));
}
if (errorMessage.isEmpty()){
String orgCode = sysDepart.getOrgCode();
if(orgCode.length() > codeLength) {
String parentCode = orgCode.substring(0, orgCode.length()-codeLength);
QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<SysDepart>();
queryWrapper.eq("org_code", parentCode);
SysDepart parentDept = sysDepartService.getOne(queryWrapper);
if(parentDept != null) {
sysDepart.setParentId(parentDept.getId());
} else {
sysDepart.setParentId("");
}
}else{
sysDepart.setParentId("");
}
}else{
sysDepart.setParentId("");
//update-begin---author:liusq Date:20210223 for:批量导入部门以后,不能追加下一级部门 #2245------------
sysDepart.setOrgType(sysDepart.getOrgCode().length()/codeLength+"");
//update-end---author:liusq Date:20210223 for:批量导入部门以后,不能追加下一级部门 #2245------------
sysDepart.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
}
//update-begin---author:liusq Date:20210223 for:批量导入部门以后,不能追加下一级部门 #2245------------
sysDepart.setOrgType(sysDepart.getOrgCode().length()/codeLength+"");
//update-end---author:liusq Date:20210223 for:批量导入部门以后,不能追加下一级部门 #2245------------
sysDepart.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
int lineNumber = num +1;
try {
List<String> errorList = ValidUtil.validateReturnList(sysDepart);
if (!errorList.isEmpty()){
errorMessage.add("第 " + lineNumber + " 行:"+ StringUtils.join(errorList,","));
}
LambdaQueryWrapper<SysDepart> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysDepart::getDepartName,sysDepart.getDepartName());
if (sysDepartService.count(wrapper) > 0) {
@@ -453,7 +455,7 @@ public class SysDepartController {
LambdaQueryWrapper<SysDepart> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(SysDepart::getOrgCode,sysDepart.getOrgCode());
if (sysDepartService.count(wrapper1) > 0) {
errorMessage.add("第 " + lineNumber + " 行:部门编码已经存在");
errorMessage.add("第 " + lineNumber + " 行:机构编码已经存在");
}
if (errorMessage.isEmpty()){
SysDepart sysDepart1 = new SysDepart();
@@ -467,11 +469,13 @@ public class SysDepartController {
}
num++;
}
//清空部门缓存
Set keys3 = redisTemplate.keys(CacheConstant.SYS_DEPARTS_CACHE + "*");
Set keys4 = redisTemplate.keys(CacheConstant.SYS_DEPART_IDS_CACHE + "*");
redisTemplate.delete(keys3);
redisTemplate.delete(keys4);
if (errorMessage.isEmpty()){
//清空部门缓存
Set keys3 = redisTemplate.keys(CacheConstant.SYS_DEPARTS_CACHE + "*");
Set keys4 = redisTemplate.keys(CacheConstant.SYS_DEPART_IDS_CACHE + "*");
redisTemplate.delete(keys3);
redisTemplate.delete(keys4);
}
return ImportExcelUtil.importReturnRes(errorMessage.size(), errorMessage);
} catch (Exception e) {
log.error(e.getMessage(),e);
@@ -16,10 +16,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
@Select("select role_code from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username}))")
@Select("select role_code from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username} and del_flag = 0))")
List<String> getRoleByUserName(@Param("username") String username);
@Select("select id from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username}))")
@Select("select id from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username} and del_flag = 0))")
List<String> getRoleIdByUserName(@Param("username") String username);
}
@@ -34,10 +34,11 @@ public class SysDepartExcel {
/**机构编码*/
@Excel(name="机构编码",width=15,orderNum = "2")
@NotBlank(message = "机构编码不能为空")
private String orgCode;
/**手机号*/
@Excel(name="手机号",width=15,orderNum = "5")
@Pattern(regexp = "^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(17[0135678])|(18[0-9])|(19[8|9])|(16[6]))\\d{8}$",message = "手机号码格式错误")
@Pattern(regexp = "^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(17[0135678])|(18[0-9])|(19[8|9])|(16[6]))\\d{8}$",message = "手机号格式错误")
private String mobile;
/**传真*/
private String fax;