|
|
@ -169,8 +169,6 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto |
|
|
|
public Result updateCustomized(UpdateCustomizedFormDTO formDTO) { |
|
|
|
// 1.客户定制功能详情表 ,没查到就是没人在使用
|
|
|
|
List<CustomerFunctionDetailDTO> customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); |
|
|
|
FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(formDTO, FunctionCustomizedEntity.class); |
|
|
|
entity.setId(formDTO.getCustomizedId()); |
|
|
|
if (customizedId != null && customizedId.size() > NumConstant.ZERO){ |
|
|
|
// 根据功能id,查询功能的详细信息
|
|
|
|
CustomizedDTO customizedDTO = baseDao.selectCustomized(formDTO.getFunctionId()); |
|
|
@ -216,9 +214,14 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto |
|
|
|
customerFunctionDetailService.updateBatchById(upCustomizedInfo); |
|
|
|
} |
|
|
|
// 2.修改 功能表, 修改的字段范围,是:功能名称和大小图标
|
|
|
|
this.upFunction(formDTO); |
|
|
|
this.upFunction(formDTO, NumConstant.ZERO); |
|
|
|
|
|
|
|
// 3.修改 定制功能表, 修改的字段范围,是:功能名称和大小图标
|
|
|
|
FunctionCustomizedEntity entity = new FunctionCustomizedEntity(); |
|
|
|
entity.setId(formDTO.getCustomizedId()); |
|
|
|
entity.setCustomizedName(formDTO.getCustomizedName()); |
|
|
|
entity.setIconLargeImg(formDTO.getIconLargeImg()); |
|
|
|
entity.setIconSmallImg(formDTO.getIconSmallImg()); |
|
|
|
baseDao.updateById(entity); |
|
|
|
|
|
|
|
// 4.提示哪些用户不能被修改
|
|
|
@ -228,8 +231,10 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto |
|
|
|
} else { |
|
|
|
// 没有客户正在使用该 功能
|
|
|
|
// 2.修改 功能表, 修改的字段范围,是所有入参字段
|
|
|
|
this.upFunction(formDTO); |
|
|
|
this.upFunction(formDTO, NumConstant.ONE); |
|
|
|
// 3.修改 定制功能表, 修改的字段范围,是所有入参字段
|
|
|
|
FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(formDTO, FunctionCustomizedEntity.class); |
|
|
|
entity.setId(formDTO.getCustomizedId()); |
|
|
|
baseDao.updateById(entity); |
|
|
|
} |
|
|
|
return new Result(); |
|
|
@ -266,18 +271,18 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto |
|
|
|
/** |
|
|
|
* 修改数据到 功能表 |
|
|
|
* @param formDTO |
|
|
|
* @param flag == 0 只修改图标和名称 |
|
|
|
* == 1 修改全部字段 |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 10:03 2020-08-13 |
|
|
|
**/ |
|
|
|
private void upFunction(UpdateCustomizedFormDTO formDTO){ |
|
|
|
private void upFunction(UpdateCustomizedFormDTO formDTO, Integer flag){ |
|
|
|
FunctionEntity entity = new FunctionEntity(); |
|
|
|
entity.setId(formDTO.getFunctionId()); |
|
|
|
entity.setFunctionName(formDTO.getCustomizedName()); |
|
|
|
entity.setFunctionIcon(formDTO.getIconLargeImg()); |
|
|
|
if (null != formDTO.getShoppingStatus()){ |
|
|
|
if (NumConstant.ONE == flag){ |
|
|
|
entity.setShoppingStatus(Integer.valueOf(formDTO.getShoppingStatus())); |
|
|
|
} |
|
|
|
if (null != formDTO.getFunctionExplain()){ |
|
|
|
entity.setFunctionExplain(formDTO.getFunctionExplain()); |
|
|
|
} |
|
|
|
functionService.updateById(entity); |
|
|
|