Commit 62698a38 authored by chenhao's avatar chenhao

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 898ffd1d a4db10bd
......@@ -38,4 +38,6 @@ public interface InputItemMapper {
void updatePointById(Map<String, Object> param);
List<Long> getIds();
List<InputItem> findByIdIn(@Param("list") List<Long> inputItemIds);
}
......@@ -22,9 +22,6 @@ public interface IInputItemDao extends BaseDao<InputItem, Long> {
@Query(value = "select * from p_input_item where original_id in ?1 and is_delete =0", nativeQuery = true)
List<InputItem> listByOriginalIds(List<String> originalIds);
@Query(value = "select * from p_input_item where id in ?1 and is_delete =0", nativeQuery = true)
List<InputItem> listByIds(List<Long> ids);
@Query(value = "select * from p_input_item where item_no = ?1 and equipment_name = ?2 and is_delete =0", nativeQuery = true)
List<InputItem> findByItemNoAndEquipmentName(String itemNo,String equipmentName);
......
......@@ -4,91 +4,111 @@ import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import java.util.List;
public class InputItemPageParam extends CommonPageable{
private String isScore;
private String itemType;
private String name;
private String level;
private String itemNo;
private String checkTypeId;
/**
* 机构
*/
private String orgCode;
private String inputClassify;
public String getItemClassify() {
return itemClassify;
}
public void setItemClassify(String itemClassify) {
this.itemClassify = itemClassify;
}
private String itemClassify;
public String getInputClassify() {
return inputClassify;
}
public void setInputClassify(String inputClassify) {
this.inputClassify = inputClassify;
}
private List<Long> catalogIds;
public String getItemNo() {
return itemNo;
}
public void setItemNo(String itemNo) {
this.itemNo = itemNo;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getIsScore() {
return isScore;
}
public void setIsScore(String isScore) {
this.isScore = isScore;
}
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public List<Long> getCatalogIds() {
return catalogIds;
}
public void setCatalogIds(List<Long> catalogIds) {
this.catalogIds = catalogIds;
}
public String getCheckTypeId() {
return checkTypeId;
}
public void setCheckTypeId(String checkTypeId) {
this.checkTypeId = checkTypeId;
}
public class InputItemPageParam extends CommonPageable {
private String isScore;
private String itemType;
private String name;
private String level;
private String itemNo;
private String checkTypeId;
private String itemStart;
/**
* 机构
*/
private String orgCode;
private String inputClassify;
public String getItemClassify() {
return itemClassify;
}
public void setItemClassify(String itemClassify) {
this.itemClassify = itemClassify;
}
private String itemClassify;
public String getInputClassify() {
return inputClassify;
}
public void setInputClassify(String inputClassify) {
this.inputClassify = inputClassify;
}
private List<Long> catalogIds;
public String getItemNo() {
return itemNo;
}
public void setItemNo(String itemNo) {
this.itemNo = itemNo;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getIsScore() {
return isScore;
}
public void setIsScore(String isScore) {
this.isScore = isScore;
}
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public List<Long> getCatalogIds() {
return catalogIds;
}
public void setCatalogIds(List<Long> catalogIds) {
this.catalogIds = catalogIds;
}
public String getCheckTypeId() {
return checkTypeId;
}
public void setCheckTypeId(String checkTypeId) {
this.checkTypeId = checkTypeId;
}
public String getItemStart() {
return itemStart;
}
public void setItemStart(String itemStart) {
this.itemStart = itemStart;
}
}
package com.yeejoin.amos.supervision.business.service.impl;
import com.google.common.collect.Lists;
import com.yeejoin.amos.supervision.business.dao.repository.IInputItemDao;
import com.yeejoin.amos.supervision.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RoutePointItemMapper;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointDao;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointItemDao;
import com.yeejoin.amos.supervision.business.service.intfc.IRoutePointItemService;
......@@ -24,10 +25,13 @@ public class RoutePointItemServiceImpl implements IRoutePointItemService {
private IRoutePointItemDao routePointItemDao;
@Autowired
private IInputItemDao inputItemDao;
private IRoutePointDao routePointDao;
@Autowired
private IRoutePointDao routePointDao;
private InputItemMapper inputItemMapper;
@Autowired
private RoutePointItemMapper routePointItemMapper;
@Override
public List<RoutePointItem> addRoutePointItemList(Plan plan, List<Long> inputItemIds, String userId) {
......@@ -35,14 +39,15 @@ public class RoutePointItemServiceImpl implements IRoutePointItemService {
Long routeId = plan.getRouteId();
if (CollectionUtils.isNotEmpty(inputItemIds) && routeId != null && planId != null) {
routePointItemDao.deleteByPlanId(planId);
List<InputItem> inputItemList = inputItemDao.listByIds(inputItemIds);
List<InputItem> inputItemList = inputItemMapper.findByIdIn(inputItemIds);
List<RoutePoint> routePointList = routePointDao.findByRouteId(routeId);
if (CollectionUtils.isNotEmpty(inputItemList) && CollectionUtils.isNotEmpty(routePointList)) {
List<RoutePointItem> list = new ArrayList<>();
routePointList.stream().forEach(route->{
routePointList.stream().forEach(route -> {
Long routePointId = route.getId();
inputItemList.stream().forEach(item->{
inputItemList.stream().forEach(item -> {
RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setPlanId(planId);
routePointItem.setInputItemId(item.getId());
routePointItem.setBasisJson(item.getBasisJson());
routePointItem.setOrderNo(item.getOrderNo());
......@@ -57,4 +62,12 @@ public class RoutePointItemServiceImpl implements IRoutePointItemService {
}
return Lists.newArrayList();
}
// @Override
// public Page<RoutePointItemVo> queryPage(InputItemPageParam param) {
// long total = routePointItemMapper.queryPageCount(param);
// List<RoutePointItemVo> content = routePointItemMapper.queryPage(param);
// Page<RoutePointItemVo> result = new PageImpl<RoutePointItemVo>(content, param, total);
// return result;
// }
}
package com.yeejoin.amos.supervision.business.util;
import java.sql.PreparedStatement;
import java.util.HashMap;
import java.util.List;
import com.yeejoin.amos.supervision.business.param.InputItemPageParam;
import org.springframework.util.ObjectUtils;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
import com.yeejoin.amos.supervision.dao.entity.InputItem;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.List;
public class InputItemParamUtil {
......@@ -60,6 +58,8 @@ public class InputItemParamUtil {
param.setItemClassify(toString(queryRequests.get(i).getValue()));
} else if ("checkTypeId".equals(name)) {
param.setCheckTypeId(toString(queryRequests.get(i).getValue()));
} else if ("itemStart".equals(name)) {
param.setCheckTypeId(toString(queryRequests.get(i).getValue()));
}
}
}
......
......@@ -127,6 +127,7 @@
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="checkTypeId!=null"> and a.check_type_Val = #{checkTypeId} </if>
<if test="itemStart!=null"> and a.item_start = #{itemStart} </if>
<!-- <if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>-->
<if test="itemClassify != null"> and a.item_classify = #{itemClassify}</if>
order by a.id desc
......@@ -313,4 +314,19 @@
WHERE
is_delete = 0
</select>
<select id="findByIdIn" resultType="com.yeejoin.amos.supervision.dao.entity.InputItem">
SELECT
*
FROM
p_input_item
<where>
is_delete = 0
<if test="list != null and list.size() >0">
AND id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
\ No newline at end of file
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