feat: 工作组调账接口
This commit is contained in:
+18
@@ -561,6 +561,24 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
|||||||
return Result.OK("删除成功!");
|
return Result.OK("删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调账
|
||||||
|
*
|
||||||
|
* @param workGroupId 工作组Id
|
||||||
|
* @param companyId 成员单位Id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "工作组成员-调账",operateType = 4)
|
||||||
|
@RequiresPermissions("workingGroupMember:editAccount")
|
||||||
|
@ApiOperation(value = "工作组成员-调账", notes = "工作组成员-调账")
|
||||||
|
@GetMapping(value = "/editAccount")
|
||||||
|
public Result<?> editAccount(@RequestParam(name = "workGroupId") String workGroupId,
|
||||||
|
@RequestParam(name = "companyId") String companyId) {
|
||||||
|
payWorkingGroupSubItemService.editAccount(workGroupId, companyId);
|
||||||
|
payWorkingGroupSubItemService.delete(companyId);
|
||||||
|
return Result.OK("调账成功!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
*
|
*
|
||||||
|
|||||||
+8
@@ -136,4 +136,12 @@ public interface IPayWorkingGroupSubItemService extends IService<PayWorkingGroup
|
|||||||
void deleteLabel(SetLabelVO setLabelVO);
|
void deleteLabel(SetLabelVO setLabelVO);
|
||||||
|
|
||||||
List<PayWorkingGroupSubItem> queryList(QueryWrapper<PayWorkingGroupSubItem> queryPayWorkingGroupSubItem);
|
List<PayWorkingGroupSubItem> queryList(QueryWrapper<PayWorkingGroupSubItem> queryPayWorkingGroupSubItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调账
|
||||||
|
*
|
||||||
|
* @param workGroupId 工作组id
|
||||||
|
* @param companyId 成员单位id
|
||||||
|
*/
|
||||||
|
void editAccount(String workGroupId, String companyId);
|
||||||
}
|
}
|
||||||
|
|||||||
+79
-2
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.common.ProjectCommon;
|
import com.jero.common.common.ProjectCommon;
|
||||||
import com.jero.common.dto.PaySendContactsMessageDTO;
|
import com.jero.common.dto.PaySendContactsMessageDTO;
|
||||||
import com.jero.common.dto.SendMessageDTO;
|
import com.jero.common.dto.SendMessageDTO;
|
||||||
@@ -43,6 +44,7 @@ import com.jero.project.common.PayProjectCommon;
|
|||||||
import com.jero.project.entity.*;
|
import com.jero.project.entity.*;
|
||||||
import com.jero.project.mapper.PayWorkingGroupSubItemContactsMapper;
|
import com.jero.project.mapper.PayWorkingGroupSubItemContactsMapper;
|
||||||
import com.jero.project.mapper.PayWorkingGroupSubItemMapper;
|
import com.jero.project.mapper.PayWorkingGroupSubItemMapper;
|
||||||
|
import com.jero.project.service.IPayCommonProjectService;
|
||||||
import com.jero.project.service.IPayWorkingGroupService;
|
import com.jero.project.service.IPayWorkingGroupService;
|
||||||
import com.jero.project.service.IPayWorkingGroupSubItemContactsService;
|
import com.jero.project.service.IPayWorkingGroupSubItemContactsService;
|
||||||
import com.jero.project.service.IPayWorkingGroupSubItemService;
|
import com.jero.project.service.IPayWorkingGroupSubItemService;
|
||||||
@@ -130,6 +132,8 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
private IPayMailBillService payMailBillService;
|
private IPayMailBillService payMailBillService;
|
||||||
@Resource
|
@Resource
|
||||||
PayWorkingGroupSubItemContactsMapper payWorkingGroupSubItemContactsMapper;
|
PayWorkingGroupSubItemContactsMapper payWorkingGroupSubItemContactsMapper;
|
||||||
|
@Resource
|
||||||
|
IPayCommonProjectService payCommonProjectService;
|
||||||
|
|
||||||
private static final String DATE_FORMAT = "yyyy-MM-dd";
|
private static final String DATE_FORMAT = "yyyy-MM-dd";
|
||||||
|
|
||||||
@@ -929,15 +933,16 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description // 验证重复
|
|
||||||
* @Date 2022/4/20 10:26
|
|
||||||
* @param p
|
* @param p
|
||||||
* @param msg
|
* @param msg
|
||||||
* @param count 行数
|
* @param count 行数
|
||||||
* @param listCompany 企业集合
|
* @param listCompany 企业集合
|
||||||
* @param listContactsInfo 联系人集合
|
* @param listContactsInfo 联系人集合
|
||||||
* @return java.lang.String
|
* @return java.lang.String
|
||||||
|
* @Description // 验证重复
|
||||||
|
* @Date 2022/4/20 10:26
|
||||||
*/
|
*/
|
||||||
private List<PayWorkingGroupSubItemContacts> checkRepeat(PayWorkingGroupSubItem p, StringBuilder msg, int count, List<PayCompanyManagement> listCompany, List<PayContactsManagement> listContactsInfo) {
|
private List<PayWorkingGroupSubItemContacts> checkRepeat(PayWorkingGroupSubItem p, StringBuilder msg, int count, List<PayCompanyManagement> listCompany, List<PayContactsManagement> listContactsInfo) {
|
||||||
List<PayWorkingGroupSubItemContacts> list = new ArrayList<>();
|
List<PayWorkingGroupSubItemContacts> list = new ArrayList<>();
|
||||||
@@ -1233,6 +1238,77 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
return payWorkingGroupSubItemMapper.queryList(queryPayWorkingGroupSubItem);
|
return payWorkingGroupSubItemMapper.queryList(queryPayWorkingGroupSubItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void editAccount(String workGroupId, String companyId) {
|
||||||
|
// 获取对应成员单位数据
|
||||||
|
PayWorkingGroup payWorkingGroup = payWorkingGroupService.getById(workGroupId);
|
||||||
|
if (Objects.isNull(payWorkingGroup)){
|
||||||
|
throw new JeroBootException("工作组不存在!");
|
||||||
|
}
|
||||||
|
Page<PayWorkingGroupSubItem> page = new Page<>(1, Integer.MAX_VALUE);
|
||||||
|
PayWorkingGroupSubItem payWorkingGroupSubItem = new PayWorkingGroupSubItem();
|
||||||
|
payWorkingGroupSubItem.setWorkingGroupId(workGroupId);
|
||||||
|
IPage<PayWorkingGroupSubItem> pageList = this.queryPageList(page, payWorkingGroupSubItem, null);
|
||||||
|
List<PayWorkingGroupSubItem> records = pageList.getRecords();
|
||||||
|
if (CollectionUtils.isEmpty(records)) {
|
||||||
|
throw new JeroBootException("成员单位不存在!");
|
||||||
|
}
|
||||||
|
// 获取对应成员单位数据
|
||||||
|
PayWorkingGroupSubItem data = records.stream()
|
||||||
|
.filter(item -> Objects.equals(item.getChargeCompanyId(), companyId)).findFirst().orElse(null);
|
||||||
|
if (Objects.isNull(data)) {
|
||||||
|
throw new JeroBootException("成员单位不存在!");
|
||||||
|
}
|
||||||
|
// 判断 只有待确收金额不为0,未开票、未到账、未邮寄可以操作
|
||||||
|
if (data.getReceivableAmount().compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
if (data.getMakeInvoice() != 0 || data.getInAccount() != 0 || data.getMail() != 0) {
|
||||||
|
throw new JeroBootException("只有待确收金额不为0,未开票、未到账、未邮寄可以操作!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 构建普通项目对象并添加
|
||||||
|
PayCommonProject payCommonProject = new PayCommonProject();
|
||||||
|
// 项目
|
||||||
|
payCommonProject.setChargeProject(payWorkingGroup.getWorkingGroupProject()
|
||||||
|
+ "-" + data.getChargeCompanyTemporaryName() + "-调账");
|
||||||
|
// 运行年份
|
||||||
|
payCommonProject.setYear(String.valueOf(LocalDate.now().getYear()));
|
||||||
|
// 负责人-工作组负责人A
|
||||||
|
payCommonProject.setPrincipalId(payWorkingGroup.getPrincipalIdA());
|
||||||
|
// 来款企业-成员单位
|
||||||
|
payCommonProject.setChargeCompanyId(data.getChargeCompanyId());
|
||||||
|
// 来款用途
|
||||||
|
payCommonProject.setChargeUse(PayProjectCommon.CHARGE_USE1);
|
||||||
|
// 联系人
|
||||||
|
payCommonProject.setContactsId(data.getContactsIdOne());
|
||||||
|
// 邮寄联系人
|
||||||
|
payCommonProject.setMailContactsId(data.getMailContactsId());
|
||||||
|
// 待确收金额
|
||||||
|
payCommonProject.setReceivableAmount(data.getReceivableAmount());
|
||||||
|
// 税率
|
||||||
|
payCommonProject.setTaxRate(new BigDecimal("0.06"));
|
||||||
|
BigDecimal zero = new BigDecimal(0);
|
||||||
|
// 税额
|
||||||
|
payCommonProject.setTax(zero);
|
||||||
|
// 未税金额
|
||||||
|
payCommonProject.setNoTaxAmount(zero);
|
||||||
|
// 预计到账日期
|
||||||
|
payCommonProject.setEstimatedArrivalDate(data.getEstimatedArrivalDate());
|
||||||
|
// 需要发票
|
||||||
|
payCommonProject.setNeedInvoice(data.getNeedInvoice());
|
||||||
|
// 来款方式
|
||||||
|
payCommonProject.setChargeWay(data.getChargeWay());
|
||||||
|
// 来款方式为收费通知的时候,收费通知号和文件 和成员对应的工作组的相同
|
||||||
|
if (Objects.equals(data.getChargeWay(), PayProjectCommon.CHARGE_WAY3)) {
|
||||||
|
// 收费通知号
|
||||||
|
payCommonProject.setChargeNoticeNo(data.getChargeNoticeNo());
|
||||||
|
// 收费通知文件
|
||||||
|
payCommonProject.setChargeNoticeId(data.getChargeNoticeId());
|
||||||
|
}
|
||||||
|
// 备注
|
||||||
|
payCommonProject.setRemarks(data.getRemarks());
|
||||||
|
payCommonProjectService.addPayCommonProject(payCommonProject);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 删除项目打包关联,临时企业、联系信息
|
* @Description 删除项目打包关联,临时企业、联系信息
|
||||||
* @Author lqt
|
* @Author lqt
|
||||||
@@ -1314,6 +1390,7 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
|||||||
payWorkingGroupSubItem.setMailContactsTemporaryId(mailContactsName.getId());
|
payWorkingGroupSubItem.setMailContactsTemporaryId(mailContactsName.getId());
|
||||||
payWorkingGroupSubItem.setMailContactsTemporaryName(mailContactsName.getName());
|
payWorkingGroupSubItem.setMailContactsTemporaryName(mailContactsName.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 插入企业信息,联系人信息到临时表,更新项目记录
|
* @Description 插入企业信息,联系人信息到临时表,更新项目记录
|
||||||
* @Author lqt
|
* @Author lqt
|
||||||
|
|||||||
Reference in New Issue
Block a user