"git@ustchcs.com:gujinli1118/MCMS.git" did not exist on "7bf4c8549d52de40a78f9a09ef2ae860d579707d"
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; ...@@ -20,19 +20,19 @@ import java.util.Map;
/* /*
* 商品属性 * 商品属性
* @author ji s h e n g hua qq:75 27 18 920 * @author ji s h e n g hua qq:75 27 18 920
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel> public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel> {
{
private MaterialPropertyIService materialPropertyService; private MaterialPropertyIService materialPropertyService;
private MaterialPropertyModel model = new MaterialPropertyModel(); private MaterialPropertyModel model = new MaterialPropertyModel();
/** /**
* 更新商品属性 * 更新商品属性
* @return *
*/ * @return
public void update() { */
Boolean flag = false; public void update() {
Boolean flag = false;
try { try {
MaterialProperty materialProperty = materialPropertyService.get(model.getId()); MaterialProperty materialProperty = materialPropertyService.get(model.getId());
materialProperty.setNativeName(model.getNativeName()); materialProperty.setNativeName(model.getNativeName());
...@@ -40,37 +40,35 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel> ...@@ -40,37 +40,35 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
materialProperty.setSort(model.getSort()); materialProperty.setSort(model.getSort());
materialProperty.setAnotherName(model.getAnotherName()); materialProperty.setAnotherName(model.getAnotherName());
materialPropertyService.update(materialProperty); materialPropertyService.update(materialProperty);
flag = true; flag = true;
tipMsg = "成功"; tipMsg = "成功";
tipType = 0; tipType = 0;
} } catch (DataAccessException e) {
catch (DataAccessException e) {
Log.errorFileSync(">>>>>>>>>>>>>修改商品属性ID为 : " + model.getId() + "失败", e); Log.errorFileSync(">>>>>>>>>>>>>修改商品属性ID为 : " + model.getId() + "失败", e);
flag = false; flag = false;
tipMsg = "失败"; tipMsg = "失败";
tipType = 1; tipType = 1;
} } finally {
finally {
try { try {
toClient(flag.toString()); toClient(flag.toString());
} } catch (IOException e) {
catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>修改商品属性回写客户端结果异常", e); Log.errorFileSync(">>>>>>>>>>>>修改商品属性回写客户端结果异常", e);
} }
} }
logService.create(new Logdetails(getUser(), "更新商品属性", model.getClientIp(), logService.create(new Logdetails(getUser(), "更新商品属性", model.getClientIp(),
new Timestamp(System.currentTimeMillis()) new Timestamp(System.currentTimeMillis())
, tipType, "更新商品属性ID为 "+ model.getId() + " " + tipMsg + "!", "更新商品属性" + tipMsg)); , tipType, "更新商品属性ID为 " + model.getId() + " " + tipMsg + "!", "更新商品属性" + tipMsg));
} }
/** /**
* 查找商品属性 * 查找商品属性
* @return *
*/ * @return
*/
public void findBy() { public void findBy() {
try { try {
PageUtil<MaterialProperty> pageUtil = new PageUtil<MaterialProperty>(); PageUtil<MaterialProperty> pageUtil = new PageUtil<MaterialProperty>();
pageUtil.setPageSize(0); pageUtil.setPageSize(0);
pageUtil.setCurPage(0); pageUtil.setCurPage(0);
pageUtil.setAdvSearch(getCondition()); pageUtil.setAdvSearch(getCondition());
...@@ -81,8 +79,8 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel> ...@@ -81,8 +79,8 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
outer.put("total", pageUtil.getTotalCount()); outer.put("total", pageUtil.getTotalCount());
//存放数据json数组 //存放数据json数组
JSONArray dataArray = new JSONArray(); JSONArray dataArray = new JSONArray();
if(null != dataList) { if (null != dataList) {
for(MaterialProperty materialProperty:dataList) { for (MaterialProperty materialProperty : dataList) {
JSONObject item = new JSONObject(); JSONObject item = new JSONObject();
item.put("id", materialProperty.getId()); item.put("id", materialProperty.getId());
item.put("nativeName", materialProperty.getNativeName()); item.put("nativeName", materialProperty.getNativeName());
...@@ -95,38 +93,35 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel> ...@@ -95,38 +93,35 @@ public class MaterialPropertyAction extends BaseAction<MaterialPropertyModel>
outer.put("rows", dataArray); outer.put("rows", dataArray);
//回写查询结果 //回写查询结果
toClient(outer.toString()); toClient(outer.toString());
} } catch (DataAccessException e) {
catch (DataAccessException e) Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品属性异常", e);
{ } catch (IOException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品属性异常", e);
}
catch (IOException e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品属性结果异常", e); Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品属性结果异常", e);
} }
} }
/** /**
* 拼接搜索条件 * 拼接搜索条件
* @return *
*/ * @return
private Map<String,Object> getCondition() */
{ 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("nativeName_s_like", model.getNativeName());
condition.put("sort_s_order", "asc"); condition.put("sort_s_order", "asc");
return condition; return condition;
} }
//=============以下spring注入以及Model驱动公共方法,与Action处理无关================== //=============以下spring注入以及Model驱动公共方法,与Action处理无关==================
@Override @Override
public MaterialPropertyModel getModel() { public MaterialPropertyModel getModel() {
return model; return model;
} }
public void setMaterialPropertyService(MaterialPropertyIService materialPropertyService) {
public void setMaterialPropertyService(MaterialPropertyIService materialPropertyService) {
this.materialPropertyService = 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