|
@@ -16,6 +16,7 @@ import com.ydtech.modules.fnc.entity.InsPlySettleDetail;
|
|
|
import com.ydtech.modules.fnc.entity.InsPlySettleHx;
|
|
import com.ydtech.modules.fnc.entity.InsPlySettleHx;
|
|
|
import com.ydtech.modules.fnc.service.InsPlySettleService;
|
|
import com.ydtech.modules.fnc.service.InsPlySettleService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
+import com.ydtech.modules.fnc.vo.GenerateSettleVo;
|
|
|
import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
|
|
import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
|
|
|
import com.ydtech.modules.fnc.vo.InsPlySettleVo;
|
|
import com.ydtech.modules.fnc.vo.InsPlySettleVo;
|
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
@@ -53,8 +54,17 @@ public class InsPlySettleServiceImpl extends ServiceImpl<InsPlySettleMapper, Ins
|
|
|
private InsPlySettleHxMapper insPlySettleHxMapper;
|
|
private InsPlySettleHxMapper insPlySettleHxMapper;
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
- public HttpResult generateSettleAndDetail(List<String> plyNoList) {
|
|
|
|
|
|
|
+ public HttpResult generateSettleAndDetail(GenerateSettleVo generateSettleVo) {
|
|
|
|
|
|
|
|
|
|
+ List<String> plyNoList= generateSettleVo.getPlyNoList();
|
|
|
|
|
+ String companyId=generateSettleVo.getCompanyId();
|
|
|
|
|
+ String deptId =generateSettleVo.getDeptId();
|
|
|
|
|
+ String settleMonth=generateSettleVo.getSettleMonth();
|
|
|
|
|
+ if(StringUtils.isNullOrEmpty(companyId)
|
|
|
|
|
+ ||StringUtils.isNullOrEmpty(deptId)
|
|
|
|
|
+ ||StringUtils.isNullOrEmpty(settleMonth)){
|
|
|
|
|
+ return HttpResult.error("保险公司、机构、结算月份不能为空");
|
|
|
|
|
+ }
|
|
|
String settleno = "";
|
|
String settleno = "";
|
|
|
BigDecimal commissionFeevalue=new BigDecimal(0);
|
|
BigDecimal commissionFeevalue=new BigDecimal(0);
|
|
|
BigDecimal otherFeevalue=new BigDecimal(0);
|
|
BigDecimal otherFeevalue=new BigDecimal(0);
|
|
@@ -63,8 +73,8 @@ public class InsPlySettleServiceImpl extends ServiceImpl<InsPlySettleMapper, Ins
|
|
|
return HttpResult.error("结算清单不能传空");
|
|
return HttpResult.error("结算清单不能传空");
|
|
|
}
|
|
}
|
|
|
// 生成结算单号
|
|
// 生成结算单号
|
|
|
- InsPlyIncome insPlyIncome_t=insPlyIncomeMapper.selectByPlyno(plyNoList.get(0));
|
|
|
|
|
- settleno = insPlyIncome_t.getCompanyId()+ DateUtil.yyyyMMddHHmmss(new Date());
|
|
|
|
|
|
|
+// InsPlyIncome insPlyIncome_t=insPlyIncomeMapper.selectByPlyno(plyNoList.get(0));
|
|
|
|
|
+ settleno = companyId+ DateUtil.yyyyMMddHHmmss(new Date());
|
|
|
for(String plyNo:plyNoList){
|
|
for(String plyNo:plyNoList){
|
|
|
InsPlyIncome insPlyIncome=insPlyIncomeMapper.selectByPlyno(plyNo);
|
|
InsPlyIncome insPlyIncome=insPlyIncomeMapper.selectByPlyno(plyNo);
|
|
|
InsPlySettleDetail insPlySettleDetail =new InsPlySettleDetail();
|
|
InsPlySettleDetail insPlySettleDetail =new InsPlySettleDetail();
|
|
@@ -89,9 +99,9 @@ public class InsPlySettleServiceImpl extends ServiceImpl<InsPlySettleMapper, Ins
|
|
|
}
|
|
}
|
|
|
InsPlySettle insPlySettle =new InsPlySettle();
|
|
InsPlySettle insPlySettle =new InsPlySettle();
|
|
|
insPlySettle.setSettleno(settleno);
|
|
insPlySettle.setSettleno(settleno);
|
|
|
- insPlySettle.setCompanyId(insPlyIncome_t.getCompanyId());
|
|
|
|
|
- insPlySettle.setDeptId(insPlyIncome_t.getDeptId());
|
|
|
|
|
- insPlySettle.setSettleMonth(YearMonth.from(insPlyIncome_t.getPayDate()).toString());
|
|
|
|
|
|
|
+ insPlySettle.setCompanyId(companyId);
|
|
|
|
|
+ insPlySettle.setDeptId(deptId);
|
|
|
|
|
+ insPlySettle.setSettleMonth(settleMonth);
|
|
|
String settleBatch =this.baseMapper.getMaxBatch(insPlySettle);
|
|
String settleBatch =this.baseMapper.getMaxBatch(insPlySettle);
|
|
|
if(StringUtils.isNullOrEmpty(settleBatch)){
|
|
if(StringUtils.isNullOrEmpty(settleBatch)){
|
|
|
settleBatch="1";
|
|
settleBatch="1";
|