|
|
|
@@ -63,58 +63,47 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void saveOrUpdate(String tenantId,String bid, String item, String sign) { |
|
|
|
public void saveOrUpdate(String bid, String item, String sign) { |
|
|
|
|
|
|
|
WxMsgConfig wxMsgConfig = new WxMsgConfig(); |
|
|
|
wxMsgConfig.setTenantId(tenantId); |
|
|
|
wxMsgConfig.setBid(bid); |
|
|
|
List<WxMsgConfig> list = wxMsgConfigMapper.findList(wxMsgConfig); |
|
|
|
if(list.size()==1) { |
|
|
|
List<WxMsgCallback> wxMsgCallbacks = JSONArray.parseArray(item, WxMsgCallback.class); |
|
|
|
wxMsgConfig = list.get(0); |
|
|
|
wxMsgConfig.setRemains(wxMsgConfig.getRemains() - wxMsgCallbacks.size()); |
|
|
|
wxMsgConfigMapper.updateByPrimaryKeySelective(wxMsgConfig); |
|
|
|
|
|
|
|
for (WxMsgCallback wxMsgCallback : wxMsgCallbacks) { |
|
|
|
wxMsgCallback.setTenantId(wxMsgConfig.getTenantId()); |
|
|
|
wxMsgCallback.setSign(sign); |
|
|
|
wxMsgCallback.setCreatetime(new Date()); |
|
|
|
wxMsgCallbackMapper.insertSelective(wxMsgCallback); |
|
|
|
} |
|
|
|
List<WxMsgCallback> wxMsgCallbacks = JSONArray.parseArray(item, WxMsgCallback.class); |
|
|
|
wxMsgConfig = list.get(0); |
|
|
|
wxMsgConfig.setRemains(wxMsgConfig.getRemains() - wxMsgCallbacks.size()); |
|
|
|
wxMsgConfigMapper.updateByPrimaryKeySelective(wxMsgConfig); |
|
|
|
|
|
|
|
for (WxMsgCallback wxMsgCallback : wxMsgCallbacks) { |
|
|
|
wxMsgCallback.setTenantId(wxMsgConfig.getTenantId()); |
|
|
|
wxMsgCallback.setSign(sign); |
|
|
|
wxMsgCallback.setCreatetime(new Date()); |
|
|
|
wxMsgCallbackMapper.insertSelective(wxMsgCallback); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void receivemodel(String tenantId, String bid, Map<String, String> param) { |
|
|
|
WxMsgConfig wxMsgConfig = new WxMsgConfig(); |
|
|
|
wxMsgConfig.setTenantId(tenantId); |
|
|
|
wxMsgConfig.setBid(bid); |
|
|
|
List<WxMsgConfig> list = wxMsgConfigMapper.findList(wxMsgConfig); |
|
|
|
if(list.size()==1) { |
|
|
|
public void receivemodel(String bid, Map<String, String> param) { |
|
|
|
|
|
|
|
WxMsgModel wxMsgModel = new WxMsgModel(); |
|
|
|
wxMsgModel.setModelId(Integer.valueOf(param.get("id"))); |
|
|
|
wxMsgModel = wxMsgModelMapper.findList(wxMsgModel).get(0); |
|
|
|
wxMsgModel.setStatus(param.get("status").equals("1")?Integer.valueOf(param.get("status")):0); |
|
|
|
wxMsgModelMapper.updateByPrimaryKeySelective(wxMsgModel); |
|
|
|
|
|
|
|
WxMsgModel wxMsgModel = new WxMsgModel(); |
|
|
|
wxMsgModel.setModelId(Integer.valueOf(param.get("id"))); |
|
|
|
wxMsgModel = wxMsgModelMapper.findList(wxMsgModel).get(0); |
|
|
|
wxMsgModel.setStatus(param.get("status").equals("1")?Integer.valueOf(param.get("status")):0); |
|
|
|
wxMsgModelMapper.updateByPrimaryKeySelective(wxMsgModel); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void receiveverifymodel(String bid, Map<String, String> param) { |
|
|
|
WxMsgConfig wxMsgConfig = new WxMsgConfig(); |
|
|
|
wxMsgConfig.setBid(bid); |
|
|
|
List<WxMsgConfig> list = wxMsgConfigMapper.findList(wxMsgConfig); |
|
|
|
if(list.size()==1) { |
|
|
|
|
|
|
|
WxMsgValidationcodeModel wxMsgModel = new WxMsgValidationcodeModel(); |
|
|
|
wxMsgModel.setModelId(Integer.valueOf(param.get("id"))); |
|
|
|
wxMsgModel = wxMsgValidationcodeModelMapper.findList(wxMsgModel).get(0); |
|
|
|
wxMsgModel.setStatus(param.get("status").equals("1")?Integer.valueOf(param.get("status")):0); |
|
|
|
wxMsgValidationcodeModelMapper.updateByPrimaryKeySelective(wxMsgModel); |
|
|
|
WxMsgValidationcodeModel wxMsgModel = new WxMsgValidationcodeModel(); |
|
|
|
wxMsgModel.setModelId(Integer.valueOf(param.get("id"))); |
|
|
|
wxMsgModel = wxMsgValidationcodeModelMapper.findList(wxMsgModel).get(0); |
|
|
|
wxMsgModel.setStatus(param.get("status").equals("1")?Integer.valueOf(param.get("status")):0); |
|
|
|
wxMsgValidationcodeModelMapper.updateByPrimaryKeySelective(wxMsgModel); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|