Commit e7bd04d3 authored by chenzhao's avatar chenzhao

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

parents 9acb27ad f6bb5654
......@@ -71,6 +71,12 @@
<artifactId>itext-asian</artifactId>
<version>5.2.0</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
package com.yeejoin.amos.boot.biz.common.utils;
/**
* tweeter的snowflake 移植到Java:
* (a) id构成: 42位的时间前缀 + 10位的节点标识 + 12位的sequence避免并发的数字(12位不够用时强制得到新的时间前缀)
* 注意这里进行了小改动: snowkflake是5位的datacenter加5位的机器id; 这里变成使用10位的机器id
* (b) 对系统时间的依赖性非常强,需关闭ntp的时间同步功能。当检测到ntp时间调整后,将会拒绝分配id
*/
public class IdWorker {
private final long workerId;
private final long epoch = 1403854494756L; // 时间起始标记点,作为基准,一般取系统的最近时间
private final long workerIdBits = 10L; // 机器标识位数
private final long maxWorkerId = -1L ^ -1L << this.workerIdBits;// 机器ID最大值: 1023
private long sequence = 0L; // 0,并发控制
private final long sequenceBits = 12L; //毫秒内自增位
private final long workerIdShift = this.sequenceBits; // 12
private final long timestampLeftShift = this.sequenceBits + this.workerIdBits;// 22
private final long sequenceMask = -1L ^ -1L << this.sequenceBits; // 4095,111111111111,12位
private long lastTimestamp = -1L;
private IdWorker(long workerId) {
if (workerId > this.maxWorkerId || workerId < 0) {
throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", this.maxWorkerId));
}
this.workerId = workerId;
}
public synchronized long nextId() throws Exception {
long timestamp = this.timeGen();
if (this.lastTimestamp == timestamp) { // 如果上一个timestamp与新产生的相等,则sequence加一(0-4095循环); 对新的timestamp,sequence从0开始
this.sequence = this.sequence + 1 & this.sequenceMask;
if (this.sequence == 0) {
timestamp = this.tilNextMillis(this.lastTimestamp);// 重新生成timestamp
}
} else {
this.sequence = 0;
}
if (timestamp < this.lastTimestamp) {
throw new Exception(String.format("clock moved backwards.Refusing to generate id for %d milliseconds", (this.lastTimestamp - timestamp)));
}
this.lastTimestamp = timestamp;
return timestamp - this.epoch << this.timestampLeftShift | this.workerId << this.workerIdShift | this.sequence;
}
private static IdWorker flowIdWorker = new IdWorker(1);
public static IdWorker getFlowIdWorkerInstance() {
return flowIdWorker;
}
/**
* 等待下一个毫秒的到来, 保证返回的毫秒数在参数lastTimestamp之后
*/
private long tilNextMillis(long lastTimestamp) throws InterruptedException {
long timestamp = this.timeGen();
while (timestamp <= lastTimestamp) {
timestamp = this.timeGen();
}
return timestamp;
}
/**
* 获得系统当前毫秒数
*/
private static long timeGen() throws InterruptedException {
return System.currentTimeMillis();
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.biz.common.utils;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Hashtable;
import java.util.Random;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* 二维码工具类
*
* @author Administrator
*/
public class QRCodeUtil {
private static final String CHARSET = "utf-8";
private static final int QRCODE_SIZE = 45;
private static Random random = new Random();
private static int randomNumForQrCode;
/**
* <pre>
* 根据当前记录ID生成QRCode
* </pre>
*
* @return
*/
public static String generateQRCode(Date dateCreated, String pointNo) {
return String.valueOf(dateCreated.getTime() + pointNo);
}
/**
* <pre>
* 生成QRCode
* </pre>
*
* @return
*/
public static String generateQRCode() {
String res;
//加锁生成随机数,保证自增后释放
Lock lock = new ReentrantLock();
lock.lock();
randomNumForQrCode += 1;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
try {
res = simpleDateFormat.format(new Date(System.currentTimeMillis())).substring(5, 8) + String.valueOf(IdWorker.getFlowIdWorkerInstance().nextId()).substring(0, 10) + randomNumForQrCode;
} catch (Exception e) {
Random random = new Random(System.currentTimeMillis());
String tmp = "";
for (int i = 0; i < 13; i++) {
tmp += random.nextInt(10);
}
res = simpleDateFormat.format(new Date(System.currentTimeMillis())).substring(2, 8) + tmp.substring(0, 10) + randomNumForQrCode;
} finally {
lock.unlock();
}
return res;
}
/**
* 生成临时的qrCode
*
* @return
*/
public static String temporaryQrCode() {
long qrCode = -1 * System.currentTimeMillis();
qrCode += (long) (random.nextDouble() * 10000000);
return String.valueOf(qrCode);
}
/**
* 根据二维码信息,生成二维码图片 用户excel,word等导出图片
*
* @param content
* @return
*/
public static byte[] generateQRCodeImageByteData(String content) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>();
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.CHARACTER_SET, CHARSET);
hints.put(EncodeHintType.MARGIN, 1);
BitMatrix bitMatrix = new MultiFormatWriter().encode(
content
, BarcodeFormat.QR_CODE
, QRCODE_SIZE
, QRCODE_SIZE,
hints);
int width = bitMatrix.getWidth();
int height = bitMatrix.getHeight();
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 : 0xFFFFFFFF);
}
}
ImageIO.write(image, "png", out);
return out.toByteArray();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
......@@ -33,10 +34,6 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "地址")
private String address;
// @ApiModelProperty(value = "经纬度坐标")
// private String latLang;
@ExcelIgnore
@ApiModelProperty(value = "经度")
private Double longitude;
......@@ -308,4 +305,20 @@ public class WaterResourceDto extends BaseDto {
@ExcelIgnore
@ApiModelProperty(value = "物联参数")
private WaterResourceIotDto waterResourceIotDto;
@ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 44)
private String equipName;
@ApiModelProperty("设施分类名称")
@ExcelProperty(value = "设施分类名称", index = 45)
private String equipCategoryName;
@ApiModelProperty("设施编码")
@ExcelProperty(value = "设施编码", index = 46)
private String equipCode;
@ApiModelProperty("维保周期")
@ExcelProperty(value = "维保周期(月)", index = 47)
private String maintenancePeriod;
}
......@@ -36,116 +36,157 @@ public class WaterResource extends BaseEntity {
*/
@TableField("address")
private String address;
/**
* 经纬度坐标
*/
// @TableField("lat_lang")
// private String latLang;
@ApiModelProperty(value = "经度")
private Double longitude;
@ApiModelProperty(value = "纬度")
private Double latitude;
/**
* 资源类型(消火栓、消防水鹤、天然水源、消防水池)
*/
@TableField("resource_type")
private String resourceType;
/**
* 资源类型名称(消火栓、消防水鹤、天然水源、消防水池)
*/
@TableField("resource_type_name")
private String resourceTypeName;
/**
* 所在建筑id
*/
@TableField("belong_building_id")
private Long belongBuildingId;
/**
* 所在建筑
*/
@TableField("belong_building")
private String belongBuilding;
/**
* 所属消防系统id
*/
@TableField("belong_fighting_system_id")
private Long belongFightingSystemId;
/**
* 所属消防系统
*/
@TableField("belong_fighting_system")
private String belongFightingSystem;
/**
* 管理单位id
*/
@TableField("management_unit_id")
private Long managementUnitId;
/**
* 管理单位
*/
@TableField("management_unit")
private String managementUnit;
/**
* 维保单位id
*/
@TableField("maintenance_unit_id")
private Long maintenanceUnitId;
/**
* 维保单位
*/
@TableField("maintenance_unit")
private String maintenanceUnit;
/**
* 建造日期
*/
@TableField("build_date")
private Date buildDate;
/**
* 启用日期
*/
@TableField("enable_date")
private Date enableDate;
/**
* 方位图
*/
@TableField("orientation_img")
private String orientationImg;
/**
* 实景图
*/
@TableField("reality_img")
private String realityImg;
/**
* 联系人姓名
*/
@TableField("contact_user")
private String contactUser;
/**
* 联系人电话
*/
@TableField("contact_phone")
private String contactPhone;
/**
* 是否有物联参数(1有,0没有)
*/
@TableField("is_iot")
private Boolean isIot;
/**
* 消防救援机构_通用唯一识别码
*/
@TableField("rescue_org_code")
private String rescueOrgCode;
/**
* 行政区划代码
*/
@TableField("administrative_code")
private String administrativeCode;
/**
* 组织机构代码
*/
@TableField("org_code")
private String orgCode;
@ApiModelProperty("设施定义")
@TableField("equip_id")
private Long equipId;
@ApiModelProperty("设施定义名称")
@TableField("equip_name")
private String equipName;
@ApiModelProperty("设施分类")
@TableField("equip_category_id")
private Long equipCategoryId;
@ApiModelProperty("设施分类名称")
@TableField("equip_category_name")
private String equipCategoryName;
@ApiModelProperty("设施编码")
@TableField("equip_code")
private String equipCode;
@ApiModelProperty("维保周期")
@TableField("maintenance_period")
private String maintenancePeriod;
}
......@@ -37,7 +37,7 @@ public interface IDutyCommonService {
* @param endDate 结束日期
* @return ResponseModel
*/
List<Map<String, Object>> list(String beginDate, String endDate) throws ParseException;
List<Map<String, Object>> list(Long teamId,String beginDate, String endDate) throws ParseException;
/**
* 获取表单参数
......
......@@ -16,177 +16,184 @@ import java.util.Map;
* @date 2021-06-18
*/
public interface IOrgUsrService {
/**
* 查询上级单位
*
* @param parent_id
* @return
*/
String selectUpUnitByParam(String parent_id);
/**
* 获取父级
*
* @param topId
* @param entityList
* @param packageURL
* @param IDMethodName
* @param IDHierarchy
* @param NAMEMethodName
* @param PARENTIDMethodName
* @param OrgTypeMethodName
* @return
* @throws Exception
*/
List<OrgMenuDto> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
/**
* 查询上级单位
*
* @param parent_id
* @return
*/
String selectUpUnitByParam(String parent_id);
/**
* 获取子数据集合
*
* @param topId
* @param entityList
* @param packageURL
* @param IDMethodName
* @param IDHierarchy
* @param NAMEMethodName
* @param PARENTIDMethodName
* @param OrgTypeMethodName
* @return
* @throws Exception
*/
List<OrgMenuDto> getSub(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
/**
* 获取父级
*
* @param topId
* @param entityList
* @param packageURL
* @param IDMethodName
* @param IDHierarchy
* @param NAMEMethodName
* @param PARENTIDMethodName
* @param OrgTypeMethodName
* @return
* @throws Exception
*/
List<OrgMenuDto> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
/**
* 组装融合调度单位人员信息
*
* @param ids
* @return
* @throws Exception
*/
List<Map<String, Object>> returnCompanyPersonMsg(List<Long> ids) throws Exception;
/**
* 获取子数据集合
*
* @param topId
* @param entityList
* @param packageURL
* @param IDMethodName
* @param IDHierarchy
* @param NAMEMethodName
* @param PARENTIDMethodName
* @param OrgTypeMethodName
* @return
* @throws Exception
*/
List<OrgMenuDto> getSub(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
/**
* 获取动态表单数据
*
* @param id
* @return
* @throws Exception
*/
List<FormValue> getFormValue(Long id) throws Exception;
/**
* 组装融合调度单位人员信息
*
* @param ids
* @return
* @throws Exception
*/
List<Map<String, Object>> returnCompanyPersonMsg(List<Long> ids) throws Exception;
/**
* 保存 机构/部门/人员基本信息
*
* @param
* @throws Exception
*/
void saveOrgUsr(OrgUsr orgUsr, OrgUsr oriOrgUsr) throws Exception;
/**
* 获取动态表单数据
*
* @param id
* @return
* @throws Exception
*/
List<FormValue> getFormValue(Long id) throws Exception;
/**
* 新增机构/部门/人员基本信息和动态表单数据
*
* @param orgUsr
* @param alertFromValuelist
*/
void saveOrgUsrDynamicFormInstance(OrgUsr orgUsr, List<DynamicFormInstance> alertFromValuelist) throws Exception;
/**
* 保存 机构/部门/人员基本信息
*
* @param
* @throws Exception
*/
void saveOrgUsr(OrgUsr orgUsr, OrgUsr oriOrgUsr) throws Exception;
/**
* 更新机构/部门/人员基本信息和动态表单数据
*
* @param instanceId 实例id
* @param fromValueList 动态表单数据列表
* @throws Exception
*/
void updateDynamicFormInstance(Long instanceId, List<DynamicFormInstance> fromValueList) throws Exception;
/**
* 新增机构/部门/人员基本信息和动态表单数据
*
* @param orgUsr
* @param alertFromValuelist
*/
void saveOrgUsrDynamicFormInstance(OrgUsr orgUsr, List<DynamicFormInstance> alertFromValuelist) throws Exception;
/**
* @param id
* @throws Exception
*/
Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception;
/**
* 更新机构/部门/人员基本信息和动态表单数据
*
* @param instanceId 实例id
* @param fromValueList 动态表单数据列表
* @throws Exception
*/
void updateDynamicFormInstance(Long instanceId, List<DynamicFormInstance> fromValueList) throws Exception;
List<OrgUsr> selectCompanyDepartmentMsg();
/**
* @param id
* @throws Exception
*/
Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception;
void saveOrgUsr(OrgUsrDto OrgUsrDto) throws Exception;
List<OrgUsr> selectCompanyDepartmentMsg();
void saveOrgPerson(OrgPersonDto OrgPersonDto) throws Exception;
void saveOrgUsr(OrgUsrDto OrgUsrDto) throws Exception;
void updateByIdOrgUsr(OrgUsrDto OrgUsrDto, Long id) throws Exception;
void saveOrgPerson(OrgPersonDto OrgPersonDto) throws Exception;
void updateByIdOrgPerson(OrgPersonDto OrgPersonDto, Long id) throws Exception;
void updateByIdOrgUsr(OrgUsrDto OrgUsrDto, Long id) throws Exception;
OrgUsrFormDto selectCompanyById(Long id) throws Exception;
void updateByIdOrgPerson(OrgPersonDto OrgPersonDto, Long id) throws Exception;
IPage bizOrgTypeListPage(String pageNum, String pageSize, String bizOrgType) throws Exception;
OrgUsrFormDto selectCompanyById(Long id) throws Exception;
void saveDepartment(List<OrgDepartmentDto> OrgDepartmentDto, Long id) throws Exception;
IPage bizOrgTypeListPage(String pageNum, String pageSize, String bizOrgType) throws Exception;
void saveCompany(List<OrgUsrDto> OrgUsrDto) throws Exception;
void saveDepartment(List<OrgDepartmentDto> OrgDepartmentDto, Long id) throws Exception;
OrgPersonFormDto selectPersonById(Long id) throws Exception;
void saveCompany(List<OrgUsrDto> OrgUsrDto) throws Exception;
OrgPersonFormDto selectPersonByIdDetail(Long id) throws Exception;
OrgPersonFormDto selectPersonById(Long id) throws Exception;
List<OrgMenuDto> selectPersonTree() throws Exception;
OrgPersonFormDto selectPersonByIdDetail(Long id) throws Exception;
void savePersonList(List<OrgPersonDto> OrgPersonDto) throws Exception;
List<OrgMenuDto> selectPersonTree() throws Exception;
void saveOrgDepartment(OrgDepartmentDto OrgDepartmentDto) throws Exception;
void savePersonList(List<OrgPersonDto> OrgPersonDto) throws Exception;
void updateByIdOrgDepartment(OrgDepartmentDto OrgDepartmentDto, Long id) throws Exception;
void saveOrgDepartment(OrgDepartmentDto OrgDepartmentDto) throws Exception;
OrgDepartmentFormDto selectDepartmentById(Long id) throws Exception;
void updateByIdOrgDepartment(OrgDepartmentDto OrgDepartmentDto, Long id) throws Exception;
List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception;
OrgDepartmentFormDto selectDepartmentById(Long id) throws Exception;
List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception;
/**
* * @param null
*
* @return <PRE>
* author tw
* date 2021/7/20
* </PRE>
* 列表
*/
List<CompanyDto> listContractDto(Integer pageNum, Integer pageSize, RequestData requestData);
/**
* * @param null
*
* @return
*
* <PRE>
* author tw
* date 2021/7/20
* </PRE>
*
* 列表
*/
List<CompanyDto> listContractDto(Integer pageNum, Integer pageSize, RequestData requestData);
/**
* * @param null
*
* @return <PRE>
* author tw
* date 2021/7/20
* </PRE>
* 统计
*/
Integer listContractDtoCount(RequestData par);
/**
* * @param null
*
* @return
*
* <PRE>
* author tw
* date 2021/7/20
* </PRE>
*
* 统计
*/
Integer listContractDtoCount(RequestData par);
/**
* * @param null
*
* @return <PRE>
* author tw
* date 2021/7/26
* </PRE>
*/
/**
* * @param null
*
* @return
*
* <PRE>
* author tw
* date 2021/7/26
* </PRE>
*/
List<OrgUsrzhDto> getOrgUsrzhDto(String name);
List<OrgUsrzhDto> getOrgUsrzhDto(String name);
List<ESOrgUsrDto> selectByIddata(String name);
List<ESOrgUsrDto> selectByIddata(String name);
List<Map<String, Object>> getparent();
List<Map<String, Object>> getparent();
List<OrgUsrExcelDto> exportToExcel();
List<OrgUsrExcelDto> exportToExcel();
UserUnitDto getUserUnit(String userId);
UserUnitDto getUserUnit(String userId);
/**
* 根据登陆人获取公司部门人员树
*/
List<OrgMenuDto> companyUserTreeByUser (AgencyUserModel user);
List<OrgMenuDto> companyUserTreeByUser(AgencyUserModel user);
/**
* 根据登陆人获取公司部门树
......@@ -203,4 +210,6 @@ public interface IOrgUsrService {
*/
List<Map<String, Object>> getLoginUserDetails(AgencyUserModel user);
List<OrgUsr> getPersonListByParentId(Long id);
}
......@@ -138,13 +138,24 @@
clu.rec_user_id AS recUserId,
clu.rec_date AS recDate,
clu.is_delete AS isDelete,
cre.vehicle_number AS vehicleNumber,
csps.person_number AS personNumber
(
SELECT
sum(cre.vehicle_number)
FROM
cb_rescue_equipment cre
WHERE
clu.sequence_nbr = cre.company_id
) AS vehicleNumber,
(
SELECT
sum(csps.person_number)
FROM
cb_special_position_staff csps
WHERE
clu.sequence_nbr = csps.company_id
) AS personNumber
FROM
cb_linkage_unit clu
LEFT JOIN cb_rescue_equipment cre ON clu.sequence_nbr = cre.company_id
LEFT JOIN cb_special_position_staff csps ON clu.sequence_nbr =
csps.company_id
WHERE clu.is_delete=0
<if test="unitName != null and unitName != ''">
AND clu.unit_name LIKE concat(#{unitName}, '%')
......
......@@ -108,7 +108,7 @@
<select id="getTodayAlertCalled" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto">
select
jc_alert_called.alarm_type alarmType,
jc_alert_called.alert_type alarmType,
jc_alert_called.address,
jc_alert_called.call_time callTime
from jc_alert_called where is_delete=0
......
......@@ -62,6 +62,11 @@ public class CheckShot extends BasicEntity {
private long checkInputId;
/**
* 照片配置key(关联照片和拍照设置),来源picture_json
*/
private String photoConfKey;
/**
* 扩展分类id
*/
@Column(name="classify_id")
......@@ -113,6 +118,14 @@ public class CheckShot extends BasicEntity {
this.photoData = photoData;
}
public String getPhotoConfKey() {
return photoConfKey;
}
public void setPhotoConfKey(String photoConfKey) {
this.photoConfKey = photoConfKey;
}
public String getPointName() {
return this.pointName;
}
......
......@@ -63,7 +63,7 @@ public class DutyCarController extends BaseController {
public ResponseModel list(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyCarService.list(beginDate, endDate));
return ResponseHelper.buildResponse(iDutyCarService.list(null,beginDate, endDate));
}
......
......@@ -61,8 +61,9 @@ public class DutyPersonController extends BaseController {
@GetMapping(value = "/list")
@ApiOperation(httpMethod = "GET", value = "值班列表视图-不分页", notes = "值班列表视图-不分页")
public ResponseModel list(@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.list(beginDate, endDate));
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@RequestParam(required = false) Long teamId) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.list(teamId,beginDate, endDate));
}
......
......@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceCraneDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceHydrantDto;
......@@ -400,4 +401,16 @@ public class WaterResourceController extends BaseController {
public ResponseModel<List<WaterResourceTypeDto>> selectResourceTypeList() {
return ResponseHelper.buildResponse(waterResourceServiceImpl.getWaterResourceTypeList(true));
}
/**
* 生成二维码code
*
* @return string
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "生成二维码code", notes = "生成二维码code")
@GetMapping(value = "/qr/code")
public ResponseModel<String> genQrCode() {
return ResponseHelper.buildResponse(QRCodeUtil.generateQRCode());
}
}
......@@ -21,6 +21,8 @@ import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -1295,6 +1297,22 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return pid;
}
/**
* 查询组织机构下面的人员信息
* @param id
* @return
*/
public List<OrgUsr> getPersonListByParentId(Long id) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>();
wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.eq(OrgUsr::getParentId,id);
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
return this.baseMapper.selectList(wrapper);
}
@Override
public List<Map<String, Object>> getLoginUserDetails (AgencyUserModel user) {
......
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.maintenance.business.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dto.CheckDto;
import com.yeejoin.amos.maintenance.business.dto.CheckInputDto;
import com.yeejoin.amos.maintenance.business.dto.CheckShotDto;
import com.yeejoin.amos.maintenance.business.param.CheckInfoPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckRecordParam;
import com.yeejoin.amos.maintenance.business.param.CheckStatisticalParam;
......@@ -11,7 +13,6 @@ import com.yeejoin.amos.maintenance.business.util.*;
import com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.maintenance.business.vo.CheckInfoVo;
import com.yeejoin.amos.maintenance.common.enums.CheckRecordOrderByEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskOrderByEnum;
import com.yeejoin.amos.maintenance.core.async.AsyncTask;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.request.CommonRequest;
......@@ -19,7 +20,6 @@ import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.maintenance.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import com.yeejoin.amos.maintenance.core.util.StringUtil;
import com.yeejoin.amos.maintenance.dao.entity.Check;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......@@ -36,6 +36,8 @@ import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.*;
......@@ -526,18 +528,25 @@ public class CheckController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "维保记录排序条件列表", notes = "维保记录排序条件列表")
@RequestMapping(value = "/orderBy/list", method = RequestMethod.GET)
public CommonResponse getOrderByList() {
return CommonResponseUtil.success(CheckRecordOrderByEnum.getEnumList());
public ResponseModel getOrderByList() {
return ResponseHelper.buildResponse(CheckRecordOrderByEnum.getEnumList());
}
@ApiOperation(value = "/设备设施维保记录分页列表",notes = "外部接口装备和者水源使用")
@GetMapping(value = "page/{originalId}/list")
public CommonResponse getCheckListByOriginalId(
public ResponseModel getCheckListByOriginalId(
@PathVariable String originalId,
@RequestParam(value = "current") int pageNum,
@RequestParam(value = "size") int pageSize
){
CommonPageable pageable = new CommonPageable(pageNum,pageSize);
return CommonResponseUtil.success(checkService.getCheckListByOriginalId(originalId,pageable));
return ResponseHelper.buildResponse(checkService.getCheckListByOriginalId(originalId,pageable));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "web端维保记录详情")
@GetMapping(value = "input/{checkId}/detail")
public ResponseModel inputDetail(@ApiParam(value = "记录主表id") @PathVariable String checkId){
return ResponseHelper.buildResponse(checkService.getInputDetail(checkId));
}
}
......@@ -9,9 +9,9 @@ import com.yeejoin.amos.maintenance.business.util.CommonResponseUtil;
import com.yeejoin.amos.maintenance.business.util.FileHelper;
import com.yeejoin.amos.maintenance.business.util.PlanTaskPageParamUtil;
import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskOrderByEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskDetailIsFinishEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskOrderByEnum;
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;
......@@ -27,6 +27,8 @@ import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
......@@ -47,6 +49,7 @@ public class PlanTaskController extends AbstractBaseController {
/**
* 计划执行查询
*
* @param queryRequests
* @param commonPageable
* @return
......@@ -196,16 +199,16 @@ public class PlanTaskController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保任务查询-mobile", notes = "根据用户条件查询所有计划任务-mobile")
@RequestMapping(value = "/queryPlanTask", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryLoginUserPlanTask(
public ResponseModel<Page<Map<String, Object>>> qryLoginUserPlanTask(
@ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId,
@ApiParam(value = "开始日期", required = true) @RequestParam(value = "startDate") String startTime,
@ApiParam(value = "结束日期", required = true) @RequestParam(value = "endDate") String endTime,
@ApiParam(value = "开始日期") @RequestParam(value = "startDate", required = false) String startTime,
@ApiParam(value = "结束日期") @RequestParam(value = "endDate", required = false) String endTime,
@ApiParam(value = "维保状态") @RequestParam(value = "finishStatus", required = false) Integer finishStatus,
@ApiParam(value = "排序条件") @RequestParam(value = "orderBy", defaultValue = "1") String orderBy,
@ApiParam(value = "业主单位") @RequestParam(value = "companyId", required = false) String companyId,
@ApiParam(value = "当前页", required = true) @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小", required = true) @RequestParam(value = "pageSize") int pageSize) throws Exception {
HashMap<String, Object> params = new HashMap<>();
Map<String, Object> params = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
......@@ -218,13 +221,13 @@ public class PlanTaskController extends AbstractBaseController {
params.put("finishStatus", finishStatus);
params.put("orderBy", PlanTaskOrderByEnum.getEumByCode(orderBy).getOderBy());
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return CommonResponseUtil.success(planTaskService.getPlanTasks(params, pageable));
return ResponseHelper.buildResponse(planTaskService.getPlanTasks(params, pageable));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保设施分页列表-mobile", notes = "维保设施分页列表-mobile")
@RequestMapping(value = "/point/{planTaskId}/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryPlanTaskById(
public ResponseModel qryPlanTaskById(
@ApiParam(value = "巡检计划任务ID", required = true) @PathVariable Long planTaskId,
@ApiParam(value = "建筑id", required = true) @RequestParam(value = "buildingId", required = false) String buildingId,
@ApiParam(value = "维保状态", required = true) @RequestParam(value = "isFinish", required = false) String isFinish,
......@@ -239,39 +242,37 @@ public class PlanTaskController extends AbstractBaseController {
param.put("systemId", systemId);
param.put("pointNo", pointNo);
param.put("pointName", pointName);
return CommonResponseUtil.success(planTaskService.getPlanTaskPoints(param));
return ResponseHelper.buildResponse(planTaskService.getPlanTaskPoints(param));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询维保设施,检查内容详情")
@GetMapping(value = "/task-point-detail")
public CommonResponse planTaskPointDetail(
public ResponseModel planTaskPointDetail(
@RequestParam(value = "routePointId") String routePointId,
@RequestParam(value = "id") String planTaskDetailId
) {
return CommonResponseUtil.success(planTaskService.planTaskPointDetail(planTaskDetailId, routePointId));
return ResponseHelper.buildResponse(planTaskService.planTaskPointDetail(planTaskDetailId, routePointId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保设施完成状态下拉列表")
@GetMapping(value = "/taskDetail/finishStatus/list")
public CommonResponse planTaskPointDetail() {
return CommonResponseUtil.success(PlanTaskDetailIsFinishEnum.getEnumList());
public ResponseModel planTaskPointDetail() {
return ResponseHelper.buildResponse(PlanTaskDetailIsFinishEnum.getEnumList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "计划任务完成状态列表", notes = "计划任务完成状态列表")
@RequestMapping(value = "/finishStatus/list", method = RequestMethod.GET)
public CommonResponse getPlanTaskFinishStatus() {
return CommonResponseUtil.success(PlanTaskFinishStatusEnum.getEnumList());
public ResponseModel getPlanTaskFinishStatus() {
return ResponseHelper.buildResponse(PlanTaskFinishStatusEnum.getEnumList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "维保任务排序条件", notes = "维保任务排序条件")
@RequestMapping(value = "/orderBy/list", method = RequestMethod.GET)
public CommonResponse getOrderByList() {
return CommonResponseUtil.success(PlanTaskOrderByEnum.getEnumList());
public ResponseModel getOrderByList() {
return ResponseHelper.buildResponse(PlanTaskOrderByEnum.getEnumList());
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.maintenance.business.dto.CheckInputDto;
import com.yeejoin.amos.maintenance.business.param.CheckStatisticalParam;
import com.yeejoin.amos.maintenance.business.util.CheckDetailInputPageParam;
import org.apache.ibatis.annotations.Param;
......@@ -16,7 +17,6 @@ import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckUserBo;
import com.yeejoin.amos.maintenance.business.param.CheckInfoListPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckInfoPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckRecordParam;
import com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.maintenance.business.vo.CheckInfoVo;
import com.yeejoin.amos.maintenance.core.common.response.PointCheckInfoBusinessRespone;
......@@ -283,4 +283,11 @@ public interface CheckMapper extends BaseMapper {
Map<String, Object> getCheckDetail(@Param(value = "id") String id);
/**
* 检查项结果列表
* @param checkId 检查记录主表id
* @param fileUrl 文件服务器前缀
* @return List<CheckInputDto>
*/
List<CheckInputDto> queryCheckInputDetail(@Param("checkId") String checkId, @Param("fileUrl") String fileUrl);
}
......@@ -68,7 +68,7 @@ public interface PlanTaskMapper extends BaseMapper {
* @param params
* @return
*/
List<HashMap<String, Object>> getPlanTasks(HashMap<String, Object> params);
List<Map<String, Object>> getPlanTasks(Map<String, Object> params);
/**
* 通过计划任务Id获得计划任务信息
* @param planTaskId
......@@ -120,7 +120,13 @@ public interface PlanTaskMapper extends BaseMapper {
* @return
*/
List<CheckChkExListBo> getChkExList(CheckPtListPageParam param);
long getPlanTasksCount(HashMap<String, Object> params);
/**
* 数量统计
* @param params
* @return
*/
long getPlanTasksCount(Map<String, Object> params);
Map<String, Object> getPlanTaskStatisticsForApp(HashMap<String, Object> params);
......
package com.yeejoin.amos.maintenance.business.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author DELL
*/
@Data
public class CheckInputDto {
private Long checkInputId;
private Long inputId;
private String inputName;
private Integer orderNo;
private String inputValue;
private String isOk;
private String isOkDesc;
private String pictureJson;
private String dataJson;
private String remark;
private List<CheckShotDto> checkInputShot;
}
......@@ -7,6 +7,19 @@ import lombok.Data;
*/
@Data
public class CheckShotDto {
private Long checkShotId;
/**
* 照片类型:1-检查项照片;2-不合格照片
*/
private String shotType;
/**
* 照片路径
*/
private String fileUrl;
/**
* 照片配置key,用来照片和具体的拍照配置对应
*/
private String photoConfKey;
}
package com.yeejoin.amos.maintenance.business.dto;
import lombok.Data;
/**
* @author DELL
*/
@Data
public class PictureJsonConfig {
/**
* 是否必输
*/
private String isMust;
/**
* 名称
*/
private String name;
/**
* 排序
*/
private Integer orderNo;
/**
* 拍照数量
*/
private String picNumber;
/**
* 配置key
*/
private String photoConfKey;
}
......@@ -21,7 +21,7 @@ public class CheckRecordParam {
@ApiModelProperty(value = "点id",required = true)
private Long pointId;
@ApiModelProperty(value = "组织机构",required = false)
@ApiModelProperty(value = "组织机构")
private String orgCode;
@ApiModelProperty(value = "备注")
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.service.action;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.maintenance.business.dao.repository.ICheckInputDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IInputItemDao;
import com.yeejoin.amos.maintenance.business.entity.mybatis.EquipmentInputItemRo;
......@@ -37,6 +38,8 @@ public class AcceptEquipmentRules {
private ICheckInputDao checkInputDao;
@Value("${input.statute.prefix}")
private String statutePre;
@Autowired
private Sequence sequence;
public void getContent(
......@@ -71,6 +74,7 @@ public class AcceptEquipmentRules {
pictureObject.put("name", "拍照");
pictureObject.put("orderNo", "0");
pictureObject.put("picNumber", 0);
pictureObject.put("photoConfKey",String.valueOf(sequence.nextId()));
pictureArray.add(pictureObject);
item.setPictureJson(pictureArray.toJSONString());
} else {
......
......@@ -18,6 +18,7 @@ import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.*;
import com.yeejoin.amos.maintenance.business.dto.CheckDto;
import com.yeejoin.amos.maintenance.business.dto.CheckInputDto;
import com.yeejoin.amos.maintenance.business.dto.CheckRecordDto;
import com.yeejoin.amos.maintenance.business.dto.CheckShotDto;
import com.yeejoin.amos.maintenance.business.entity.mybatis.*;
......@@ -210,6 +211,7 @@ public class CheckServiceImpl implements ICheckService {
img.setPointName(check.getPointName());
img.setShotType(shotDto.getShotType());
img.setPhotoData(shotDto.getFileUrl());
img.setPhotoConfKey(shotDto.getPhotoConfKey());
checkShots.add(img);
}
checkInput.setCheckShotList(checkShots);
......@@ -236,7 +238,7 @@ public class CheckServiceImpl implements ICheckService {
Check finalCheck = check;
//4.检查项入库
checkItemList.forEach(checkInput -> checkInput.setCheckId(finalCheck.getId()));
if(!checkItemList.isEmpty()){
if (!checkItemList.isEmpty()) {
checkInputDao.saveAll(checkItemList);
}
List<CheckShot> allShot = new ArrayList<>();
......@@ -255,11 +257,11 @@ public class CheckServiceImpl implements ICheckService {
planTaskDetailMapper.finishTaskDetail(Long.parseLong(detail.get("planTaskDetailId").toString()), recordParam.getPointId(), recordParam.getPlanTaskId(), mtUserSeq);
//6.消息广播最近维保日期
if(StringUtil.isNotEmpty(point.getOriginalId())){
if (StringUtil.isNotEmpty(point.getOriginalId())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("fireFacilityId",point.getOriginalId());
jsonObject.put("maintenanceTime",check.getCheckTime());
mqttGateway.publish(CHECK_UPDATE_TOPIC,jsonObject.toJSONString());
jsonObject.put("fireFacilityId", point.getOriginalId());
jsonObject.put("maintenanceTime", check.getCheckTime());
mqttGateway.publish(CHECK_UPDATE_TOPIC, jsonObject.toJSONString());
}
//7.返回不合格记录
return new CheckDto(check.getId(), unqualifiedCheckItemList);
......@@ -271,7 +273,7 @@ public class CheckServiceImpl implements ICheckService {
private void checkCanFinishTask(String mtUserSeq, PlanTask planTask, Long pointId) throws Exception {
int status;
int count = checkService.checkHasRecord(planTask.getId(), pointId);
if(count > 0){
if (count > 0) {
throw new RuntimeException("任务已执行,不能重复执行");
}
if (!ToolUtils.transBeanList(planTask.getUserId()).contains(mtUserSeq)) {
......@@ -414,7 +416,7 @@ public class CheckServiceImpl implements ICheckService {
@Override
public Page<Check> getCheckListByOriginalId(String originalId, CommonPageable pageable) {
Point point = iPointDao.findByOriginalId(originalId);
if(point == null){
if (point == null) {
throw new RuntimeException("不存在该设备设施");
}
List<DaoCriteria> criterias = new ArrayList<>();
......@@ -429,7 +431,19 @@ public class CheckServiceImpl implements ICheckService {
orders.add(idOrder);
Sort sort = Sort.by(orders);
pageable.setSort(sort);
return checkDao.findAll(spec,pageable);
return checkDao.findAll(spec, pageable);
}
@Override
public List<CheckInputDto> getInputDetail(String checkId) {
List<CheckInputDto> list = this.checkMapper.queryCheckInputDetail(checkId,fileUrl);
list.forEach(input->{
CheckStatusEnum statusEnum = CheckStatusEnum.getEnum(input.getIsOk());
if(statusEnum != null){
input.setIsOkDesc(statusEnum.getName());
}
});
return list;
}
@Override
......@@ -674,12 +688,12 @@ public class CheckServiceImpl implements ICheckService {
Map<String, Object> charData = checkMapper.pieChartData(param);
List<Map<String, Object>> calendarData = checkMapper.calendarData(param);
Map<String, Object> result = new HashMap<>();
Map<String,List<CalendarStatusCountRespone>> calendarMap = calendarData.stream().collect(Collectors.groupingBy(map -> map.get("time").toString(),Collectors.mapping(c->{
Map<String, List<CalendarStatusCountRespone>> calendarMap = calendarData.stream().collect(Collectors.groupingBy(map -> map.get("time").toString(), Collectors.mapping(c -> {
CalendarStatusCountRespone countRespone = new CalendarStatusCountRespone();
countRespone.setCount(Long.parseLong(c.get("count").toString()));
countRespone.setStatus(c.get("status").toString());
return countRespone;
},Collectors.toList())));
}, Collectors.toList())));
result.put("charData", charData);
result.put("calendarData", calendarMap);
return result;
......@@ -1077,7 +1091,7 @@ public class CheckServiceImpl implements ICheckService {
params.put("pageSize", page.getPageSize());
content = checkMapper.getChecks(params);
if (0 < content.size()) {
for(HashMap<String, Object> map : content) {
for (HashMap<String, Object> map : content) {
if (map.containsKey("isOk")) {
map.put("status", CheckStatusEnum.getEnum(String.valueOf(map.get("isOk"))).getName());
}
......
package com.yeejoin.amos.maintenance.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.IInputItemDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IPointInputItemDao;
import com.yeejoin.amos.maintenance.business.dto.PictureJsonConfig;
import com.yeejoin.amos.maintenance.business.param.CheckInputParam;
import com.yeejoin.amos.maintenance.business.param.InputItemPageParam;
import com.yeejoin.amos.maintenance.business.service.intfc.ICatalogTreeService;
......@@ -15,6 +18,7 @@ import com.yeejoin.amos.maintenance.business.util.DaoCriteria;
import com.yeejoin.amos.maintenance.business.vo.InputItemTemplateVo;
import com.yeejoin.amos.maintenance.business.vo.InputItemVo;
import com.yeejoin.amos.maintenance.business.vo.PointInputItemVo;
import com.yeejoin.amos.maintenance.core.util.StringUtil;
import com.yeejoin.amos.maintenance.core.util.query.BaseQuerySpecification;
import com.yeejoin.amos.maintenance.dao.entity.CheckInput;
import com.yeejoin.amos.maintenance.dao.entity.InputItem;
......@@ -28,6 +32,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.*;
......@@ -42,17 +47,26 @@ public class InputItemServiceImpl implements IInputItemService {
RouteMapper routeMapper;
@Autowired
InputItemMapper inputItemMapper;
@Autowired
private ICatalogTreeService iCatalogTreeService;
@Value("${input.custom.prefix}")
private String customPre;
@Autowired
private RemoteSecurityService remoteSecurityService;
@Autowired
private Sequence sequence;
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public long addNewInputItem(InputItem param) {
List<PictureJsonConfig> pictureJsonConfigs = JSON.parseArray(param.getPictureJson(), PictureJsonConfig.class);
for(PictureJsonConfig p: pictureJsonConfigs){
if(StringUtils.isEmpty(p.getPhotoConfKey())){
p.setPhotoConfKey(String.valueOf(sequence.nextId()));
}
}
param.setPictureJson(JSONObject.toJSONString(pictureJsonConfigs));
if (param.getId() > 0) {
inputItemMapper.updateInputItem(param);
} else {
......@@ -200,7 +214,7 @@ public class InputItemServiceImpl implements IInputItemService {
public Boolean uploadListByTemplate(List<InputItemTemplateVo> itemTemplateVoList, String orgCode, String userId) throws Exception {
List<InputItem> list = new ArrayList<>();
if (!CollectionUtils.isEmpty(itemTemplateVoList)) {
itemTemplateVoList.stream().forEach(x -> {
itemTemplateVoList.forEach(x -> {
InputItem inputItem = new InputItem();
BeanUtils.copyProperties(x, inputItem);
inputItem.setOrgCode(orgCode);
......
package com.yeejoin.amos.maintenance.business.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.beust.jcommander.internal.Sets;
import com.google.common.base.Joiner;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanMapper;
......@@ -13,20 +8,16 @@ import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.*;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.PointCheckDetailBo;
import com.yeejoin.amos.maintenance.business.feign.EquipFeignClient;
import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam;
import com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam;
import com.yeejoin.amos.maintenance.business.service.intfc.ICheckService;
import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.maintenance.business.util.PlanTaskUtil;
import com.yeejoin.amos.maintenance.business.util.Toke;
import com.yeejoin.amos.maintenance.business.vo.CalDateVo;
import com.yeejoin.amos.maintenance.business.vo.LeavePlanTaskVo;
import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.maintenance.core.util.DateUtil;
import com.yeejoin.amos.maintenance.core.util.StringUtil;
import com.yeejoin.amos.maintenance.dao.entity.*;
......@@ -42,7 +33,6 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -503,8 +493,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Override
public Page<HashMap<String, Object>> getPlanTasks(HashMap<String, Object> params, CommonPageable pageParam) {
List<HashMap<String, Object>> content = Lists.newArrayList();
public Page<Map<String, Object>> getPlanTasks(Map<String, Object> params, CommonPageable pageParam) {
List<Map<String, Object>> content = Lists.newArrayList();
long total = planTaskMapper.getPlanTasksCount(params);
if (total == 0) {
return new PageImpl<>(content, pageParam, total);
......@@ -512,6 +502,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
params.put("offset", pageParam.getOffset());
params.put("pageSize", pageParam.getPageSize());
content = planTaskMapper.getPlanTasks(params);
content.forEach(c -> {
if (c.containsKey("finishStatus")) {
String finishStatusDesc = PlanTaskFinishStatusEnum.getName(Integer.parseInt(c.get("finishStatus").toString()));
c.put("finishStatusDesc", finishStatusDesc);
}
});
return new PageImpl<>(content, pageParam, total);
}
......@@ -656,10 +652,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
@Override
public String getCumulativePlanCountByOrgCode(String loginOrgCode) {
return planTaskMapper.getCumulativePlanCountByOrgCode(loginOrgCode);
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.maintenance.business.service.intfc;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.maintenance.business.dto.CheckDto;
import com.yeejoin.amos.maintenance.business.dto.CheckInputDto;
import com.yeejoin.amos.maintenance.business.dto.CheckRecordDto;
import com.yeejoin.amos.maintenance.business.entity.mybatis.*;
import com.yeejoin.amos.maintenance.business.param.*;
......@@ -269,4 +270,11 @@ public interface ICheckService {
int checkHasRecord(Long planTaskId, Long pointId);
Page<Check> getCheckListByOriginalId(String originalId, CommonPageable pageable);
/**
* 维保检查项详情
* @param checkId 记录ID
* @return List<CheckInputDto>
*/
List<CheckInputDto> getInputDetail(String checkId);
}
......@@ -66,7 +66,7 @@ public interface IPlanTaskService {
* @param page
* @return
*/
Page<HashMap<String, Object>> getPlanTasks(HashMap<String, Object> params, CommonPageable page);
Page<Map<String, Object>> getPlanTasks(Map<String, Object> params, CommonPageable page);
/**
......
......@@ -7,7 +7,7 @@
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<changeSet author="guowubin" id="1629430730658-1">
<changeSet author="guowubin" id="1629430730658-1">
<comment>alter table jc_controller</comment>
<sql>
DROP TABLE IF EXISTS `jc_controller`;
......@@ -83,5 +83,19 @@
INSERT INTO `jc_controller_equip` VALUES (1397145718640209921, 1428325285853433857, '103', '4号门', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
</sql>
</changeSet>
<changeSet author="tb" id="2021-08-23-tb-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_water_resource"/>
</preConditions>
<comment>modify table cb_water_resource add several columns</comment>
<sql>
ALTER TABLE `cb_water_resource` ADD equip_id BIGINT ( 20 ) COMMENT '设施定义',
ADD COLUMN equip_name VARCHAR ( 50 ) COMMENT '设施定义名称',
ADD COLUMN equip_category_id BIGINT ( 20 ) COMMENT '设施分类',
ADD COLUMN equip_category_name VARCHAR ( 50 ) COMMENT '设施分类名称',
ADD COLUMN equip_code VARCHAR ( 20 ) COMMENT '设施编码',
ADD COLUMN maintenance_period VARCHAR ( 10 ) COMMENT '维保周期';
</sql>
</changeSet>
</databaseChangeLog>
......@@ -12,10 +12,6 @@
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-maintenance-biz</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<artifactId>mysql-connector-java</artifactId>
<groupId>mysql</groupId>
</dependency>
</dependencies>
<build>
......
......@@ -47,4 +47,15 @@
ALTER TABLE p_check_shot modify `org_code` varchar(100) DEFAULT NULL COMMENT '权限系统org code';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1629788256095-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_check_shot" columnName="photo_conf_key"/>
</not>
</preConditions>
<comment>p_check_shot add COLUMN photo_conf_key 增加项和照片关联</comment>
<sql>
ALTER TABLE p_check_shot add COLUMN `photo_conf_key` varchar(32) DEFAULT NULL COMMENT '照片配置key(关联照片和拍照设置)';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -2063,4 +2063,41 @@
WHERE
pc.id = #{id}
</select>
<select id="queryCheckInputDetail" resultMap="checkInputWithPhotoMap">
select
ci.id,
ci.input_id,
ci.input_name,
ci.input_value,
ci.is_ok,
ci.remark,
ci.order_no,
#{fileUrl} as prefix,
ii.picture_json,
ii.data_json
from p_check_input ci
left join p_input_item ii on ci.input_id = ii.id
where ci.check_id=#{checkId}
order by order_no
</select>
<resultMap id="checkInputWithPhotoMap" type="com.yeejoin.amos.maintenance.business.dto.CheckInputDto">
<result column="id" property="checkInputId"/>
<collection
property="checkInputShot"
ofType="com.yeejoin.amos.maintenance.business.dto.CheckShotDto"
select="queryCheckShot"
column="{checkInputId=id,prefix=prefix}"
/>
</resultMap>
<select id="queryCheckShot" resultType="com.yeejoin.amos.maintenance.business.dto.CheckShotDto">
select
id as checkShotId,
check_input_id,
shot_type,
photo_conf_key,
concat(#{prefix},photo_data) as fileUrl
from
p_check_shot
where check_input_id = #{checkInputId}
</select>
</mapper>
\ No newline at end of file
......@@ -214,7 +214,7 @@
<sql id="mobile-plan-task-where">
<where>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="finishStatus != null and finishStatus!=''"> and a.finishStatus = #{finishStatus}</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
(
......@@ -238,7 +238,7 @@
<choose>
<when test="identityType==1">
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )
<if test="companyId != null"> and a.owner_id = #{companyId}</if>
<if test="companyId != null and companyId != ''"> and a.owner_id = #{companyId}</if>
</when>
<when test="identityType==2">
And a.owner_id = #{companyId}
......
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