|
@@ -5,12 +5,16 @@ import com.emato.cuspay.common.contant.TablePrimaryKeyPrefix;
|
|
|
import com.emato.cuspay.common.core.db.IdWorkerAide;
|
|
|
import com.emato.cuspay.dao.mapper.merch.MerchPayCfgMapper;
|
|
|
import com.emato.cuspay.dao.mapper.wx.WxCbPayDocMapper;
|
|
|
+import com.emato.cuspay.dto.merch.MerchPayCfg;
|
|
|
+import com.emato.cuspay.wx.controller.WxCusController;
|
|
|
import com.emato.cuspay.wx.dao.entity.WxCbPayDoc;
|
|
|
import com.emato.cuspay.support.msg.resp.ResponseMessage;
|
|
|
import com.emato.cuspay.support.msg.resp.ResponseStatus;
|
|
|
import com.emato.cuspay.util.jackson.JacksonUtil;
|
|
|
import com.emato.cuspay.wx.common.WxDict;
|
|
|
import com.emato.cuspay.wx.service.WxCbPayDocService;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -24,6 +28,8 @@ import java.util.List;
|
|
|
*/
|
|
|
@Service
|
|
|
public class WxCbPayDocServiceImpl implements WxCbPayDocService {
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(WxCbPayDocServiceImpl.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
private WxCbPayDocMapper wxCbPayDocMapper;
|
|
|
|
|
@@ -40,19 +46,27 @@ public class WxCbPayDocServiceImpl implements WxCbPayDocService {
|
|
|
//设置支付单状态 待审核
|
|
|
wxCbPayDoc.setDocStatus(WxDict.PaymentDocStatus.i_00.getItem());
|
|
|
String merchSn = wxCbPayDoc.getMerchSn();
|
|
|
-
|
|
|
- if(merchPayCfgMapper.selectByWxMercherSn(merchSn) == null){
|
|
|
- return new ResponseMessage.Builder().setCode(ResponseStatus.ERROR.getItem()).setMsg("商户编号为"+merchSn+"的支付配置信息不存在")
|
|
|
- .build();
|
|
|
+ try {
|
|
|
+ List<MerchPayCfg> merchPayCfgList = merchPayCfgMapper.getMerchPayCfgByMerchsn(merchSn);
|
|
|
+ if(merchPayCfgList.size() == 0){
|
|
|
+ return new ResponseMessage.Builder().setCode(ResponseStatus.ERROR.getItem()).setMsg("商户编号为"+merchSn+"的支付配置信息不存在")
|
|
|
+ .build();
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("查询商户支付配置信息异常", e);
|
|
|
}
|
|
|
|
|
|
- int result = wxCbPayDocMapper.insertSelective(wxCbPayDoc);
|
|
|
- if (result > 0) {
|
|
|
- HashMap<String,String> resultMap = new HashMap<>();
|
|
|
- resultMap.put("docStatus", WxDict.PaymentDocStatus.i_00.getItemName());
|
|
|
+ try {
|
|
|
+ int result = wxCbPayDocMapper.insertSelective(wxCbPayDoc);
|
|
|
+ if (result > 0) {
|
|
|
+ HashMap<String,String> resultMap = new HashMap<>();
|
|
|
+ resultMap.put("docStatus", WxDict.PaymentDocStatus.i_00.getItemName());
|
|
|
|
|
|
- return new ResponseMessage.Builder().setCode(ResponseStatus.SUCCESS.getItem()).setMsg("入库成功")
|
|
|
- .setData(JacksonUtil.toJson(resultMap)).build();
|
|
|
+ return new ResponseMessage.Builder().setCode(ResponseStatus.SUCCESS.getItem()).setMsg("入库成功")
|
|
|
+ .setData(JacksonUtil.toJson(resultMap)).build();
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("新增支付单入库信息异常", e);
|
|
|
}
|
|
|
return new ResponseMessage.Builder().setCode(ResponseStatus.ERROR.getItem()).setMsg("入库失败")
|
|
|
.build();
|