区域和运营商管理的itemcode增加当前类型下的有效配置,itemcode不重复

This commit is contained in:
leijun
2018-10-10 15:29:01 +08:00
parent 87c58379b8
commit 1b3ee67f4c
5 changed files with 17 additions and 8 deletions

View File

@@ -234,13 +234,16 @@ public class SysDictInfoController extends BaseController {
*/
@ResponseBody
@RequestMapping(value = "isItemCodeRepeat")
public boolean isItemCodeRepeat(String itemCode,String oldItemCode) {
public boolean isItemCodeRepeat(String itemCode,String oldItemCode,String itType) {
List<SysDictInfo> list = Lists.newArrayList();
if(oldItemCode!=null&&itemCode.trim().equals(oldItemCode.trim())){
return true;
}
if(!StringUtil.isEmpty(itemCode)){
list = sysDictInfoService.findByItemCode(itemCode);
SysDictInfo dict=new SysDictInfo();
dict.setItemCode(itemCode);
dict.setItemType(Integer.valueOf(itType));
list = sysDictInfoService.findByItemCode(dict);
}
if(list==null||list.size()==0){
return true;

View File

@@ -55,7 +55,7 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
* @param itemCode
* @return
*/
List<SysDictInfo> findByItemCode(String itemCode);
List<SysDictInfo> findByItemCode(@Param("sysDictInfo")SysDictInfo sysDictInfo);
/**
* 根据上级id选出所有下级

View File

@@ -232,10 +232,16 @@
<!-- 根据itemCode查询字典对象列表 -->
<select id="findByItemCode" resultType="com.nis.domain.basics.SysDictInfo">
<select id="findByItemCode" resultMap="dictResultMap">
select
<include refid="sysDictInfoColumns"/>
from sys_dict_info s where s.item_code = #{itemCode}
from sys_dict_info s where s.is_valid = 1
<if test="sysDictInfo.itemType != null and sysDictInfo.itemType != '' " >
AND s.item_type = ${sysDictInfo.itemType}
</if>
<if test="sysDictInfo.itemCode != null and sysDictInfo.itemCode != '' " >
AND s.item_code = ${sysDictInfo.itemCode}
</if>
</select>
<!-- 根据上级id选出所有下级 -->

View File

@@ -206,8 +206,8 @@ public class SysDictInfoService extends BaseService{
* @param itemCode
* @return
*/
public List<SysDictInfo> findByItemCode(String itemCode) {
return sysDictInfoDao.findByItemCode(itemCode);
public List<SysDictInfo> findByItemCode(SysDictInfo sysDictInfo) {
return sysDictInfoDao.findByItemCode(sysDictInfo);
}
/**
* 根据上级id选出所有下级

View File

@@ -61,7 +61,7 @@
validateForm = $("#inputForm").validate({
rules: {
'itemCode':{
remote:'${ctx}/basics/sysDictInfo/isItemCodeRepeat?oldItemCode=${sysDictInfo.itemCode}'
remote:'${ctx}/basics/sysDictInfo/isItemCodeRepeat?oldItemCode=${sysDictInfo.itemCode}&itType=${itType}'
},
'itemType':{
remote:'${ctx}/basics/sysDictInfo/ajaxChildrenType?parent=${sysDictInfo.sysDictId}'