Merge branch 'script_gj' of http://gitlab.fangjia.com/dev0/main into script_gj
This commit is contained in:
+4
@@ -102,6 +102,7 @@ public class ApiUserController {
|
||||
bo.setPurpose(apiUser.getPurpose());
|
||||
bo.setDeadTime(apiUser.getDeadTime());
|
||||
bo.setManager(apiUser.getManager());
|
||||
bo.setIsMonitor(apiUser.getIsMonitor());
|
||||
|
||||
apiUserBoList.add(bo);
|
||||
}
|
||||
@@ -183,6 +184,7 @@ public class ApiUserController {
|
||||
apiUser.setModificationDate(date);
|
||||
apiUser.setDeadTime(model.getDeadTime());
|
||||
apiUser.setManager(model.getManager());
|
||||
apiUser.setIsMonitor(model.getIsMonitor());
|
||||
this.apiUserService.save(apiUser);
|
||||
if(model.getEvaluateRate() != null && model.getEvaluateRate() != 0){
|
||||
ApiUserCfg apiUserCfg = new ApiUserCfg();
|
||||
@@ -222,6 +224,7 @@ public class ApiUserController {
|
||||
bo.setEmail(apiUser.getEmail());
|
||||
bo.setDeadTime(apiUser.getDeadTime());
|
||||
bo.setManager(apiUser.getManager());
|
||||
bo.setIsMonitor(apiUser.getIsMonitor());
|
||||
ApiUserCfg apiUserCfg_rate = apiUserCfgService.findByUserId(apiUser.getId(), ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE);
|
||||
if(apiUserCfg_rate != null){
|
||||
bo.setEvaluateRate((Double) apiUserCfg_rate.getCfgValue());
|
||||
@@ -272,6 +275,7 @@ public class ApiUserController {
|
||||
dataApiUser.put("purpose", model.getPurpose());
|
||||
dataApiUser.put("deadTime", model.getDeadTime());
|
||||
dataApiUser.put("manager", model.getManager());
|
||||
dataApiUser.put("isMonitor", model.getIsMonitor());
|
||||
this.apiUserService.update(dataApiUser, userId);
|
||||
|
||||
//ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE
|
||||
|
||||
+19
-20
@@ -1,7 +1,9 @@
|
||||
package com.fangjia.bkoff.controllers;
|
||||
|
||||
import com.fangjia.bkoff.model.ApiUserModel;
|
||||
import com.fangjia.bkoff.model.BuildingRatioModel;
|
||||
import com.fangjia.dal.mongo.model.bkoff.BuildingRatio;
|
||||
import com.fangjia.dal.sql.model.User;
|
||||
import com.fangjia.service.bo.BuildingRatioBo;
|
||||
import com.fangjia.service.mongo.bkoff.BuildingRatioService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -24,14 +26,11 @@ public class BuildingRatioController {
|
||||
* @return
|
||||
*/
|
||||
public Object doAddAction(BuildingRatioModel model) throws Exception {
|
||||
if (StringUtils.isBlank(model.getCity_name()) || StringUtils.isBlank(model.getRegion())
|
||||
|| StringUtils.isBlank(model.getDistrict()) || StringUtils.isBlank(model.getBuilding_name())
|
||||
|| model.getRatio() == null || StringUtils.isBlank(model.getCreate_user())) {
|
||||
model.setMsg("城市,区域,小区,楼栋名称,楼栋系数,创建人不能为空");
|
||||
model.forward("/buildingRatio/add");
|
||||
return model;
|
||||
}
|
||||
try {
|
||||
if(checkBuildingNameAction(model)){
|
||||
model.redirect("/buildingRatio/add?msg=" + URLEncoder.encode(model.getMsg(), "UTF-8"));
|
||||
return model;
|
||||
}
|
||||
Date date = new Date();
|
||||
BuildingRatio buildingRatio = new BuildingRatio();
|
||||
buildingRatio.setCity(model.getCity_name());
|
||||
@@ -69,18 +68,7 @@ public class BuildingRatioController {
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
public Object updateAction(BuildingRatioModel model){
|
||||
String id = model.getId();
|
||||
if (StringUtils.isBlank(model.getCity_name()) ||
|
||||
StringUtils.isBlank(model.getRegion()) ||
|
||||
StringUtils.isBlank(model.getDistrict()) ||
|
||||
StringUtils.isBlank(model.getBuilding_name()) ||
|
||||
model.getRatio() == null || StringUtils.isBlank(model.getCreate_user())) {
|
||||
model.setMsg("城市,区域,小区,楼栋名称,楼栋系数,创建人不能为空");
|
||||
model.forward("/buildingRatio/edit");
|
||||
return model;
|
||||
}
|
||||
|
||||
public Object updateAction(BuildingRatioModel model) throws Exception {
|
||||
Map<String, Object> data_buildingRatio = new HashMap<String, Object>();
|
||||
|
||||
data_buildingRatio.put("id", model.getId());
|
||||
@@ -103,7 +91,7 @@ public class BuildingRatioController {
|
||||
|
||||
public Object listAction(BuildingRatioModel model) {
|
||||
|
||||
List<BuildingRatio> buildingRatioList = this.buildingRatioService.findAllByDistrict(model.getCity_name(),model.getRegion(),model.getDistrict());
|
||||
List<BuildingRatio> buildingRatioList = this.buildingRatioService.findAllByBuildingName(model.getCity_name(),model.getRegion(),model.getDistrict(),model.getBuilding_name());
|
||||
|
||||
List<BuildingRatioBo> buildingRatioBoList = new ArrayList<BuildingRatioBo>();
|
||||
|
||||
@@ -158,6 +146,17 @@ public class BuildingRatioController {
|
||||
return model;
|
||||
}
|
||||
|
||||
public boolean checkBuildingNameAction(BuildingRatioModel model) {
|
||||
model.setViewType("json");
|
||||
model.setViewParam("config", null);
|
||||
List<BuildingRatio> buildingRatioList = buildingRatioService.findAllByBuildingName(model.getCity_name(),model.getRegion(),model.getDistrict(),model.getBuilding_name());
|
||||
if (buildingRatioList.size()>0) {
|
||||
model.setMsg("此楼栋名称已经存在!");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public BuildingRatioService getBuildingRatioService() {
|
||||
return buildingRatioService;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ public class ApiUserModel extends BaseModel {
|
||||
private Integer creditLevelStatus;
|
||||
private String priceType;
|
||||
private Map<String,Double> priceRatingMap;
|
||||
private Integer isMonitor;
|
||||
|
||||
public String getPriceType() {
|
||||
return priceType;
|
||||
@@ -606,4 +607,12 @@ public class ApiUserModel extends BaseModel {
|
||||
public void setManager(String manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public Integer getIsMonitor() {
|
||||
return isMonitor;
|
||||
}
|
||||
|
||||
public void setIsMonitor(Integer isMonitor) {
|
||||
this.isMonitor = isMonitor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,13 +57,20 @@
|
||||
<td>账户用途</td>
|
||||
<td>
|
||||
<select name="purpose">
|
||||
<option value="" >请选择</option>
|
||||
<option value="" >请选择</option>
|
||||
<option value="1" >API</option>
|
||||
<option value="2" >PDS</option>
|
||||
<option value="4" >房生活</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>是否监控</td>
|
||||
<td>
|
||||
<input type="radio" name="isMonitor" value="0" checked="checked"/>不监控
|
||||
<input type="radio" name="isMonitor" value="1" style="margin-left: 15px;"/>监控
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email</td>
|
||||
<td><input name="email" value="${email!}" /></td>
|
||||
|
||||
@@ -72,6 +72,13 @@
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>是否监控</td>
|
||||
<td>
|
||||
<input type="radio" <#if apiUserBo?? && apiUserBo.isMonitor?? && apiUserBo.isMonitor == 0>checked="checked"</#if> name="isMonitor" value="0" />不监控
|
||||
<input type="radio" <#if apiUserBo?? && apiUserBo.isMonitor?? && apiUserBo.isMonitor == 1>checked="checked"</#if> name="isMonitor" value="1" style="margin-left: 15px;"/>监控
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email</td>
|
||||
<td><input name="email" value="${apiUserBo.email!}"/></td>
|
||||
|
||||
@@ -53,6 +53,9 @@
|
||||
<th align="center" width="60px">
|
||||
账户用途
|
||||
</th>
|
||||
<th align="center" width="60px">
|
||||
是否监控
|
||||
</th>
|
||||
<th align="center" width="120px">
|
||||
到期时间
|
||||
</th>
|
||||
@@ -114,6 +117,13 @@
|
||||
房生活
|
||||
</#if>
|
||||
</td>
|
||||
<td>
|
||||
<#if bo.isMonitor==1>
|
||||
是
|
||||
<#else>
|
||||
否
|
||||
</#if>
|
||||
</td>
|
||||
<td align="center">
|
||||
<#if bo.deadTime??>
|
||||
${bo.deadTime?string("yyyy年MM月dd日")}
|
||||
|
||||
@@ -67,6 +67,37 @@
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function submitForm(){
|
||||
var city_name = $("input[name='city_name']").val();
|
||||
var region = $("input[name='region']").val();
|
||||
var district = $("input[name='district']").val();
|
||||
var building_name = $("input[name='building_name']").val();
|
||||
var ratio = $("input[name='ratio']").val();
|
||||
var create_user = $("input[name='create_user']").val();
|
||||
|
||||
if(typeof(city_name) == "undefined" || city_name == ""){
|
||||
alert("城市不能为空");
|
||||
return false;
|
||||
}
|
||||
if(typeof(region) == "undefined" || region == ""){
|
||||
alert("区域不能为空");
|
||||
return false;
|
||||
}
|
||||
if(typeof(district) == "undefined" || district == ""){
|
||||
alert("小区名称不能为空");
|
||||
return false;
|
||||
}
|
||||
if(typeof(building_name) == "undefined" || building_name == ""){
|
||||
alert("楼栋名称不能为空");
|
||||
return false;
|
||||
}
|
||||
if(typeof(ratio) == "undefined" || ratio == ""){
|
||||
alert("楼栋系数不能为空");
|
||||
return false;
|
||||
}
|
||||
if(typeof(create_user) == "undefined" || create_user == ""){
|
||||
alert("创建人不能为空");
|
||||
return false;
|
||||
}
|
||||
$("#addForm").submit();
|
||||
}
|
||||
var getErrorValidate= function(mess){
|
||||
|
||||
@@ -73,6 +73,37 @@
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function submitForm() {
|
||||
var city_name = $("input[name='city_name']").val();
|
||||
var region = $("input[name='region']").val();
|
||||
var district = $("input[name='district']").val();
|
||||
var building_name = $("input[name='building_name']").val();
|
||||
var ratio = $("input[name='ratio']").val();
|
||||
var create_user = $("input[name='create_user']").val();
|
||||
|
||||
if(typeof(city_name) == "undefined" || city_name == ""){
|
||||
alert("城市不能为空");
|
||||
return false;
|
||||
}
|
||||
if(typeof(region) == "undefined" || region == ""){
|
||||
alert("区域不能为空");
|
||||
return false;
|
||||
}
|
||||
if(typeof(district) == "undefined" || district == ""){
|
||||
alert("小区名称不能为空");
|
||||
return false;
|
||||
}
|
||||
if(typeof(building_name) == "undefined" || building_name == ""){
|
||||
alert("楼栋名称不能为空");
|
||||
return false;
|
||||
}
|
||||
if(typeof(ratio) == "undefined" || ratio == ""){
|
||||
alert("楼栋系数不能为空");
|
||||
return false;
|
||||
}
|
||||
if(typeof(create_user) == "undefined" || create_user == ""){
|
||||
alert("创建人不能为空");
|
||||
return false;
|
||||
}
|
||||
$("#submitForm").attr("action", "update");
|
||||
$("#submitForm").submit();
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ public class ApiUser implements SqlEntity {
|
||||
|
||||
private String manager;
|
||||
|
||||
private Integer isMonitor;
|
||||
|
||||
@Id
|
||||
@Column(name = "ID")
|
||||
public long getId() {
|
||||
@@ -175,4 +177,12 @@ public class ApiUser implements SqlEntity {
|
||||
public void setManager(String manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
@Column(name = "IS_MONITOR")
|
||||
public Integer getIsMonitor() {
|
||||
return isMonitor;
|
||||
}
|
||||
|
||||
public void setIsMonitor(Integer isMonitor) {
|
||||
this.isMonitor = isMonitor;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,5 +14,5 @@ public interface BuildingRatioService {
|
||||
public void deleteById(String id);
|
||||
public void saveOrUpdateByBuildingName(String city, String region, String district, String building_name, Map<String, Object> data);
|
||||
public BuildingRatio findBuildingRatioById(String id);
|
||||
public List<BuildingRatio> findAllByDistrict(String city, String region, String district);
|
||||
public List<BuildingRatio> findAllByBuildingName(String city, String region, String district, String building_name);
|
||||
}
|
||||
|
||||
+4
-1
@@ -50,7 +50,7 @@ public class BuildingRatioServiceImpl implements BuildingRatioService{
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BuildingRatio> findAllByDistrict(String city, String region, String district) {
|
||||
public List<BuildingRatio> findAllByBuildingName(String city, String region, String district, String building_name) {
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
if(StringUtils.isNotBlank(city)){
|
||||
params.add(new QueryParam("city", city));
|
||||
@@ -61,6 +61,9 @@ public class BuildingRatioServiceImpl implements BuildingRatioService{
|
||||
if(StringUtils.isNotBlank(district)){
|
||||
params.add(new QueryParam("district", district));
|
||||
}
|
||||
if(StringUtils.isNotBlank(building_name)){
|
||||
params.add(new QueryParam("building_name", building_name));
|
||||
}
|
||||
|
||||
List<SortParam> sortParams = new ArrayList<SortParam>();
|
||||
sortParams.add(new SortParam("m_date", false));
|
||||
|
||||
@@ -26,6 +26,7 @@ public class ApiUserBo implements Serializable {
|
||||
private Date deadTime;
|
||||
private String manager;
|
||||
private String priceType;
|
||||
private Integer isMonitor;
|
||||
|
||||
public String getPriceType() {
|
||||
return priceType;
|
||||
@@ -162,4 +163,12 @@ public class ApiUserBo implements Serializable {
|
||||
public void setManager(String manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public Integer getIsMonitor() {
|
||||
return isMonitor;
|
||||
}
|
||||
|
||||
public void setIsMonitor(Integer isMonitor) {
|
||||
this.isMonitor = isMonitor;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user