Commit 15f8d2a7 authored by KeYong's avatar KeYong

Merge remote-tracking branch 'origin/develop_tzs_patrol' into develop_tzs_patrol

parents cac67f04 319d62db
......@@ -695,8 +695,6 @@ public class InputItemController extends AbstractBaseController {
@RequestMapping(value = "/addItemNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse addNewItemNew(@ApiParam(value = "检查项信息") @RequestBody InputItemParam param) {
if(param.getId()>0){
}else{
if ("1".equals(param.getEquipmentType()) && "1".equals(param.getCustomType()) &&param.getFacilitiesType() == null&&param.getKeyPartsType() == null){
......@@ -704,11 +702,11 @@ public class InputItemController extends AbstractBaseController {
}
}
if (CollectionUtils.isNotEmpty(inputItemDao.findByItemNo(param.getItemNo(), param.getId() != 0 ? String.valueOf(param.getId()) : null))) {
if (inputItemDao.findByItemNo(param.getItemNo(), param.getId() != 0 ? String.valueOf(param.getId()) : null) > 0) {
throw new BadRequest("该编号已存在,请重新输入");
}
if (CollectionUtils.isNotEmpty(inputItemDao.findByItemName(param.getName(), param.getId() != 0 ? String.valueOf(param.getId()) : null))) {
if (inputItemDao.findByItemName(param.getName(),param.getId() != 0 ? String.valueOf(param.getId()) : null) > 0) {
throw new BadRequest("该名称已存在,请重新输入");
}
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.dao.repository;
import com.yeejoin.amos.patrol.dao.entity.InputItem;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -34,10 +35,10 @@ public interface IInputItemDao extends BaseDao<InputItem, Long> {
@Query(value = "delete * from p_input_item where is not null and is_delete =0", nativeQuery = true)
void deleteAllByEquipmentNameIsNotNull();
@Query(value = "select * from p_input_item where item_no = ?1 and is_delete =0 and if(?2 is null, 1 = 1 , id != ?2)", nativeQuery = true)
List<InputItem> findByItemNo(String itemNo, String id);
@Query(value = "select count(1) from p_input_item where item_no = :itemNo and is_delete = 0 and id != :id", nativeQuery = true)
int findByItemNo(@Param("itemNo") String itemNo, @Param("id") String id);
@Query(value = "select * from p_input_item where name = ?1 and is_delete =0 and if(?2 is null, 1 = 1 , id != ?2)", nativeQuery = true)
List<InputItem> findByItemName(String name, String id);
@Query(value = "select count(1) from p_input_item where name = :name and is_delete = 0 and id != :id", nativeQuery = true)
int findByItemName(@Param("name") String name,@Param("id")String id);
}
......@@ -100,7 +100,7 @@ public class RemoteSecurityService {
if (ObjectUtils.isEmpty(toke)) {
toke = getLogin(dPasswordAuthModel);
} else {
RequestContext.setProduct(productWeb);
RequestContext.setProduct(productWeb);
if (!TokenOperation.refresh(toke.getToke())) {
toke = getLogin(dPasswordAuthModel);
}
......@@ -239,7 +239,7 @@ public class RemoteSecurityService {
}
public List<AgencyUserModel> listUserByUserIds(String userIds) {
CommonResponse commonResponse = iAmosSecurityServer.listUserByUserIds(userIds,true);
CommonResponse commonResponse = iAmosSecurityServer.listUserByUserIds(userIds, true);
return handleArray(commonResponse, AgencyUserModel.class);
}
......
Markdown is supported
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