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.setPurpose(apiUser.getPurpose());
|
||||||
bo.setDeadTime(apiUser.getDeadTime());
|
bo.setDeadTime(apiUser.getDeadTime());
|
||||||
bo.setManager(apiUser.getManager());
|
bo.setManager(apiUser.getManager());
|
||||||
|
bo.setIsMonitor(apiUser.getIsMonitor());
|
||||||
|
|
||||||
apiUserBoList.add(bo);
|
apiUserBoList.add(bo);
|
||||||
}
|
}
|
||||||
@@ -183,6 +184,7 @@ public class ApiUserController {
|
|||||||
apiUser.setModificationDate(date);
|
apiUser.setModificationDate(date);
|
||||||
apiUser.setDeadTime(model.getDeadTime());
|
apiUser.setDeadTime(model.getDeadTime());
|
||||||
apiUser.setManager(model.getManager());
|
apiUser.setManager(model.getManager());
|
||||||
|
apiUser.setIsMonitor(model.getIsMonitor());
|
||||||
this.apiUserService.save(apiUser);
|
this.apiUserService.save(apiUser);
|
||||||
if(model.getEvaluateRate() != null && model.getEvaluateRate() != 0){
|
if(model.getEvaluateRate() != null && model.getEvaluateRate() != 0){
|
||||||
ApiUserCfg apiUserCfg = new ApiUserCfg();
|
ApiUserCfg apiUserCfg = new ApiUserCfg();
|
||||||
@@ -222,6 +224,7 @@ public class ApiUserController {
|
|||||||
bo.setEmail(apiUser.getEmail());
|
bo.setEmail(apiUser.getEmail());
|
||||||
bo.setDeadTime(apiUser.getDeadTime());
|
bo.setDeadTime(apiUser.getDeadTime());
|
||||||
bo.setManager(apiUser.getManager());
|
bo.setManager(apiUser.getManager());
|
||||||
|
bo.setIsMonitor(apiUser.getIsMonitor());
|
||||||
ApiUserCfg apiUserCfg_rate = apiUserCfgService.findByUserId(apiUser.getId(), ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE);
|
ApiUserCfg apiUserCfg_rate = apiUserCfgService.findByUserId(apiUser.getId(), ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE);
|
||||||
if(apiUserCfg_rate != null){
|
if(apiUserCfg_rate != null){
|
||||||
bo.setEvaluateRate((Double) apiUserCfg_rate.getCfgValue());
|
bo.setEvaluateRate((Double) apiUserCfg_rate.getCfgValue());
|
||||||
@@ -272,6 +275,7 @@ public class ApiUserController {
|
|||||||
dataApiUser.put("purpose", model.getPurpose());
|
dataApiUser.put("purpose", model.getPurpose());
|
||||||
dataApiUser.put("deadTime", model.getDeadTime());
|
dataApiUser.put("deadTime", model.getDeadTime());
|
||||||
dataApiUser.put("manager", model.getManager());
|
dataApiUser.put("manager", model.getManager());
|
||||||
|
dataApiUser.put("isMonitor", model.getIsMonitor());
|
||||||
this.apiUserService.update(dataApiUser, userId);
|
this.apiUserService.update(dataApiUser, userId);
|
||||||
|
|
||||||
//ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE
|
//ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE
|
||||||
|
|||||||
+19
-20
@@ -1,7 +1,9 @@
|
|||||||
package com.fangjia.bkoff.controllers;
|
package com.fangjia.bkoff.controllers;
|
||||||
|
|
||||||
|
import com.fangjia.bkoff.model.ApiUserModel;
|
||||||
import com.fangjia.bkoff.model.BuildingRatioModel;
|
import com.fangjia.bkoff.model.BuildingRatioModel;
|
||||||
import com.fangjia.dal.mongo.model.bkoff.BuildingRatio;
|
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.bo.BuildingRatioBo;
|
||||||
import com.fangjia.service.mongo.bkoff.BuildingRatioService;
|
import com.fangjia.service.mongo.bkoff.BuildingRatioService;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -24,14 +26,11 @@ public class BuildingRatioController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object doAddAction(BuildingRatioModel model) throws Exception {
|
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 {
|
try {
|
||||||
|
if(checkBuildingNameAction(model)){
|
||||||
|
model.redirect("/buildingRatio/add?msg=" + URLEncoder.encode(model.getMsg(), "UTF-8"));
|
||||||
|
return model;
|
||||||
|
}
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
BuildingRatio buildingRatio = new BuildingRatio();
|
BuildingRatio buildingRatio = new BuildingRatio();
|
||||||
buildingRatio.setCity(model.getCity_name());
|
buildingRatio.setCity(model.getCity_name());
|
||||||
@@ -69,18 +68,7 @@ public class BuildingRatioController {
|
|||||||
* @param model
|
* @param model
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object updateAction(BuildingRatioModel model){
|
public Object updateAction(BuildingRatioModel model) throws Exception {
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, Object> data_buildingRatio = new HashMap<String, Object>();
|
Map<String, Object> data_buildingRatio = new HashMap<String, Object>();
|
||||||
|
|
||||||
data_buildingRatio.put("id", model.getId());
|
data_buildingRatio.put("id", model.getId());
|
||||||
@@ -103,7 +91,7 @@ public class BuildingRatioController {
|
|||||||
|
|
||||||
public Object listAction(BuildingRatioModel model) {
|
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>();
|
List<BuildingRatioBo> buildingRatioBoList = new ArrayList<BuildingRatioBo>();
|
||||||
|
|
||||||
@@ -158,6 +146,17 @@ public class BuildingRatioController {
|
|||||||
return model;
|
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() {
|
public BuildingRatioService getBuildingRatioService() {
|
||||||
return buildingRatioService;
|
return buildingRatioService;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class ApiUserModel extends BaseModel {
|
|||||||
private Integer creditLevelStatus;
|
private Integer creditLevelStatus;
|
||||||
private String priceType;
|
private String priceType;
|
||||||
private Map<String,Double> priceRatingMap;
|
private Map<String,Double> priceRatingMap;
|
||||||
|
private Integer isMonitor;
|
||||||
|
|
||||||
public String getPriceType() {
|
public String getPriceType() {
|
||||||
return priceType;
|
return priceType;
|
||||||
@@ -606,4 +607,12 @@ public class ApiUserModel extends BaseModel {
|
|||||||
public void setManager(String manager) {
|
public void setManager(String manager) {
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getIsMonitor() {
|
||||||
|
return isMonitor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsMonitor(Integer isMonitor) {
|
||||||
|
this.isMonitor = isMonitor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,13 +57,20 @@
|
|||||||
<td>账户用途</td>
|
<td>账户用途</td>
|
||||||
<td>
|
<td>
|
||||||
<select name="purpose">
|
<select name="purpose">
|
||||||
<option value="" >请选择</option>
|
<option value="" >请选择</option>
|
||||||
<option value="1" >API</option>
|
<option value="1" >API</option>
|
||||||
<option value="2" >PDS</option>
|
<option value="2" >PDS</option>
|
||||||
<option value="4" >房生活</option>
|
<option value="4" >房生活</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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>
|
<tr>
|
||||||
<td>Email</td>
|
<td>Email</td>
|
||||||
<td><input name="email" value="${email!}" /></td>
|
<td><input name="email" value="${email!}" /></td>
|
||||||
|
|||||||
@@ -72,6 +72,13 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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>
|
<tr>
|
||||||
<td>Email</td>
|
<td>Email</td>
|
||||||
<td><input name="email" value="${apiUserBo.email!}"/></td>
|
<td><input name="email" value="${apiUserBo.email!}"/></td>
|
||||||
|
|||||||
@@ -53,6 +53,9 @@
|
|||||||
<th align="center" width="60px">
|
<th align="center" width="60px">
|
||||||
账户用途
|
账户用途
|
||||||
</th>
|
</th>
|
||||||
|
<th align="center" width="60px">
|
||||||
|
是否监控
|
||||||
|
</th>
|
||||||
<th align="center" width="120px">
|
<th align="center" width="120px">
|
||||||
到期时间
|
到期时间
|
||||||
</th>
|
</th>
|
||||||
@@ -114,6 +117,13 @@
|
|||||||
房生活
|
房生活
|
||||||
</#if>
|
</#if>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<#if bo.isMonitor==1>
|
||||||
|
是
|
||||||
|
<#else>
|
||||||
|
否
|
||||||
|
</#if>
|
||||||
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<#if bo.deadTime??>
|
<#if bo.deadTime??>
|
||||||
${bo.deadTime?string("yyyy年MM月dd日")}
|
${bo.deadTime?string("yyyy年MM月dd日")}
|
||||||
|
|||||||
@@ -67,6 +67,37 @@
|
|||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function submitForm(){
|
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();
|
$("#addForm").submit();
|
||||||
}
|
}
|
||||||
var getErrorValidate= function(mess){
|
var getErrorValidate= function(mess){
|
||||||
|
|||||||
@@ -73,6 +73,37 @@
|
|||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function submitForm() {
|
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").attr("action", "update");
|
||||||
$("#submitForm").submit();
|
$("#submitForm").submit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ public class ApiUser implements SqlEntity {
|
|||||||
|
|
||||||
private String manager;
|
private String manager;
|
||||||
|
|
||||||
|
private Integer isMonitor;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "ID")
|
@Column(name = "ID")
|
||||||
public long getId() {
|
public long getId() {
|
||||||
@@ -175,4 +177,12 @@ public class ApiUser implements SqlEntity {
|
|||||||
public void setManager(String manager) {
|
public void setManager(String manager) {
|
||||||
this.manager = 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 deleteById(String id);
|
||||||
public void saveOrUpdateByBuildingName(String city, String region, String district, String building_name, Map<String, Object> data);
|
public void saveOrUpdateByBuildingName(String city, String region, String district, String building_name, Map<String, Object> data);
|
||||||
public BuildingRatio findBuildingRatioById(String id);
|
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
|
@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>();
|
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||||
if(StringUtils.isNotBlank(city)){
|
if(StringUtils.isNotBlank(city)){
|
||||||
params.add(new QueryParam("city", city));
|
params.add(new QueryParam("city", city));
|
||||||
@@ -61,6 +61,9 @@ public class BuildingRatioServiceImpl implements BuildingRatioService{
|
|||||||
if(StringUtils.isNotBlank(district)){
|
if(StringUtils.isNotBlank(district)){
|
||||||
params.add(new QueryParam("district", 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>();
|
List<SortParam> sortParams = new ArrayList<SortParam>();
|
||||||
sortParams.add(new SortParam("m_date", false));
|
sortParams.add(new SortParam("m_date", false));
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class ApiUserBo implements Serializable {
|
|||||||
private Date deadTime;
|
private Date deadTime;
|
||||||
private String manager;
|
private String manager;
|
||||||
private String priceType;
|
private String priceType;
|
||||||
|
private Integer isMonitor;
|
||||||
|
|
||||||
public String getPriceType() {
|
public String getPriceType() {
|
||||||
return priceType;
|
return priceType;
|
||||||
@@ -162,4 +163,12 @@ public class ApiUserBo implements Serializable {
|
|||||||
public void setManager(String manager) {
|
public void setManager(String manager) {
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getIsMonitor() {
|
||||||
|
return isMonitor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsMonitor(Integer isMonitor) {
|
||||||
|
this.isMonitor = isMonitor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user