Commit 77286dac authored by zhangyingbin's avatar zhangyingbin

修改ugp问题

parent f6d601f3
......@@ -64,5 +64,14 @@ public class RectifyMsgDto extends BaseDto {
private String noticeUnitName;
@ApiModelProperty(value = "项目安装区域")
private String installRegion;
@ApiModelProperty(value = "项目开工日期")
private Date startDate;
@ApiModelProperty(value = "建设单位")
private String constructionUnit;
}
......@@ -40,4 +40,6 @@ public class TaskDto extends BaseDto {
private Date sendTime;
private Long unitId;
private Long extendId;
}
......@@ -54,6 +54,8 @@ public class Task extends BaseEntity {
@TableField(exist = false)
private String extend; //url路径
private Long extendId;
......
......@@ -22,7 +22,7 @@ import java.util.Set;
public interface RectifyMsgMapper extends BaseMapper<RectifyMsg> {
IPage<RectifyMsg> queryForRectifyMsgPage(IPage<RectifyMsg> page, String name,String isProblem,String installationUnit );
IPage<RectifyMsgDto> queryForRectifyMsgPage(IPage<RectifyMsgDto> page, String name,Boolean isProblem,String installationUnit, Set<Long> projectIds );
Page<RectifyMsgDto> InstallNoticeMsgPage(IPage<RectifyMsgDto> page, @Param("name") String name, @Param("installationUnit") String installationUnit, Set<String> seqs);
......@@ -31,6 +31,6 @@ public interface RectifyMsgMapper extends BaseMapper<RectifyMsg> {
RectifyMsgDto customSelectById(@Param("sequenceNbr") Long sequenceNbr);
IPage<RectifyMsgDto> getProblemMsgDto(IPage<RectifyMsg> page, String name, Boolean isProblem, String installationUnit);
}
......@@ -8,6 +8,8 @@ import com.yeejoin.amos.boot.module.ugp.api.dto.RectifyMsgDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.RectifyMsg;
import org.springframework.stereotype.Service;
import java.util.Set;
/**
* 短信通知表接口类
*
......@@ -16,13 +18,11 @@ import org.springframework.stereotype.Service;
*/
public interface IRectifyMsgService {
IPage<RectifyMsg> queryForRectifyMsgPage(IPage<RectifyMsg> page, String name,Boolean isProblem, String installationUnit);
IPage<RectifyMsgDto> queryForRectifyMsgPage(IPage<RectifyMsgDto> page, String name, Boolean isProblem, String installationUnit);
Page<RectifyMsgDto> installNoticeMsgList(Page<RectifyMsgDto> page, String name, String installationUnit);
//安装告知页面分页查询
Page<RectifyMsgDto> selectByName(Page<RectifyMsgDto> page, String name ,String unit);
//根据sequenceNbr查询列表数据
RectifyMsgDto customSelectById(Long sequenceNbr);
}
......@@ -3,12 +3,12 @@
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.RectifyMsgMapper">
<select id = 'queryForRectifyMsgPage' resultType="com.yeejoin.amos.boot.module.ugp.api.dto.RectifyMsgDto">
SELECT msg.*,pro.project_id,org.biz_org_name,up.installation_unit,pro.`code`,pro.generate_stage,pro.problem_describe,up.`name`,up.address,pro.process_progress,gro.biz_org_name AS notice_unit_name
SELECT msg.*,pro.project_id,org.biz_org_name AS msg_receiver_name,up.installation_unit,pro.`code`,pro.generate_stage,pro.problem_describe,up.`name`,up.install_region AS address,pro.process_progress,gro.biz_org_name AS notice_unit_name
FROM tz_ugp_rectify_msg AS msg
LEFT JOIN tz_ugp_quality_problem AS pro ON pro.sequence_nbr = msg.problem_id
LEFT JOIN cb_org_usr AS org ON org.sequence_nbr = msg.msg_receiver
LEFT JOIN tz_ugp_project AS up ON up.sequence_nbr = pro.project_id
LEFT JOIN cb_org_usr AS gro ON gro.sequence_nbr = msg.notice_unit_id
LEFT JOIN cb_org_usr AS gro ON gro.amos_org_id = msg.notice_unit_id
<where>
<if test="name != '' and name != null" >
and up.`name` like concat("%", #{name},"%")
......@@ -17,14 +17,23 @@
<if test="installationUnit != '' and installationUnit != null" >
and up.installation_unit like concat("%",#{installationUnit},"%")
</if>
<if test="isProblem != '' and isProblem != null">
and msg.is_problem = #{isProblem}
</if>
<if test="projectIds != null and projectIds.size>0">
and up.sequence_nbr in
<foreach collection="projectIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by rec_date desc
</select>
<select id="InstallNoticeMsgPage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.RectifyMsgDto">
SELECT `name`,
SELECT
tz_ugp_rectify_msg.sequence_nbr,
`name`,
install_region,
start_date,
construction_unit,
......@@ -97,5 +106,17 @@
and tz_ugp_project.sequence_nbr = #{sequenceNbr}
</select>
<select id="getProblemMsgDto" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.RectifyMsgDto">
SELECT
t.*,qp.*
FROM tz_ugp_task AS t
LEFT JOIN tz_ugp_quality_problem AS qp ON t.source_id = qp.sequence_nbr
<where>
<if test="name != null and name != ''">
and
</if>
</where>
</select>
</mapper>
......@@ -18,5 +18,6 @@
<if test="type != null ">
and tk.status =#{type}
</if>
ORDER BY tk.rec_date DESC
</select>
</mapper>
\ No newline at end of file
......@@ -315,7 +315,7 @@ public class InstallNoticeController extends BaseController {
InstallNotice installNotice = installNoticeServiceImpl.getById(sequenceNbr);
installNotice.setApproved(true);
installNotice.setNoticeStatus(NoticeStatusEnum.已通过.getName());
if(NoticeStatusEnum.已退回.equals(option)){
if(NoticeStatusEnum.已退回.getStatusId().equals(option)){
installNotice.setApproved(false);
installNotice.setNoticeStatus(NoticeStatusEnum.已退回.getName());
}
......
......@@ -103,13 +103,13 @@ public class RectifyMsgController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "整改短信通知、告知分页查询", notes = "整改短信通知表、告知分页查询")
public ResponseModel<IPage<RectifyMsg>> queryForPage(
public ResponseModel<IPage<RectifyMsgDto>> queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "isProblem") Boolean isProblem,
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "installationUnit",required = false) String installationUnit) {
IPage<RectifyMsg> page = new Page<RectifyMsg>();
IPage<RectifyMsgDto> page = new Page<RectifyMsgDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(rectifyMsgServiceImpl.queryForRectifyMsgPage(page,name,isProblem,installationUnit));
......
......@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.TaskTypeEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.TaskDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice;
import com.yeejoin.amos.boot.module.ugp.api.entity.Task;
import com.yeejoin.amos.boot.module.ugp.api.mapper.TaskMapper;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
......@@ -176,8 +178,19 @@ public class TaskController {
}
}
IPage task = taskMapper.getTask(page, status, unitId);
return ResponseHelper.buildResponse(task);
page = taskMapper.getTask(page, status, unitId);
List<Task> list = page.getRecords();
for(Task task : list){
if(task.getStatus() == 1){
if(!ValidationUtil.isEmpty(task.getExtendId())){
if(task.getExtendId()!=-1L) {
task.setSourceId(task.getExtendId());
}
}
}
}
return ResponseHelper.buildResponse(page);
}
/**
......
......@@ -119,7 +119,7 @@ public class WelderController extends BaseController {
// wrapper.eq(Project::getCode,code);
// Project project = projectMapper.selectOne(wrapper);
//根据登录人获取登录人单位下焊工
List<Map> info = orgService.getCompanyWelder(null).getRecords();
List<Map> info = orgService.getCompanyWelder(new Page()).getRecords();
for (Map<String,Object> map:info){
JSONObject jsonObject=new JSONObject();
jsonObject.put("name",map.get("name"));
......
......@@ -288,7 +288,7 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
unitIds.add(superviseRule.getInspectionUnitId());
}
//新增企业审核任务信息
taskService.saveOrUpdateTask(null, true, TaskTypeEnum.企业审核.getKey(), new Date(), model.getSequenceNbr(), TaskTypeEnum.企业审核.getKey(), unitIds);
taskService.saveOrUpdateTask(null, true, TaskTypeEnum.企业审核.getKey(), new Date(), model.getSequenceNbr(), TaskTypeEnum.企业审核.getKey(), unitIds,null);
return this.updateById(company);
}
public CompanyDto queryBySeq1(Long sequenceNbr) {
......@@ -356,7 +356,7 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
}
//新增企业审核任务信息
taskService.saveOrUpdateTask(null, false, TaskTypeEnum.企业审核.getKey(), new Date(), model.getSequenceNbr(), TaskTypeEnum.企业审核.getKey(), unitIds);
taskService.saveOrUpdateTask(null, false, TaskTypeEnum.企业审核.getKey(), new Date(), model.getSequenceNbr(), TaskTypeEnum.企业审核.getKey(), unitIds,null);
return model;
}
......
......@@ -148,7 +148,7 @@ public class ProblemInitiationServiceImpl {
} finally {
//更新任务表的状态 已办
taskType = getUnitId(unitIds, objectd);
taskService.saveOrUpdateTask(objectd.getStatus(), true, taskType, new Date(), object.getLong("sequenceNbr"), TaskTypeEnum.质量问题.getKey(), unitIds);
taskService.saveOrUpdateTask(objectd.getStatus(), true, taskType, new Date(), object.getLong("sequenceNbr"), TaskTypeEnum.质量问题.getKey(), unitIds,null);
//更新problem中的status字段,表示当前流程下一个执行的任务
qualityProblemService.updateById(objectd);
......@@ -158,7 +158,7 @@ public class ProblemInitiationServiceImpl {
unitIds = new ArrayList<>();
taskType = getUnitId(unitIds, objectd);
taskService.saveOrUpdateTask(objectd.getStatus(), false, taskType, new Date(), object.getLong("sequenceNbr"), TaskTypeEnum.质量问题.getKey(), unitIds);
taskService.saveOrUpdateTask(objectd.getStatus(), false, taskType, new Date(), object.getLong("sequenceNbr"), TaskTypeEnum.质量问题.getKey(), unitIds,null);
}
}
......@@ -295,17 +295,11 @@ public class ProblemInitiationServiceImpl {
bool = true;
}
if (bool) {
SmsRecordModel smsRecordModel = sendSmsMassage(smsCode, agencyUserModel.getMobile(), smsParams);
if (ValidationUtil.isEmpty(smsRecordModel)) {
continue;
}
if(SMSEnum.项目安装告知申请.getCode().equals(smsCode) || SMSEnum.项目立项驳回短信.getCode().equals(smsCode)){
// saveProjectSmsLog(smsRecordModel,sequenceNbr,noticeUnitId,agencyUserModel,object,smsCode);
// }else {
saveProblemSmsLog(smsRecordModel,sequenceNbr,noticeUnitId,agencyUserModel,object,smsCode);
}
saveProblemSmsLog(smsRecordModel,sequenceNbr,noticeUnitId,agencyUserModel,object,smsCode);
}
}
}
......
......@@ -117,6 +117,7 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
public void execute(String instanceId,Object objectd, String option){
String taskType = "";
List<Long> unitIds = new ArrayList<>();
Long extendId = -1L;
JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(objectd));
Project project = JSON.parseObject(JSONObject.toJSONString(objectd),Project.class);
......@@ -144,6 +145,18 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
}
if (ProjectInitiationEnum.告知申请.getName().equals(dataObject.getString("name")) || ProjectInitiationEnum.接受告知.getName().equals(dataObject.getString("name")) ) {
extendId = object.getLong("sequenceNbr");
}
if(ProjectInitiationEnum.审查项目.getName().equals(dataObject.getString("name"))){
if("1".equals(option)){
extendId = object.getLong("sequenceNbr");
}
}
if(ProjectInitiationEnum.监检员审核.getName().equals(dataObject.getString("name"))){
if("1".equals(option)){
projectInitiation.setTaskName(dataObject.getString("name")+"(流程结束!)");
......@@ -183,7 +196,7 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
} finally {
//更新任务表的状态 已办
taskType = getUnitId(unitIds, project, superviseRule);
taskService.saveOrUpdateTask(project.getStatus(), true, taskType, new Date(), project.getSequenceNbr(), TaskTypeEnum.项目立项.getKey(), unitIds);
taskService.saveOrUpdateTask(project.getStatus(), true, taskType, new Date(), project.getSequenceNbr(), TaskTypeEnum.项目立项.getKey(), unitIds,extendId);
//更新project种的status字段,表示当前流程下一个执行的任务
updateProjectFlowStatus(instanceId);
......@@ -195,7 +208,7 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
unitIds = new ArrayList<>();
taskType = getUnitId(unitIds, project, superviseRule);
taskService.saveOrUpdateTask(project.getStatus(), false, taskType, new Date(), project.getSequenceNbr(), TaskTypeEnum.项目立项.getKey(), unitIds);
taskService.saveOrUpdateTask(project.getStatus(), false, taskType, new Date(), project.getSequenceNbr(), TaskTypeEnum.项目立项.getKey(), unitIds,extendId);
}
}
......
......@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.RectifyMsgMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeMsgService;
import com.yeejoin.amos.boot.module.ugp.api.service.IRectifyMsgService;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -57,11 +58,17 @@ public class RectifyMsgServiceImpl extends BaseService<RectifyMsgDto,RectifyMsg,
/**
* 质量问题整改短信列表查询
*/
public IPage<RectifyMsg> queryForRectifyMsgPage(IPage<RectifyMsg> page, String name, Boolean isProblem, String installationUnit) {
@Override
public IPage<RectifyMsgDto> queryForRectifyMsgPage(IPage<RectifyMsgDto> page, String name, Boolean isProblem, String installationUnit) {
LambdaQueryWrapper<RectifyMsg> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(RectifyMsg::getIsProblem,isProblem);
// return rectifyMsgMapper.queryForRectifyMsgPage(page,name,String.valueOf(wrapper),installationUnit);
return this.page(page,wrapper);
Set<Long> projectIds = new HashSet<>();
List<Project> projectList = projectResourceService.getProjectList();
for (Project project : projectList) {
projectIds.add(project.getSequenceNbr());
}
page = rectifyMsgMapper.queryForRectifyMsgPage(page,name,isProblem,installationUnit,projectIds);
return page;
}
@Override
......
......@@ -52,7 +52,7 @@ public class TaskServiceImpl extends BaseService<TaskDto, Task, TaskMapper> impl
* @Param sequenceNbr 项目/问题处置的sequenceNbr
* @return
*/
public void saveOrUpdateTask(String InitiationStatus, boolean status, String taskType, Date sendTime, Long sourceId, String type, List<Long> unitIds) {
public void saveOrUpdateTask(String InitiationStatus, boolean status, String taskType, Date sendTime, Long sourceId, String type, List<Long> unitIds,Long extendId) {
if (!ValidationUtil.isEmpty(unitIds)) {
for (Long unitId : unitIds) {
Task task = new Task();
......@@ -99,6 +99,7 @@ public class TaskServiceImpl extends BaseService<TaskDto, Task, TaskMapper> impl
task.setSendTime(sendTime);
task.setSourceId(sourceId);
task.setType(type);
task.setExtendId(extendId);
if (status) {
//更新任务表 已办
......@@ -115,6 +116,7 @@ public class TaskServiceImpl extends BaseService<TaskDto, Task, TaskMapper> impl
task = taskList.iterator().next();
task.setStatusLabel(TaskTypeEnum.已办.getName());
task.setStatus(state);
task.setExtendId(extendId);
taskStatus = "已完成";
} else {
//添加任务表 待办
......
......@@ -248,16 +248,18 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
weld.setStatus(status);
}
if(!"4.9E-3244.9E-324".equals(location)){
String longitude = location.substring(0,location.indexOf(","));
String latitude = location.substring(longitude.length()+1);
weld.setLongitude(longitude);
weld.setLatitude(latitude);
weldService.updateById(weld);
try {
emqKeeper.getMqttClient().publish(weldUpdate,weld.toString().getBytes(),1,false);
} catch (MqttException e) {
e.printStackTrace();
if(!"4.9E-3244.9E-324".equals(location)) {
if (location.contains(",")) {
String longitude = location.substring(0, location.indexOf(","));
String latitude = location.substring(longitude.length() + 1);
weld.setLongitude(longitude);
weld.setLatitude(latitude);
weldService.updateById(weld);
try {
emqKeeper.getMqttClient().publish(weldUpdate, weld.toString().getBytes(), 1, false);
} catch (MqttException e) {
e.printStackTrace();
}
}
}
}
......@@ -354,7 +356,10 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if (!ValidationUtil.isEmpty(materialCode)) {
//由于通过管材编号查询,项目资源中没有管材编号,先查管材资源,在通过管材资源id查询项目资源
Material material = materialService.getMaterial(materialCode);
ProjectResource resource = projectResourceService.getprojectResource(null, material.getSequenceNbr(), "material");
ProjectResource resource = null;
if(!ValidationUtil.isEmpty(material)) {
resource = projectResourceService.getOne(new LambdaQueryWrapper<ProjectResource>().eq(ProjectResource::getResourceId,material.getSequenceNbr()).eq(ProjectResource::getType,"material"));
}
if (!ValidationUtil.isEmpty(material) && !ValidationUtil.isEmpty(resource)) {
jsonObject.put(CheckEnum.有效.getKey(),CheckEnum.有效.getName());
jsonObject.put(CheckEnum.符合.getKey(),CheckEnum.符合.getName());
......@@ -712,8 +717,10 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
} else {
verify2 = verifyMapper.getOnes(verify.getProjectId(), verify.getVerifyTime().toLocaleString(), null, jsonObject.getString("manyCode"));
}
Long sequenceNbr = verify2.getSequenceNbr( );
qualityProblem.setStageVerifyId(sequenceNbr);
if(!ValidationUtil.isEmpty(verify2)) {
Long sequenceNbr = verify2.getSequenceNbr();
qualityProblem.setStageVerifyId(sequenceNbr);
}
qualityProblemService.save(qualityProblem);
problemInitiationService.start(qualityProblem);
}
......
......@@ -238,7 +238,8 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
page.setCurrent(current);
page.setSize(size);
LambdaQueryWrapper<Weld> wrapper = new LambdaQueryWrapper<>();
IPage<Weld> weldList = weldMapper.selectPage(page,wrapper.eq(Weld::getProjectId,projectId));
wrapper.eq(Weld::getProjectId,projectId);
IPage<Weld> weldList = this.page(page,wrapper);
return weldList;
}
......@@ -341,7 +342,7 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
Iterator<String> it = map.keySet().iterator();
String urlString=it.next();
jsonObject.put("fileUrl", urlString);
jsonObject.put("fileName", map.get(urlString));
jsonObject.put("fileName", HKCode);
}
} catch (IOException e) {
e.printStackTrace();
......
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