Commit 7a436d1c authored by 季圣华's avatar 季圣华
Browse files

!14 格式化代码,看着有点别扭

Merge pull request !14 from SmkfGao/master
parents 8f304964 6bc92ec9
......@@ -20,19 +20,19 @@ import java.util.Map;
/*
* 商品属性
* @author ji s h e n g hua qq:75 27 18 920
*/
*/
@SuppressWarnings("serial")
public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
{
public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel> {
private MaterialPropertyIService materialPropertyService;
private MaterialPropertyModel model = new MaterialPropertyModel();
/**
* 更新商品属性
* @return
*/
public void update() {
Boolean flag = false;
/**
* 更新商品属性
*
* @return
*/
public void update() {
Boolean flag = false;
try {
MaterialProperty materialProperty = materialPropertyService.get(model.getId());
materialProperty.setNativeName(model.getNativeName());
......@@ -40,37 +40,35 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
materialProperty.setSort(model.getSort());
materialProperty.setAnotherName(model.getAnotherName());
materialPropertyService.update(materialProperty);
flag = true;
tipMsg = "成功";
tipType = 0;
}
catch (DataAccessException e) {
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>修改商品属性ID为 : " + model.getId() + "失败", e);
flag = false;
tipMsg = "失败";
tipType = 1;
}
finally {
} finally {
try {
toClient(flag.toString());
}
catch (IOException e) {
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>修改商品属性回写客户端结果异常", e);
}
}
logService.create(new Logdetails(getUser(), "更新商品属性", model.getClientIp(),
new Timestamp(System.currentTimeMillis())
, tipType, "更新商品属性ID为 "+ model.getId() + " " + tipMsg + "!", "更新商品属性" + tipMsg));
}
/**
* 查找商品属性
* @return
*/
, tipType, "更新商品属性ID为 " + model.getId() + " " + tipMsg + "!", "更新商品属性" + tipMsg));
}
/**
* 查找商品属性
*
* @return
*/
public void findBy() {
try {
PageUtil<MaterialProperty> pageUtil = new PageUtil<MaterialProperty>();
try {
PageUtil<MaterialProperty> pageUtil = new PageUtil<MaterialProperty>();
pageUtil.setPageSize(0);
pageUtil.setCurPage(0);
pageUtil.setAdvSearch(getCondition());
......@@ -81,8 +79,8 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
outer.put("total", pageUtil.getTotalCount());
//存放数据json数组
JSONArray dataArray = new JSONArray();
if(null != dataList) {
for(MaterialProperty materialProperty:dataList) {
if (null != dataList) {
for (MaterialProperty materialProperty : dataList) {
JSONObject item = new JSONObject();
item.put("id", materialProperty.getId());
item.put("nativeName", materialProperty.getNativeName());
......@@ -95,38 +93,35 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
outer.put("rows", dataArray);
//回写查询结果
toClient(outer.toString());
}
catch (DataAccessException e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品属性异常", e);
}
catch (IOException e)
{
} catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品属性异常", e);
} catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品属性结果异常", e);
}
}
/**
* 拼接搜索条件
* @return
*/
private Map<String,Object> getCondition()
{
}
/**
* 拼接搜索条件
*
* @return
*/
private Map<String, Object> getCondition() {
/**
* 拼接搜索条件
*/
Map<String,Object> condition = new HashMap<String,Object>();
Map<String, Object> condition = new HashMap<String, Object>();
condition.put("nativeName_s_like", model.getNativeName());
condition.put("sort_s_order", "asc");
return condition;
}
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
@Override
public MaterialPropertyModel getModel() {
return model;
}
public void setMaterialPropertyService(MaterialPropertyIService materialPropertyService) {
//=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
@Override
public MaterialPropertyModel getModel() {
return model;
}
public void setMaterialPropertyService(MaterialPropertyIService materialPropertyService) {
this.materialPropertyService = materialPropertyService;
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment