|
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.xt.js.gkaq.common.BaseCtl;
|
|
|
+import com.xt.js.gkaq.common.log.annotation.SysLog;
|
|
|
import com.xt.js.gkaq.frame.model.CodeModel;
|
|
|
import com.xt.js.gkaq.frame.model.CodeModelDto;
|
|
|
import com.xt.js.gkaq.frame.model.ComboBoxDto;
|
|
@@ -25,7 +26,7 @@ import com.yuanxd.tools.utils.WebJsonResult;
|
|
|
import com.yuanxd.tools.utils.string.StringUtils;
|
|
|
|
|
|
/**
|
|
|
- * 锟街碉拷锟斤拷锟斤拷锟斤拷
|
|
|
+ * 字典管理控制
|
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping(value = "/dict", produces = "application/json; charset=utf-8")
|
|
@@ -34,7 +35,7 @@ public class DictCtl extends BaseCtl {
|
|
|
private CodeService codeService;
|
|
|
|
|
|
/**
|
|
|
- * 锟斤拷锟斤拷锟斤拷页
|
|
|
+ * 进入首页
|
|
|
*
|
|
|
* @param model
|
|
|
* @return
|
|
@@ -45,7 +46,7 @@ public class DictCtl extends BaseCtl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 锟斤拷始锟斤拷页锟斤拷锟斤拷锟斤拷锟�
|
|
|
+ * 初始化页面加载树
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
@@ -58,7 +59,7 @@ public class DictCtl extends BaseCtl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 锟斤拷始锟斤拷页锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
+ * 初始化页面加载数据
|
|
|
*
|
|
|
* @param vo
|
|
|
* @return
|
|
@@ -66,8 +67,9 @@ public class DictCtl extends BaseCtl {
|
|
|
*/
|
|
|
@RequestMapping("list")
|
|
|
@ResponseBody
|
|
|
+ @SysLog(description="字典列表查询")
|
|
|
public PageInfo<CodeModelDto> getPageInfo(DictVo vo) throws UnsupportedEncodingException {
|
|
|
- // 锟斤拷始锟斤拷锟斤拷锟斤拷
|
|
|
+ // 初始化参数
|
|
|
if (null == vo.getPage() || vo.getPage() < 1) {
|
|
|
vo.setPage(1);
|
|
|
}
|
|
@@ -92,13 +94,14 @@ public class DictCtl extends BaseCtl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 锟斤拷取锟斤拷录
|
|
|
+ * 获取记录
|
|
|
*
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getRecord")
|
|
|
@ResponseBody
|
|
|
+ @SysLog(description="获取字典数据")
|
|
|
public CodeModel getRecord(String id) {
|
|
|
|
|
|
CodeModel model = codeService.findById(id);
|
|
@@ -106,7 +109,7 @@ public class DictCtl extends BaseCtl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 删锟斤拷锟铰�
|
|
|
+ * 删除记录
|
|
|
*
|
|
|
* @param ids
|
|
|
* @return
|
|
@@ -114,6 +117,7 @@ public class DictCtl extends BaseCtl {
|
|
|
@RequestMapping("delRecodes")
|
|
|
@ResponseBody
|
|
|
@Transactional
|
|
|
+ @SysLog(description="删除字典数据")
|
|
|
public int delRecodes(String ids) {
|
|
|
|
|
|
int cnt = 0;
|
|
@@ -121,8 +125,6 @@ public class DictCtl extends BaseCtl {
|
|
|
String[] idArr = ids.split(",");
|
|
|
for (String id : idArr) {
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
|
- cnt += codeService.deleteByPid(id);
|
|
|
- cnt += codeService.deleteByID(id);
|
|
|
delByPid(id);
|
|
|
}
|
|
|
}
|
|
@@ -131,7 +133,7 @@ public class DictCtl extends BaseCtl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 锟捷癸拷删锟斤拷
|
|
|
+ * 递归删除
|
|
|
*
|
|
|
* @param id
|
|
|
*/
|
|
@@ -153,22 +155,23 @@ public class DictCtl extends BaseCtl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 锟斤拷锟斤拷锟铰�
|
|
|
+ * 保存记录
|
|
|
*
|
|
|
* @param vo
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("save")
|
|
|
@ResponseBody
|
|
|
+ @SysLog(description="保存字典数据")
|
|
|
public WebJsonResult save(DictVo dictVo) {
|
|
|
|
|
|
if (StringUtils.isEmpty(dictVo.getId())) {
|
|
|
- // 锟斤拷锟斤拷
|
|
|
+ // 新增
|
|
|
CodeModel codeModel = new CodeModel();
|
|
|
BeanUtils.copyProperties(dictVo, codeModel);
|
|
|
codeService.add(codeModel);
|
|
|
} else {
|
|
|
- // 锟斤拷锟斤拷
|
|
|
+ // 更新
|
|
|
CodeModel codeModel = codeService.findById(dictVo.getId());
|
|
|
BeanUtils.copyProperties(dictVo, codeModel);
|
|
|
codeService.update(codeModel);
|
|
@@ -177,7 +180,7 @@ public class DictCtl extends BaseCtl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 锟斤拷取锟街碉拷锟叫憋拷
|
|
|
+ * 获取字典列表
|
|
|
*
|
|
|
* @param pcode
|
|
|
* @return
|
|
@@ -191,7 +194,7 @@ public class DictCtl extends BaseCtl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 锟斤拷取锟斤拷锟斤拷锟街碉拷锟叫憋拷
|
|
|
+ * 获取父类字典列表
|
|
|
*
|
|
|
* @return
|
|
|
*/
|