区域和运营商管理的itemcode增加当前类型下的有效配置,itemcode不重复
This commit is contained in:
@@ -234,13 +234,16 @@ public class SysDictInfoController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = "isItemCodeRepeat")
|
@RequestMapping(value = "isItemCodeRepeat")
|
||||||
public boolean isItemCodeRepeat(String itemCode,String oldItemCode) {
|
public boolean isItemCodeRepeat(String itemCode,String oldItemCode,String itType) {
|
||||||
List<SysDictInfo> list = Lists.newArrayList();
|
List<SysDictInfo> list = Lists.newArrayList();
|
||||||
if(oldItemCode!=null&&itemCode.trim().equals(oldItemCode.trim())){
|
if(oldItemCode!=null&&itemCode.trim().equals(oldItemCode.trim())){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(itemCode)){
|
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){
|
if(list==null||list.size()==0){
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
|
|||||||
* @param itemCode
|
* @param itemCode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SysDictInfo> findByItemCode(String itemCode);
|
List<SysDictInfo> findByItemCode(@Param("sysDictInfo")SysDictInfo sysDictInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据上级id选出所有下级
|
* 根据上级id选出所有下级
|
||||||
|
|||||||
@@ -232,10 +232,16 @@
|
|||||||
|
|
||||||
<!-- 根据itemCode查询字典对象列表 -->
|
<!-- 根据itemCode查询字典对象列表 -->
|
||||||
|
|
||||||
<select id="findByItemCode" resultType="com.nis.domain.basics.SysDictInfo">
|
<select id="findByItemCode" resultMap="dictResultMap">
|
||||||
select
|
select
|
||||||
<include refid="sysDictInfoColumns"/>
|
<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>
|
</select>
|
||||||
|
|
||||||
<!-- 根据上级id选出所有下级 -->
|
<!-- 根据上级id选出所有下级 -->
|
||||||
|
|||||||
@@ -206,8 +206,8 @@ public class SysDictInfoService extends BaseService{
|
|||||||
* @param itemCode
|
* @param itemCode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<SysDictInfo> findByItemCode(String itemCode) {
|
public List<SysDictInfo> findByItemCode(SysDictInfo sysDictInfo) {
|
||||||
return sysDictInfoDao.findByItemCode(itemCode);
|
return sysDictInfoDao.findByItemCode(sysDictInfo);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 根据上级id选出所有下级
|
* 根据上级id选出所有下级
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
validateForm = $("#inputForm").validate({
|
validateForm = $("#inputForm").validate({
|
||||||
rules: {
|
rules: {
|
||||||
'itemCode':{
|
'itemCode':{
|
||||||
remote:'${ctx}/basics/sysDictInfo/isItemCodeRepeat?oldItemCode=${sysDictInfo.itemCode}'
|
remote:'${ctx}/basics/sysDictInfo/isItemCodeRepeat?oldItemCode=${sysDictInfo.itemCode}&itType=${itType}'
|
||||||
},
|
},
|
||||||
'itemType':{
|
'itemType':{
|
||||||
remote:'${ctx}/basics/sysDictInfo/ajaxChildrenType?parent=${sysDictInfo.sysDictId}'
|
remote:'${ctx}/basics/sysDictInfo/ajaxChildrenType?parent=${sysDictInfo.sysDictId}'
|
||||||
|
|||||||
Reference in New Issue
Block a user