修改话费充值

dev-discount
袁野 3 years ago
parent 6a1c8ed9d3
commit fbb87cea49
  1. 32
      hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java
  2. 4
      hai-bweb/src/main/java/com/bweb/controller/SecUserController.java
  3. 30
      hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java
  4. 2
      hai-cweb/src/main/java/com/cweb/controller/OutRechargePriceController.java
  5. 4
      hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java
  6. 9
      hai-service/src/main/java/com/hai/service/OutRechargePriceService.java
  7. 15
      hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java
  8. 4
      hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java

@ -72,7 +72,8 @@ public class OutRechargePriceController {
if (outRechargePrice.getType() == null if (outRechargePrice.getType() == null
|| outRechargePrice.getPrice() == null || outRechargePrice.getPrice() == null
|| outRechargePrice.getRealPrice() == null || outRechargePrice.getRealPrice() == null
|| outRechargePrice.getGoodsId() == null // || outRechargePrice.getGoodsId() == null
|| outRechargePrice.getSort() == null
) { ) {
log.error("SecOrganizationController -> insertPrice() error!"); log.error("SecOrganizationController -> insertPrice() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -80,6 +81,7 @@ public class OutRechargePriceController {
outRechargePrice.setCreateTime(new Date()); outRechargePrice.setCreateTime(new Date());
outRechargePrice.setStatus(0);
outRechargePriceService.insertRechargePrice(outRechargePrice); outRechargePriceService.insertRechargePrice(outRechargePrice);
@ -100,7 +102,8 @@ public class OutRechargePriceController {
|| outRechargePrice.getId() == null || outRechargePrice.getId() == null
|| outRechargePrice.getPrice() == null || outRechargePrice.getPrice() == null
|| outRechargePrice.getRealPrice() == null || outRechargePrice.getRealPrice() == null
|| outRechargePrice.getGoodsId() == null // || outRechargePrice.getGoodsId() == null
|| outRechargePrice.getSort() == null
) { ) {
log.error("SecOrganizationController -> updatePrice() error!"); log.error("SecOrganizationController -> updatePrice() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -113,6 +116,7 @@ public class OutRechargePriceController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.UPDATE_DATA_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.UPDATE_DATA_ERROR, "");
} }
outRechargePrice.setStatus(0);
outRechargePrice.setCreateTime(outRechargePrice1.getCreateTime()); outRechargePrice.setCreateTime(outRechargePrice1.getCreateTime());
outRechargePriceService.updateRechargePrice(outRechargePrice); outRechargePriceService.updateRechargePrice(outRechargePrice);
@ -155,4 +159,28 @@ public class OutRechargePriceController {
} }
} }
@RequestMapping(value = "/onAndOffShelves", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "上下架")
public ResponseData onAndOffShelves(@RequestParam(value = "id", required = true) Long id) {
try {
OutRechargePrice outRechargePrice = outRechargePriceService.findById(id);
if (outRechargePrice.getStatus() == 1) {
outRechargePrice.setStatus(0);
} else {
outRechargePrice.setStatus(1);
}
outRechargePriceService.updateRechargePrice(outRechargePrice);
return ResponseMsgUtil.success("修改成功");
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -123,7 +123,6 @@ public class SecUserController {
|| StringUtils.isBlank(secUser.getUserName()) || StringUtils.isBlank(secUser.getUserName())
|| StringUtils.isBlank(secUser.getPassword()) || StringUtils.isBlank(secUser.getPassword())
|| StringUtils.isBlank(secUser.getLoginName()) || StringUtils.isBlank(secUser.getLoginName())
|| StringUtils.isBlank(secUser.getTelephone())
|| secUser.getRoleId() == null || secUser.getRoleId() == null
) { ) {
log.error("SecUserController --> addUser() error!", "参数错误"); log.error("SecUserController --> addUser() error!", "参数错误");
@ -164,8 +163,7 @@ public class SecUserController {
|| secUser.getOrganizationId() == null || secUser.getOrganizationId() == null
|| StringUtils.isBlank(secUser.getUserName()) || StringUtils.isBlank(secUser.getUserName())
|| StringUtils.isBlank(secUser.getPassword()) || StringUtils.isBlank(secUser.getPassword())
|| StringUtils.isBlank(secUser.getLoginName()) || StringUtils.isBlank(secUser.getLoginName())) {
|| StringUtils.isBlank(secUser.getTelephone())) {
log.error("SecUserController --> editUser() error!", "参数错误"); log.error("SecUserController --> editUser() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }

@ -106,31 +106,15 @@ public class OutRechargeOrderController {
String remarks = ""; String remarks = "";
// 支付类型 1.微信支付 // 支付类型 1.微信支付
outRechargeOrder.setPayType(1); outRechargeOrder.setPayType(1);
// 判断充值模式:1 话费充值 2. 中石化 3. 中石油 // 判断充值模式:1 电信 2. 移动 3. 联通
if (outRechargeOrder.getRechargeModel() == 1) { JSONObject telObject = telApiService.outApiTel(outRechargeOrder.getRechargeContent());
JSONObject telObject = telApiService.outApiTel(outRechargeOrder.getRechargeContent()); if (telObject.get("status").equals(0)) {
if (telObject.get("status").equals(0)) { JSONObject o = telObject.getObject("result",JSONObject.class);
JSONObject o = telObject.getObject("result",JSONObject.class); // 拼接内容
// 拼接内容 remarks = o.get("province").toString() + o.get("company").toString() + "充值" + outRechargeOrder.getOrderPrice() + "元";
remarks = o.get("province").toString() + o.get("company").toString() + "充值" + outRechargeOrder.getOrderPrice() + "元";
} else {
log.error("orderToPay error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.PHONE_NUM_IS_ERROR);
}
} else if (outRechargeOrder.getRechargeModel() == 2) {
remarks = "中石化充值" + outRechargeOrder.getOrderPrice() + "元";
} else if (outRechargeOrder.getRechargeModel() == 3 ) {
// 中石油需要姓名和身份证号
if (StringUtils.isBlank(outRechargeOrder.getRechargeName()) ||
StringUtils.isBlank(outRechargeOrder.getIdCard())
) {
log.error("orderToPay error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
remarks = "中石油充值" + outRechargeOrder.getOrderPrice() + "元";
} else { } else {
log.error("orderToPay error!"); log.error("orderToPay error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.PHONE_NUM_IS_ERROR);
} }
outRechargeOrder.setRemarks(remarks); outRechargeOrder.setRemarks(remarks);
outRechargeOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5)); outRechargeOrder.setOrderNo("CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5));

@ -57,7 +57,7 @@ public class OutRechargePriceController {
map.put("type", String.valueOf(type)); map.put("type", String.valueOf(type));
} }
return ResponseMsgUtil.success( outRechargePriceService.getListRechargePrice(map)); return ResponseMsgUtil.success( outRechargePriceService.getListRechargePriceC(map));
} catch (Exception e) { } catch (Exception e) {
log.error("OutRechargePriceController --> getListUser() error!", e); log.error("OutRechargePriceController --> getListUser() error!", e);
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);

@ -40,7 +40,7 @@ public class OutRechargeOrder implements Serializable {
private String userPhone; private String userPhone;
/** /**
* 充值模式1 话费充值 2. 中石化 3. 中石油 * 充值模式1 电信 2. 移动 3. 联通
*/ */
private Integer rechargeModel; private Integer rechargeModel;
@ -463,4 +463,4 @@ public class OutRechargeOrder implements Serializable {
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
} }

@ -16,6 +16,15 @@ public interface OutRechargePriceService {
**/ **/
List<OutRechargePrice> getListRechargePrice(Map<String , String> map); List<OutRechargePrice> getListRechargePrice(Map<String , String> map);
/**
* @Author Sum1Dream
* @Description //c端查询列表 Administrator
* @Date 17:38 2021/6/12
* @Param [map]
* @return java.util.List<com.hai.entity.OutRechargePrice>
**/
List<OutRechargePrice> getListRechargePriceC(Map<String , String> map);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @Description //查询详情 Administrator * @Description //查询详情 Administrator

@ -26,9 +26,22 @@ public class OutRechargePriceServiceImpl implements OutRechargePriceService {
criteria.andTypeEqualTo(Integer.valueOf(map.get("type"))); criteria.andTypeEqualTo(Integer.valueOf(map.get("type")));
} }
example.setOrderByClause("create_time desc"); example.setOrderByClause("type asc");
return outRechargePriceMapper.selectByExample(example); return outRechargePriceMapper.selectByExample(example);
} }
@Override
public List<OutRechargePrice> getListRechargePriceC(Map<String , String> map) {
OutRechargePriceExample example = new OutRechargePriceExample();
OutRechargePriceExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(map.get("type"))) {
criteria.andTypeEqualTo(Integer.valueOf(map.get("type")));
}
example.setOrderByClause("sort asc");
return outRechargePriceMapper.selectByExample(example);
}
@Override @Override
public OutRechargePrice findById(Long id) { public OutRechargePrice findById(Long id) {

@ -83,8 +83,8 @@ public class RechargeOrderServiceImpl implements PayService {
Map<String, Object> mapOrder = new HashMap<>(); Map<String, Object> mapOrder = new HashMap<>();
mapOrder.put("cardPhone", order.getRechargeContent()); mapOrder.put("cardPhone", order.getRechargeContent());
mapOrder.put("channel", outRechargePrice.getChannel()); // mapOrder.put("channel", outRechargePrice.getChannel());
mapOrder.put("goodsId", outRechargePrice.getGoodsId()); // mapOrder.put("goodsId", outRechargePrice.getGoodsId());
mapOrder.put("orderAmount", order.getOrderPrice()); mapOrder.put("orderAmount", order.getOrderPrice());
mapOrder.put("orderNumber", order.getOrderNo()); mapOrder.put("orderNumber", order.getOrderNo());
mapOrder.put("callbackUrl", CommonSysConst.getSysConfig().getCzOrderNotify()); mapOrder.put("callbackUrl", CommonSysConst.getSysConfig().getCzOrderNotify());

Loading…
Cancel
Save