Przeglądaj źródła

结算单生成

guoweisong 2 lat temu
rodzic
commit
4bb76c4274

+ 10 - 0
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -48,6 +48,16 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
     )
     List<InsPlyIncome> selectByCondition(InsPlyIncomeVo insPlyIncomeVo);
 
+    @Select({
+            "select a.*,b.`name` dept_name ,c.`name` companyName " +
+            "from ins_ply_income a " +
+            "left join sys_dept b on a.dept_id=b.id " +
+            "left join esm_ins_company c on a.company_id=c.id " +
+            "where a.policyno= #{policyno}"
+            }
+    )
+    InsPlyIncome selectByPlyno(String policyno);
+
     @Select({"<script>"," " +
             "select a.settleno,i.*,b.`name` dept_name ,c.`name` companyName " +
             "from ins_ply_settle_detail a " +

+ 5 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlySettleServiceImpl.java

@@ -55,9 +55,13 @@ public class InsPlySettleServiceImpl extends ServiceImpl<InsPlySettleMapper, Ins
         BigDecimal commissionFeevalue=new BigDecimal(0);
         BigDecimal otherFeevalue=new BigDecimal(0);
         BigDecimal allFeeValue=new BigDecimal(0);
+        if(plyList==null || plyList.size()==0){
+            return HttpResult.error("结算清单不能传空");
+        }
         // 生成结算单号
         settleno = plyList.get(0).getCompanyId()+ DateUtil.yyyyMMddHHmmss(new Date());
-        for(InsPlyIncome insPlyIncome:plyList){
+        for(InsPlyIncome insPlyIncome_tmp:plyList){
+            InsPlyIncome insPlyIncome=insPlyIncomeMapper.selectByPlyno(insPlyIncome_tmp.getPolicyno());
             InsPlySettleDetail insPlySettleDetail =new InsPlySettleDetail();
             insPlySettleDetail.setSettleno(settleno);
             insPlySettleDetail.setOrderno(insPlyIncome.getOrderno());