Commit c8f43c4a authored by suhuiguang's avatar suhuiguang

1.项、点、线路、计划增加记录comoanyId companyName

parent f6bb5654
......@@ -390,6 +390,32 @@ public class InputItem extends BasicEntity {
return this.getId() == inputItem.getId();
}
/**
* 维保公司id
*/
private String companyId;
/**
* 维保公司名称
*/
private String companyName;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getLevel() {
return level;
}
......
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.maintenance.dao.entity;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.LastModifiedDate;
......@@ -65,6 +65,32 @@ public class Plan extends BasicEntity {
private String ownerId;
/**
* 维保公司id
*/
private String companyId;
/**
* 维保公司名称
*/
private String companyName;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
@Transient
public String getOwnerId() {
return ownerId;
......
......@@ -80,6 +80,32 @@ public class Point extends BasicEntity {
private String extendJson;
/**
* 维保公司id
*/
private String companyId;
/**
* 维保公司名称
*/
private String companyName;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* 定点拍照数
*/
@Column(name="fixed_shot")
......
......@@ -51,6 +51,16 @@ public class Route extends BasicEntity {
private String orgCode;
/**
* 维保公司id
*/
private String companyId;
/**
* 维保公司名称
*/
private String companyName;
/**
* 备注说明
*/
private String remark;
......@@ -133,6 +143,22 @@ public class Route extends BasicEntity {
return coordinates;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public void setCoordinates(String coordinates) {
this.coordinates = coordinates;
}
......
......@@ -9,6 +9,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
......@@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -79,23 +81,20 @@ public class InputItemController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "新增检查项", notes = "新增检查项")
@RequestMapping(value = "/addItem", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse addNewItem(@ApiParam(value = "检查项信息") @RequestBody InputItemParam param) {
if (ObjectUtils.isEmpty(param.getId())) {
return updateItem(param);
}
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
try {
InputItem inputItem = new InputItem();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
InputItem inputItem = new InputItem();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
BeanUtils.copyProperties(param, inputItem);
inputItem.setCompanyId(personIdentity.getCompanyId());
inputItem.setCompanyName(personIdentity.getCompanyName());
inputItem.setOrgCode(loginOrgCode);
inputItem.setCreateBy(user.getUserId());
inputItem.setCreateBy(RequestContext.getExeUserId());
inputItemService.addNewInputItem(inputItem);
return CommonResponseUtil.success();
} catch (Exception e) {
......@@ -122,19 +121,17 @@ public class InputItemController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "更新检查项", notes = "更新检查项")
@PersonIdentify
@ApiOperation(value = "更新检查项,没用到", notes = "更新检查项")
@RequestMapping(value = "/updateItem", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
public CommonResponse updateItem(@ApiParam(value = "检查项详情", required = false) @RequestBody InputItemParam param) {
if (ObjectUtils.isEmpty(param.getId())) {
return addNewItem(param);
}
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
try {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
InputItem inputItem = new InputItem();
BeanUtils.copyProperties(param, inputItem);
inputItem.setCompanyId(personIdentity.getCompanyId());
inputItem.setCompanyName(personIdentity.getCompanyName());
inputItem.setId(param.getId());
inputItemService.updateInputItem(inputItem);
return CommonResponseUtil.success();
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.controller;
import java.util.HashMap;
import java.util.List;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -84,16 +86,19 @@ public class PlanController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "巡检计划新增及编辑", notes = "巡检计划新增及编辑")
@RequestMapping(value = "/addPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse checkPlanAdd(@ApiParam(value = "巡检计划", required = true) @RequestBody Plan param) {
try {
String userId = getUserId();
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String loginOrgCode = getOrgCode(reginParams);
HashMap<String, Object> map = new HashMap<String, Object>();
param.setCompanyId(personIdentity.getCompanyId());
param.setCompanyName(personIdentity.getCompanyName());
map.put("org_code", loginOrgCode);
map.put("user_id", userId);
map.put("user_id", RequestContext.getExeUserId());
map.put("param", param);
planService.addPlan(map);
return CommonResponseUtil.success();
......@@ -150,7 +155,7 @@ public class PlanController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询巡检计划明细", notes = "查询巡检计划明细")
@ApiOperation(value = "查询维保计划明细", notes = "查询维保计划明细")
@RequestMapping(value = "/detail/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryPointById(@ApiParam(value = "计划id", required = true) @PathVariable(name = "id") Long id) {
......
......@@ -15,6 +15,7 @@ import com.yeejoin.amos.maintenance.business.vo.PointInputItemVo;
import com.yeejoin.amos.maintenance.business.vo.PointVo;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.request.CommonRequest;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import com.yeejoin.amos.maintenance.dao.entity.Point;
import com.yeejoin.amos.maintenance.dao.entity.PointClassify;
import io.swagger.annotations.Api;
......@@ -27,6 +28,7 @@ import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -53,14 +55,17 @@ public class PointController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "新增巡检点", notes = "新增巡检点")
@PostMapping(value = "/addPoint", produces = "application/json;charset=UTF-8")
public CommonResponse addPoint(@ApiParam(value = "巡检点", required = true) @RequestBody PointParam pointParam) {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
//点归属于公司
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
pointParam.getPoint().setCompanyId(personIdentity.getCompanyId());
pointParam.getPoint().setCompanyName(personIdentity.getCompanyName());
pointParam.getPoint().setOrgCode(loginOrgCode);
pointParam.getPoint().setCreatorId(getUserId());
pointParam.getPoint().setCreatorId(RequestContext.getExeUserId());
Point point = iPointService.addPoint(pointParam);
return CommonResponseUtil.success(point);
......@@ -92,14 +97,19 @@ public class PointController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "更新巡检点", notes = "更新巡检点")
@PutMapping(value = "/updatePoint", produces = "application/json;charset=UTF-8")
public CommonResponse updatePoint(@ApiParam(value = "巡检点", required = true) @RequestBody PointParam pointParam) {
try {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
pointParam.getPoint().setCompanyId(personIdentity.getCompanyId());
pointParam.getPoint().setCompanyName(personIdentity.getCompanyName());
pointParam.getPoint().setCreatorId(RequestContext.getExeUserId());
iPointService.updatePoint(pointParam);
return CommonResponseUtil.success();
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("更新巡检点失败");
}
......
......@@ -7,8 +7,10 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -58,18 +61,22 @@ public class RouteController extends AbstractBaseController {
* @return CommonResponse
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "新增巡检路线", notes = "新增巡检路线")
@PostMapping(value = "/addRoute", produces = "application/json;charset=UTF-8")
public CommonResponse addRoute(@ApiParam(value = "巡检路线", required = true) @RequestBody Route route) {
try {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String loginOrgCode = getOrgCode(reginParams);
route.setOrgCode(loginOrgCode);
route.setIsDelete(false);
if (routeService.existRouteName(loginOrgCode, route.getName())) {
return CommonResponseUtil.failure("巡检路线名称重复");
}
route.setCreatorId(getUserId());
route.setCompanyId(personIdentity.getCompanyId());
route.setCompanyName(personIdentity.getCompanyName());
route.setCreatorId(RequestContext.getExeUserId());
routeService.addRoute(route);
return CommonResponseUtil.success();
} catch (Exception e) {
......@@ -85,14 +92,18 @@ public class RouteController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "更新巡检路线", notes = "更新巡检路线")
@PutMapping(value = "/updateRoute", produces = "application/json;charset=UTF-8")
public CommonResponse updateRoute(@ApiParam(value = "巡检路线", required = true) @RequestBody Route route) {
try {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String orgCode = getOrgCode(reginParams);
route.setCompanyId(personIdentity.getCompanyId());
route.setCompanyName(personIdentity.getCompanyName());
route.setOrgCode(orgCode);
route.setCreatorId(getUserId());
route.setCreatorId(RequestContext.getExeUserId());
routeService.updateRoute(route);
return CommonResponseUtil.success();
} catch (Exception e) {
......
......@@ -16,6 +16,7 @@ import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.maintenance.business.util.PlanTaskUtil;
import com.yeejoin.amos.maintenance.business.vo.CalDateVo;
import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskDetailIsFinishEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.util.DateUtil;
......@@ -512,8 +513,15 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
@Override
public List getPlanTaskPoints(Map<String, Object> param) {
return planTaskMapper.getPlanTaskPoints(param);
public List<Map<String,Object>> getPlanTaskPoints(Map<String, Object> param) {
List<Map<String,Object>> result = planTaskMapper.getPlanTaskPoints(param);
result.forEach(r->{
if(r.containsKey("isFinish")){
String isFinishDesc = PlanTaskDetailIsFinishEnum.getName(Integer.parseInt(r.get("isFinish").toString()));
r.put("isFinishDesc",isFinishDesc);
}
});
return result;
}
@Override
......
......@@ -76,7 +76,7 @@ public class RouteServiceImpl implements IRouteService {
@Override
@Transactional
public Route addRoute(Route route) {
public Route addRoute(Route route) {
String creatorId = route.getCreatorId();
String orgCode = route.getOrgCode();
route = iRouteDao.saveAndFlush(route);
......
......@@ -75,7 +75,7 @@ public interface IPlanTaskService {
* @param param
* @return
*/
List getPlanTaskPoints(Map<String, Object> param);
List<Map<String,Object>> getPlanTaskPoints(Map<String, Object> param);
/**
* 今日执行情况
......
......@@ -26,6 +26,8 @@
<if test="testRequirement != null ">test_requirement=#{testRequirement},</if>
<if test="inputClassify != null ">input_classify=#{inputClassify},</if>
<if test="unit != null ">unit=#{unit},</if>
<if test="companyId != null ">company_id=#{companyId},</if>
<if test="companyName != null ">company_name=#{companyName}</if>
</trim>
WHERE id=#{id}
</update>
......
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