ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysPaymentModeController.java
New file @@ -0,0 +1,37 @@ package com.stylefeng.guns.modular.system.controller.general; import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.modular.system.model.TSysPaymentMode; import com.stylefeng.guns.modular.system.service.ITSysPaymentModeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller @RequestMapping("/tSysPaymentMode") public class TSysPaymentModeController extends BaseController { @Autowired private ITSysPaymentModeService sysPaymentModeService; @RequestMapping("/index") public String index(Model model) { TSysPaymentMode paymentMode = sysPaymentModeService.getPaymentMode(); model.addAttribute("paymentMode", paymentMode); return "system/tOpenCity/tSysPaymentMode.html"; } @RequestMapping("/setUp") @ResponseBody public Object setUp(Integer privateType, Integer taxiType) { TSysPaymentMode paymentMode = sysPaymentModeService.getPaymentMode(); paymentMode.setPrivateType(privateType); paymentMode.setTaxiType(taxiType); sysPaymentModeService.updatePaymentMode(paymentMode); return SUCCESS_TIP; } } ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSysPaymentModeMapper.java
New file @@ -0,0 +1,7 @@ package com.stylefeng.guns.modular.system.dao; import com.baomidou.mybatisplus.mapper.BaseMapper; import com.stylefeng.guns.modular.system.model.TSysPaymentMode; public interface TSysPaymentModeMapper extends BaseMapper<TSysPaymentMode> { } ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSysPaymentMode.java
New file @@ -0,0 +1,56 @@ package com.stylefeng.guns.modular.system.model; import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.annotations.TableName; import com.baomidou.mybatisplus.enums.IdType; import java.io.Serializable; @TableName("t_sys_payment_mode") public class TSysPaymentMode implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Integer id; @TableField("private_type") private Integer privateType; @TableField("taxi_type") private Integer taxiType; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getPrivateType() { return privateType; } public void setPrivateType(Integer privateType) { this.privateType = privateType; } public Integer getTaxiType() { return taxiType; } public void setTaxiType(Integer taxiType) { this.taxiType = taxiType; } @Override public String toString() { return "TSysPaymentMode{" + "id=" + id + ", privateType=" + privateType + ", taxiType=" + taxiType + '}'; } } ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSysPaymentModeService.java
New file @@ -0,0 +1,11 @@ package com.stylefeng.guns.modular.system.service; import com.baomidou.mybatisplus.service.IService; import com.stylefeng.guns.modular.system.model.TSysPaymentMode; public interface ITSysPaymentModeService extends IService<TSysPaymentMode> { TSysPaymentMode getPaymentMode(); void updatePaymentMode(TSysPaymentMode paymentMode); } ManagementYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSysPaymentModeServiceImpl.java
New file @@ -0,0 +1,29 @@ package com.stylefeng.guns.modular.system.service.impl; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.modular.system.dao.TSysPaymentModeMapper; import com.stylefeng.guns.modular.system.model.TSysPaymentMode; import com.stylefeng.guns.modular.system.service.ITSysPaymentModeService; import org.springframework.stereotype.Service; @Service public class TSysPaymentModeServiceImpl extends ServiceImpl<TSysPaymentModeMapper, TSysPaymentMode> implements ITSysPaymentModeService { @Override public TSysPaymentMode getPaymentMode() { TSysPaymentMode paymentMode = selectOne(new EntityWrapper<TSysPaymentMode>()); if (paymentMode == null) { paymentMode = new TSysPaymentMode(); paymentMode.setPrivateType(1); paymentMode.setTaxiType(1); insert(paymentMode); } return paymentMode; } @Override public void updatePaymentMode(TSysPaymentMode paymentMode) { updateById(paymentMode); } } ManagementYKDTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOpenCity/tSysPaymentMode.html
New file @@ -0,0 +1,114 @@ @layout("/common/_container.html"){ <style> .newWidth, .single-line{ max-width:150px !important;display: initial !important; } .lab{ display: block; width: 150px; height: 45px; text-align: center; line-height: 45px; cursor: pointer; font-size: 16px; background-color: #F8F8F8; margin: 0; } .lab:hover{ background-color: #F3F4F5; } .checked{ background-color: #FFF !important; border-left: 10px solid #077CCB; } table{ width: 100%; } tr{ height: 40px; } th, td{ text-align: center; border: 1px solid #F4F4F4; } </style> <div class="ibox float-e-margins"> <div class="ibox-content"> <div class="form-horizontal"> <div class="row"> <div class="col-sm-11"> <div class="ibox-title"> <h3>支付模式设置:</h3> </div> <div> <div style="float: left;width: 1200px;margin-left: 50px;"> <div class="paymentModeSettings"> <div class="form-group"> <label class="col-sm-2 control-label">快车:</label> <div class="col-sm-10"> <div class="radio radio-danger"> <input type="radio" name="privateType" id="privateType1" value="1" ${isNotEmpty(paymentMode) && 1 == paymentMode.privateType ? 'checked=checked' : 'checked=checked'}> <label for="privateType1"> 预付模式 </label> </div> <div class="radio radio-danger"> <input type="radio" name="privateType" id="privateType2" value="2" ${isNotEmpty(paymentMode) && 2 == paymentMode.privateType ? 'checked=checked' : ''}> <label for="privateType2"> 后付模式 </label> </div> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">出租车:</label> <div class="col-sm-10"> <div class="radio radio-danger"> <input type="radio" name="taxiType" id="taxiType1" value="1" ${isNotEmpty(paymentMode) && 1 == paymentMode.taxiType ? 'checked=checked' : 'checked=checked'}> <label for="taxiType1"> 预付模式 </label> </div> <div class="radio radio-danger"> <input type="radio" name="taxiType" id="taxiType2" value="2" ${isNotEmpty(paymentMode) && 2 == paymentMode.taxiType ? 'checked=checked' : ''}> <label for="taxiType2"> 后付模式 </label> </div> </div> </div> <div class="row btn-group-m-t"> <div class="col-sm-10 col-sm-offset-5"> <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="setUp()"/> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <script> function setUp() { var privateType = $ ("input[name='privateType']:checked").val(); var taxiType = $ ("input[name='taxiType']:checked").val(); var ajax = new $ax(Feng.ctxPath + "/tSysPaymentMode/setUp", function(data){ Feng.success("操作成功!"); location.reload(); },function(data){ Feng.error("操作失败!" + data.responseJSON.message + "!"); }); ajax.set("privateType", privateType); ajax.set("taxiType", taxiType); ajax.start(); } </script> @}