Przeglądaj źródła

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/ActivityDO.java
#	svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/controller/ActivityController.java
#	svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ActivityService.java
wangzhinan 6 lat temu
rodzic
commit
5477f83447

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/CreditsDetailDO.java

@ -90,6 +90,9 @@ public class CreditsDetailDO extends UuidIdentityEntityWithOperator implements S
    @Transient
    private Integer mark;//1活动劵,2积分
    @Transient
    private ExchangeGoodsDO exchangeGoodsDO;//兑换商品
    @Column(name = "saas_id")
@ -315,4 +318,13 @@ public class CreditsDetailDO extends UuidIdentityEntityWithOperator implements S
    public void setMark(Integer mark) {
        this.mark = mark;
    }
    @Transient
    public ExchangeGoodsDO getExchangeGoodsDO() {
        return exchangeGoodsDO;
    }
    public void setExchangeGoodsDO(ExchangeGoodsDO exchangeGoodsDO) {
        this.exchangeGoodsDO = exchangeGoodsDO;
    }
}

+ 9 - 0
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java

@ -59,6 +59,10 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
    private ActiveRecordService activeRecordService;
    @Autowired
    private ActivityRuleDao activityRuleDao;
    @Autowired
    private ExchangeGoodsDao exchangeGoodsDao;
    @Autowired
    private TaskGoodsDao taskGoodsDao;
   /**
     *  find creditsLogInfo
@ -73,6 +77,11 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
            if (creditsDetailDO1.getTradeType() != null && creditsDetailDO1.getTradeType().equalsIgnoreCase("ACTIVITY_TASK")){
                TaskDO taskDO = taskDao.findOne(creditsDetailDO1.getTransactionId());
                creditsDetailDO1.setTaskDO(taskDO);
            }else if (creditsDetailDO1.getTradeType()!=null&&creditsDetailDO1.getTradeType().equals("EXCHANGE_GOODS")){
                ExchangeGoodsDO exchangeGoodsDO =exchangeGoodsDao.findOne(creditsDetailDO1.getTransactionId());
                TaskGoodsDO taskGoodsDO = taskGoodsDao.selectById(exchangeGoodsDO.getActivityGoodsId());
                exchangeGoodsDO.setTaskGoodsDO(taskGoodsDO);
                creditsDetailDO1.setExchangeGoodsDO(exchangeGoodsDO);
            }
        }
        String sqlcount = new ISqlUtils().getSql(creditsDetailDO,0,0,"count");

+ 6 - 4
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ExchangeGoodsService.java

@ -70,19 +70,19 @@ public class ExchangeGoodsService extends BaseJpaService<ExchangeGoodsDO,Exchang
               taskPatientDetailDO.setCouponTotal(taskPatientDetailDO.getCouponTotal() - exchangeGoodsDO.getCoupon());
           }
       }
       if (exchangeGoodsDO.getCoupon() == null){
       /*if (exchangeGoodsDO.getCoupon() == null){
           if (accountDO.getTotal() == null ){
               throw new Exception("积分余额不足!");
           }else {
               accountDO.setTotal(accountDO.getTotal()-exchangeGoodsDO.getIntegrate());
           }
       }else if (exchangeGoodsDO.getIntegrate() == null){
           if (accountDO.getTotal() == null){
           if (accountDO.getCouponTotal() == null){
               throw new Exception("活动劵余额不足!");
           }else {
               accountDO.setCouponTotal(accountDO.getCouponTotal()-exchangeGoodsDO.getCoupon());
           }
       }
       }*/
       exchangeGoodsDO.setCreateTime(new Date());
       exchangeGoodsDO.setUpdateTime(new Date());
       exchangeGoodsDO.setSaasId("dev");
@ -102,9 +102,11 @@ public class ExchangeGoodsService extends BaseJpaService<ExchangeGoodsDO,Exchang
       creditsDetailDO.setHospitalName(exchangeGoodsDO.getHospitalName());
       creditsDetailDO.setTransactionId(exchangeGoodsDO.getId());
       creditsDetailDO.setPatientId(exchangeGoodsDO.getPatientId());
       creditsDetailDO.setCreateTime(new Date());
       creditsDetailDO.setUpdateTime(new Date());
       credittsLogDetailDao.save(creditsDetailDO);
       taskPatientDetailDao.save(taskPatientDetailDO);
       accountDao.save(accountDO);
       /*accountDao.save(accountDO);*/
       return envelop;
    }