Merge remote-tracking branch 'origin/branch20211210' into branch20211210

This commit is contained in:
baozhipeng
2021-12-15 19:08:43 +08:00
6 changed files with 107 additions and 20 deletions
@@ -25,6 +25,7 @@ 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.PasswordUtil;
import com.jero.common.util.ValidUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.common.vo.PayMailBillVO;
@@ -259,6 +260,10 @@ public class PayCommonProjectController extends JeroController<PayCommonProject,
IPage<PayCommonProject> pageList = payCommonProjectService.page(page, queryWrapper);
if(!CollectionUtils.isEmpty(pageList.getRecords())){
List<PayCommonProject> list = pageList.getRecords();
List<String> listString = list.stream().map(PayCommonProject::getPrincipalId).collect(Collectors.toList());
LambdaQueryWrapper<SysUser> querySysUser = new LambdaQueryWrapper<>();
querySysUser.in(SysUser::getId,listString);
List<SysUser> listSysUser = sysUserService.list(querySysUser);
list.forEach(p->{
if(Objects.isNull(p.getReceivableAmount())){
p.setReceivableAmount(new BigDecimal("0.00"));
@@ -266,6 +271,17 @@ public class PayCommonProjectController extends JeroController<PayCommonProject,
if(Objects.isNull(p.getPaidAmount())){
p.setPaidAmount(new BigDecimal("0.00"));
}
if(!CollectionUtils.isEmpty(listSysUser)){
List<SysUser> listSysUserNew = listSysUser.stream().filter(item->Objects.equals(item.getId(),p.getPrincipalId())).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listSysUserNew)){
if(!StringUtils.isBlank(listSysUserNew.get(0).getPhone())){
p.setPrincipalPhone(PasswordUtil.decrypt(listSysUserNew.get(0).getPhone()));
}
if(!StringUtils.isBlank(listSysUserNew.get(0).getEmail())){
p.setPrincipalEmail(PasswordUtil.decrypt(listSysUserNew.get(0).getEmail()));
}
}
}
});
pageList.setRecords(list);
}
@@ -31,6 +31,8 @@ import com.jero.mail.entity.PayMailBill;
import com.jero.mail.entity.PayMailBillProject;
import com.jero.mail.service.IPayMailBillProjectService;
import com.jero.mail.service.IPayMailBillService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.pack.entity.PayPackCompany;
import com.jero.pack.entity.PayPackCompanyProject;
import com.jero.pack.service.IPayPackCompanyProjectService;
@@ -88,6 +90,8 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
private IPayIncomeContractAssociatedService payIncomeContractAssociatedService;
@Resource
private RolePermissionService rolePermissionService;
@Resource
private ISysUserService sysUserService;
/**
* 分页列表查询
@@ -245,6 +249,11 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
if(CollectionUtils.isEmpty(listPayWorkingGroup)){
return Result.error("工作组不存在");
}
List<String> listString = listPayWorkingGroup.stream().map(PayWorkingGroup::getPrincipalIdA).collect(Collectors.toList());
LambdaQueryWrapper<SysUser> querySysUser = new LambdaQueryWrapper<>();
querySysUser.in(SysUser::getId,listString);
List<SysUser> listSysUser = sysUserService.list(querySysUser);
list.forEach(p->{
if(Objects.isNull(p.getReceivableAmount())){
p.setReceivableAmount(new BigDecimal("0.00"));
@@ -254,10 +263,20 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
}
List<PayWorkingGroup> listPrincipalIdA = listPayWorkingGroup.stream().filter(item->Objects.equals(item.getId(),p.getWorkingGroupId())).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listPrincipalIdA)){
if(!CollectionUtils.isEmpty(listSysUser)){
List<SysUser> listSysUserNew = listSysUser.stream().filter(item->Objects.equals(item.getId(),listPrincipalIdA.get(0).getPrincipalIdA())).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listSysUserNew)){
if(!StringUtils.isBlank(listSysUserNew.get(0).getPhone())){
p.setPrincipalPhone(PasswordUtil.decrypt(listSysUserNew.get(0).getPhone()));
}
if(!StringUtils.isBlank(listSysUserNew.get(0).getEmail())){
p.setPrincipalEmail(PasswordUtil.decrypt(listSysUserNew.get(0).getEmail()));
}
}
}
p.setPrincipalName(listPrincipalIdA.get(0).getPrincipalNameA());
p.setYear(listPrincipalIdA.get(0).getYear());
}
});
pageList.setRecords(list);
}
@@ -439,25 +458,7 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
@ApiOperation(value = "工作组成员-设置收费通知", notes = "工作组成员-设置收费通知")
@PostMapping(value = "/setCharge")
public Result<?> setCharge(@RequestBody SetChargeInput input) {
if (StringUtils.isBlank(input.getIds())) {
return Result.error("id不能为空!");
}
String[] s = input.getIds().split(",");
for (String s1 : s) {
if (StringUtils.isBlank(s1)) {
return Result.error("id不能为空!");
}
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
LambdaUpdateWrapper<PayWorkingGroupSubItem> updatePayWorkingGroupSubItem = new LambdaUpdateWrapper<>();
updatePayWorkingGroupSubItem.in(PayWorkingGroupSubItem::getId,Arrays.asList(s));
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getCharge,input.getCharge());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getReceivableAmount,input.getReceivableAmount());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getChargeNoticeNo,input.getChargeNoticeNo());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getChargeNoticeId,input.getChargeNoticeId());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getUpdateBy,sysUser.getUsername());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getUpdateTime,new Date());
payWorkingGroupSubItemService.update(updatePayWorkingGroupSubItem);
payWorkingGroupSubItemService.setCharge(input);
return Result.OK("设置收费通知成功!");
}
@@ -61,6 +61,14 @@ public class PayCommonProject implements Serializable {
@Excel(name = "项目负责人", width = 15,orderNum = "2")
@ApiModelProperty(value = "负责人名称")
private String principalName;
/**负责人联系电话*/
@TableField(exist = false)
@ApiModelProperty(value = "负责人联系电话")
private String principalPhone;
/**负责人邮箱*/
@TableField(exist = false)
@ApiModelProperty(value = "负责人邮箱")
private String principalEmail;
/**来款企业id*/
@ApiModelProperty(value = "来款企业id")
@NotEmpty(message = "来款企业id不能为空")
@@ -242,6 +242,14 @@ public class PayWorkingGroupSubItem implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value = "负责人")
private String principalName;
/**负责人联系电话*/
@TableField(exist = false)
@ApiModelProperty(value = "负责人联系电话")
private String principalPhone;
/**负责人邮箱*/
@TableField(exist = false)
@ApiModelProperty(value = "负责人邮箱")
private String principalEmail;
/**
* 运行年份
*/
@@ -101,4 +101,13 @@ public interface IPayWorkingGroupSubItemService extends IService<PayWorkingGroup
IPage<PayWorkingGroupSubItem> queryCompanyPageList(Page<PayWorkingGroupSubItem> page,PayWorkingGroupSubItem payWorkingGroupSubItem,List<Integer> listNeedInvoice,List<String> listProjectIds);
List<PayWorkGroupSubletStatistics> importExcelStatistics2(PayWorkingGroupSubletSearch payWorkingGroupSubletSearch, String id, ArrayList<String> selections);
/**
* @Description 设置收费通知
* @Author lqt
* @Date 2021/9/29
* @Param listProjectIds 项目成员id集合
* @Return
* @Exception
*/
void setCharge(SetChargeInput input);
}
@@ -32,6 +32,7 @@ import com.jero.project.entity.*;
import com.jero.project.service.IPayWorkingGroupService;
import com.jero.project.service.IPayWorkingGroupSubItemService;
import com.jero.project.mapper.PayWorkingGroupSubItemMapper;
import com.jero.project.vo.SetChargeInput;
import com.jero.temporary.entity.PayCompanyManagementTemporary;
import com.jero.temporary.entity.PayContactsManagementTemporary;
import com.jero.temporary.service.IPayCompanyManagementTemporaryService;
@@ -700,6 +701,50 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
return payWorkingGroupSubItemMapper.importExcelStatistics2(payWorkingGroupSubletSearch,id,selections);
}
@Override
@Transactional
public void setCharge(SetChargeInput input) {
if (StringUtils.isBlank(input.getIds())) {
throw new JeroBootException("id不能为空!");
}
String[] s = input.getIds().split(",");
for (String s1 : s) {
if (StringUtils.isBlank(s1)) {
throw new JeroBootException("id不能为空!");
}
}
List<PayWorkingGroupSubItem> list = payWorkingGroupSubItemService.listByIds(Arrays.asList(s));
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(!CollectionUtils.isEmpty(list)){
list.forEach(p->{
LambdaUpdateWrapper<PayWorkingGroupSubItem> updatePayWorkingGroupSubItem = new LambdaUpdateWrapper<>();
// 变更应收金额,重新校验状态
ProjectStatusVO projectStatusVO = projectDetailService.getStatus(p.getId(),input.getReceivableAmount(),p.getNeedInvoice());
if(!Objects.isNull(projectStatusVO)){
if(!Objects.isNull(projectStatusVO.getInAccount())){
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getInAccount,projectStatusVO.getInAccount());
}
if(!Objects.isNull(projectStatusVO.getMakeInvoice())){
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getMakeInvoice,projectStatusVO.getMakeInvoice());
}
if(!Objects.isNull(projectStatusVO.getMail())){
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getMail,projectStatusVO.getMail());
}
}
updatePayWorkingGroupSubItem.eq(PayWorkingGroupSubItem::getId,p.getId());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getCharge,input.getCharge());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getReceivableAmount,input.getReceivableAmount());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getChargeNoticeNo,input.getChargeNoticeNo());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getChargeNoticeId,input.getChargeNoticeId());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getUpdateBy,sysUser.getUsername());
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getUpdateTime,new Date());
payWorkingGroupSubItemService.update(updatePayWorkingGroupSubItem);
});
}
}
/**
* @Description 删除项目打包关联,临时企业、联系信息
* @Author lqt