|
@@ -22,11 +22,14 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
+
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+
|
|
|
import com.ym.mec.biz.dal.dao.ReplacementInstrumentActivityDao;
|
|
|
+
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -63,6 +66,9 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
|
|
|
private SysUserCashAccountDetailService sysUserCashAccountDetailService;
|
|
|
@Autowired
|
|
|
private SysMessageService sysMessageService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CooperationOrganService cooperationOrganService;
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
@@ -80,6 +86,14 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
|
|
|
}
|
|
|
replacementInstrumentActivity.setUserId(sysUser.getId());
|
|
|
//如果用户是43分部,那么修改用户信息
|
|
|
+ if(sysUser.getOrganId() == 43){
|
|
|
+ CooperationOrgan cooperationOrgan = cooperationOrganService.get(replacementInstrumentActivity.getCooperationOrganId());
|
|
|
+ if (cooperationOrgan != null) {
|
|
|
+ sysUser.setOrganId(cooperationOrgan.getOrganId());
|
|
|
+ sysUser.setUpdateTime(new Date());
|
|
|
+ sysUserFeignService.updateSysUser(sysUser);
|
|
|
+ }
|
|
|
+ }
|
|
|
//如果提交过调查问卷,那么覆盖之前的记录
|
|
|
ReplacementInstrumentActivity activity = replacementInstrumentActivityDao.findByUserId(sysUser.getId());
|
|
|
if (activity != null) {
|
|
@@ -128,7 +142,7 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
|
|
|
|
|
|
@Override
|
|
|
public Map pay(ReplacementPayDto replacementPayDto) throws Exception {
|
|
|
- ReplacementInstrumentActivity replacementInstrumentActivity = replacementInstrumentActivityDao.get(replacementPayDto.getId());
|
|
|
+ ReplacementInstrumentActivity replacementInstrumentActivity = replacementInstrumentActivityDao.getLock(replacementPayDto.getId());
|
|
|
if (replacementInstrumentActivity == null) {
|
|
|
throw new BizException("乐器置换不存在,请核查");
|
|
|
}
|
|
@@ -182,7 +196,9 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
|
|
|
studentPaymentOrder.setUpdateTime(nowDate);
|
|
|
studentPaymentOrderService.insert(studentPaymentOrder);
|
|
|
//修改支付状态
|
|
|
-
|
|
|
+ replacementInstrumentActivity.setPayStatus(1);
|
|
|
+ replacementInstrumentActivity.setUpdateTime(nowDate);
|
|
|
+ replacementInstrumentActivityDao.update(replacementInstrumentActivity);
|
|
|
|
|
|
studentPaymentOrder.setVersion(0);
|
|
|
if (amount.compareTo(BigDecimal.ZERO) == 0) {
|
|
@@ -232,7 +248,7 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
|
|
|
throw new BizException("订单更新失败");
|
|
|
}
|
|
|
//更新维修单信息
|
|
|
- ReplacementInstrumentActivity replacementInstrumentActivity = get(Integer.parseInt(studentPaymentOrder.getMusicGroupId()));
|
|
|
+ ReplacementInstrumentActivity replacementInstrumentActivity = replacementInstrumentActivityDao.getLock(Integer.parseInt(studentPaymentOrder.getMusicGroupId()));
|
|
|
if (replacementInstrumentActivity == null) {
|
|
|
throw new BizException("置换信息不存在");
|
|
|
}
|