Commit b60ea384 authored by zhengjuzi's avatar zhengjuzi

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

parents 0e605a2a f2b713ef
package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.dto.EquScheduleDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.LicScheduleDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderInfo;
public interface ScheduleMapper {
EquScheduleDto getEquDetail(String sequenceCode);
......@@ -10,4 +13,6 @@ public interface ScheduleMapper {
LicScheduleDto getLicDetail(String certNo);
CylinderInfoDto getCylDetail(String sequenceCode);
Page<CylinderInfo> cylinderInfoPage(Page<CylinderInfo> page);
}
......@@ -58,4 +58,10 @@
ci.sequence_code = #{sequenceCode}
</select>
<select id="cylinderInfoPage" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderInfo">
SELECT ci.sequence_nbr,ci.sequence_code
FROM tz_cylinder_inspection ip
LEFT JOIN tz_cylinder_info ci ON ip.sequence_code = ci.sequence_code
</select>
</mapper>
......@@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -85,9 +86,9 @@ public class ScheduleService {
Page<CylinderInfo> cylPage = new Page<>();
cylPage.setCurrent(i);
cylPage.setSize(size);
LambdaQueryWrapper<CylinderInfo> cylWrapper = new LambdaQueryWrapper<>();
cylWrapper.select(CylinderInfo::getSequenceCode, CylinderInfo::getSequenceNbr).orderByDesc(CylinderInfo::getSequenceNbr);
IPage<CylinderInfo> cylresult = cylinderInfoService.page(cylPage, cylWrapper);
// LambdaQueryWrapper<CylinderInfo> cylWrapper = new LambdaQueryWrapper<>();
// cylWrapper.select(CylinderInfo::getSequenceCode, CylinderInfo::getSequenceNbr).orderByDesc(CylinderInfo::getSequenceNbr);
IPage<CylinderInfo> cylresult = scheduleMapper.cylinderInfoPage(cylPage);
for (CylinderInfo r : cylresult.getRecords()) {
// 设置token
tzsAuthService.setRequestContext();
......@@ -149,13 +150,21 @@ public class ScheduleService {
CylinderInfoDto cylinderInfoDto = this.getCylDetail(r.getSequenceCode());
try {
WarningMsgDto warningMsgDto = new WarningMsgDto();
//没有下次检验日期的气瓶默认正常
if(!ValidationUtil.isEmpty(cylinderInfoDto.getNextInspectionDate())){
System.out.println("气瓶编号为:"+cylinderInfoDto.getSequenceCode()+"的气瓶,没有下次检验日期数据");
return;
}
int interval = DateUtils.dateBetweenIncludeToday(now, cylinderInfoDto.getNextInspectionDate()) - 1;
if(interval<30 && interval>=0){
warningMsgDto.setOverType("即将超期");
}else if(interval<0){
warningMsgDto.setOverType("已超期");
}else{
//正常的气瓶不需要发消息
warningMsgDto.setOverType("正常");
return;
}
warningMsgDto.setNextInspectDate(new SimpleDateFormat("yyyy-MM-dd").format(cylinderInfoDto.getNextInspectionDate()));
warningMsgDto.setType("气瓶");
......
package com.yeejoin.amos.boot.module.ugp.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum CheckEnum {
符合("accord","符合"),
不符合("accord","不符合"),
有效("valid","有效"),
已过期("valid","已过期"),
合格期内("peopleStatus","合格期内"),
超期未检("peopleStatus","超期未检");
String key;
String name;
}
......@@ -15,9 +15,9 @@ import java.util.Map;
@AllArgsConstructor
public enum StageEnum {
焊前人员("","STAFF","人员"),
焊前人员("焊前确定","STAFF","人员"),
焊前设备("焊前确定","EQUIPMENT","设备"),
焊前管材质量("","BEFORE-WELDING","管材"),
焊前管材质量("焊前确定","BEFORE-WELDING","管材"),
焊接工艺("工艺确定","CRAFT","工艺"),
管道耐压("耐压确定","VOLTAGE","耐压"),
敷设质量("敷设确定","LAY","敷设"),
......@@ -26,7 +26,6 @@ public enum StageEnum {
private String name;
private String stage;
private String verifyName;
......
......@@ -15,6 +15,6 @@ public class OpenDto {
private String accord; //符合性
private String valid; //有效性
private String result;//结果
private Long detailId;//跳转id
private String detailId;//跳转id 或者管材编码
}
......@@ -112,5 +112,5 @@ public class SmartListDto extends BaseDto {
private Long welderId;
private Long weldingId;
private Long materialId;
private String materialCode;
}
......@@ -77,9 +77,15 @@
<select id="selectByWelder" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Verify">
SELECT * FROM tz_ugp_verify where
SELECT * FROM tz_ugp_verify
<where>
<if test="projectId !=null and projectId !=''">
project_id =#{projectId}
and target_info -> "$.welderId" = #{welderId}
</if>
<if test="welderId !=null and welderId !=''">
and
target_info -> "$.welderId" = #{welderId}
</if>
<if test="code !=null and code !=''">
and
target_info -> "$.code" =#{code}
......@@ -91,6 +97,7 @@
and
target_info -> "$.random" =#{random}
</if>
</where>
</select>
......
......@@ -230,4 +230,6 @@ public class MaterialController extends BaseController {
attachmentMapper.deleteBySourceId(sequenceNbr);
return ResponseHelper.buildResponse(materialServiceImpl.removeById(sequenceNbr));
}
}
......@@ -295,8 +295,18 @@ public class VerifyController extends BaseController {
page.setRecords(verifyServiceImpl.selectById(sequenceNbr));
return ResponseHelper.buildResponse(page);
}
/**
* cpp
* 耐压所属焊口查看
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/lookWeld")
@ApiOperation(httpMethod = "GET", value = "耐压所属焊口查看", notes = "耐压所属焊口查看")
public ResponseModel<JSONObject> lookWeld(@RequestParam Long sequenceNbr) {
return ResponseHelper.buildResponse(verifyServiceImpl.getWeldLook(sequenceNbr));
}
}
......
......@@ -32,6 +32,7 @@ import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -77,6 +78,8 @@ public class WelderController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "新增人员信息", notes = "新增人员信息")
public ResponseModel<OrgUsrDto> saveWelder(@RequestBody JSONObject jsonObject, @RequestParam String bizOrgType ,
@RequestParam(required = false) String sequenceNbr) {
//当有seq时判断是否已绑定项目
if (!ValidationUtil.isEmpty(sequenceNbr)){
String sequenceNbrDept = orgService.getOrgUsrById(jsonObject.getString("sequenceNbr")).getParentId();
//修改部门时判断用户是否是部门负责人
if (!sequenceNbrDept.equals(jsonObject.getString("deptId"))) {
......@@ -89,6 +92,8 @@ public class WelderController extends BaseController {
}
}
}
}
return ResponseHelper.buildResponse(welderServiceImpl.savePerson(jsonObject, bizOrgType, sequenceNbr));
}
/**
......@@ -228,7 +233,8 @@ public class WelderController extends BaseController {
try {
map.put("dept", orgServiceImpl.getOrgUsrById(String.valueOf(map.get("deptId"))).getBizOrgName());
} catch (Exception e) {
map.put("dept",String.valueOf(map.get("deptId")));
// map.put("dept",String.valueOf(map.get("deptId")));
map.put("dept", "");
}
if(OrgEnum.焊工.getKey().equals((String)map.get("type"))){
map.put("typeName",OrgEnum.焊工.getName());
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
......@@ -27,6 +28,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Author cpp
......@@ -100,7 +102,6 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
for (PercentOfPassDto pr : list) {
//获取项目id
Long projectId = pr.getProjectId ( );
//通过项目id查询焊口数据
List<WeldDto> weldDtoList = weldService.getProjectId (projectId);
......@@ -108,24 +109,16 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
//获取焊口信息总条数
int sum = weldDtoList.size ( );
//焊口合格数
int qualifiedData = 0;
for (WeldDto weldDto : weldDtoList) {
String superInspecStatus = weldDto.getSuperInspecStatus ( );
if (superInspecStatus.equals ("合格")) {
qualifiedData++;
}
}
List<WeldDto> collect = weldDtoList.stream( ).filter(weld -> StageEnum.焊接工艺.getName( ).equals(weld.getSuperInspecStatus( ))).collect(Collectors.toList( ));
int qualifiedData = collect.size();
//合格率
BigDecimal sums = new BigDecimal (sum);
BigDecimal qualifiedDatas = new BigDecimal (qualifiedData);
Double pass = qualifiedDatas.divide (sums, 2, BigDecimal.ROUND_HALF_UP).multiply (new BigDecimal (100)).doubleValue ( );
//转换成百分比,生成合格率
String fpy = pass.toString ( ) + "%";
//将合格率赋值给数据集合
pr.setPercentOfPass (fpy);
//将数据添加到新集合里面
newsData.add (pr);
......
......@@ -134,6 +134,26 @@ public class OrgServiceImpl {
orgUsr = orgUsrServiceImpl.getById(sequenceNbr);
}
}
//部门负责人修改
if(!ValidationUtil.isEmpty(jsonObject.getString("sequenceNbr")) && !ValidationUtil.isEmpty(jsonObject.getString("charge"))) {
if (!ValidationUtil.isEmpty(orgUsrServiceImpl.getById(jsonObject.getString("charge")))) {
if (!ValidationUtil.isEmpty(sequenceNbr)){
OrgUsr orgUsr1 = orgUsrServiceImpl.getById(jsonObject.getString("charge")).setParentId(sequenceNbr);
if (jsonObject.get("typeUser").equals("addUser")&& orgUsr1.getBizOrgCode().length()== ORG_CODE_USER ) {//部门负责人修改(十八位的话不需要更改code)
orgUsr1.setBizOrgCode(orgUsr.getBizOrgCode()+OrgUsrServiceImpl.getOrgCodeStr());
}
//更改其公司下所属部门
orgUsrServiceImpl.saveOrUpdate(orgUsr1);
LambdaQueryWrapper<DynamicFormInstance> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(DynamicFormInstance ::getInstanceId,jsonObject.getString("charge"));
lambdaQueryWrapper.eq(DynamicFormInstance ::getFieldCode,"deptId");
DynamicFormInstance one = alertFormValueServiceImpl.getOne(lambdaQueryWrapper);
one.setFieldValue(sequenceNbr);
//保存或更新 根据sequenceNbr
alertFormValueServiceImpl.saveOrUpdate(one);
}
}
}
orgUsr.setRecDate(new Date());
orgUsr.setBizOrgName(jsonObject.getString("name"));
orgUsr.setSequenceNbr(jsonObject.getLong("sequenceNbr"));
......@@ -169,10 +189,12 @@ public class OrgServiceImpl {
//设置所属机构
orgUsr.setParentId(String.valueOf(orgUsrServiceImpl.getOne(wrapper).getSequenceNbr()));
}
//设置所属机构
if (OrgEnum.部门.getKey().equals(bizOrgType)) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(reginParams.getCompany().getSequenceNbr()));
orgUsr.setParentId(String.valueOf(orgUsrServiceImpl.getOne(wrapper).getSequenceNbr()));
}
//设置bizOrgCode
if (orgUsr.getParentId() != null) {
......
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