Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
938350aa7a
|
|
@ -645,6 +645,16 @@ public class DateTimeHelper {
|
|||
return sdf.format(afterDate);
|
||||
}
|
||||
|
||||
public static String getTimeAfterThirtyDay() {
|
||||
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //制定日期格式
|
||||
Calendar c=Calendar.getInstance();
|
||||
Date date=new Date();
|
||||
c.setTime(date);
|
||||
c.add(Calendar.MONTH,1); //将当前日期加一个月
|
||||
String validityDate=df.format(c.getTime()); //返回String型的时间
|
||||
return validityDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取时间戳
|
||||
*/
|
||||
|
|
@ -741,8 +751,10 @@ public class DateTimeHelper {
|
|||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.err.println(getFisrtDayOfMonth(2023,11));
|
||||
System.err.println(getLastDayOfMonth(2023,11));
|
||||
// System.err.println(getFisrtDayOfMonth(2023,11));
|
||||
// System.err.println(getLastDayOfMonth(2023,11));
|
||||
System.err.println(getTimeAfterThirtyDay());
|
||||
System.err.println(getNowTime());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -50,6 +50,18 @@ public class TmTaskController extends BaseController {
|
|||
return toAjax(tmTaskService.updateLeaseTaskAuditInfo(task));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务id删除任务表及任务信息
|
||||
*/
|
||||
@Log(title = "删除任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{taskId}")
|
||||
public AjaxResult deleteTaskInfoByTaskId(@PathVariable String taskId) {
|
||||
if (StringUtils.isEmpty(taskId)) {
|
||||
return AjaxResult.error("参数错误,删除失败!");
|
||||
}
|
||||
return tmTaskService.deleteByPrimaryKey(taskId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 往来单位提交工程领用机具信息
|
||||
|
|
@ -217,6 +229,33 @@ public class TmTaskController extends BaseController {
|
|||
return AjaxResult.success(getDataTable(leaseAuditList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务信息
|
||||
*/
|
||||
@Log(title = "修改任务信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody TmTask task) {
|
||||
if (StringUtils.isNull(task)) {
|
||||
return AjaxResult.error("参数错误,传入信息为空!");
|
||||
}
|
||||
try {
|
||||
// 任务编号
|
||||
String taskId = task.getId();
|
||||
// 任务类型
|
||||
Integer taskType = task.getTaskType();
|
||||
// 任务状态
|
||||
Integer taskStatus = task.getTaskStatus();
|
||||
int taskResult = tmTaskService.updateByPrimaryKeySelective(task);
|
||||
if (taskResult > 0) {
|
||||
return AjaxResult.success("任务表修改成功");
|
||||
} else {
|
||||
return AjaxResult.error("任务表修改失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("修改失败,异常信息:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ public interface TmTaskMapper {
|
|||
/** 更新leaseApplyDetails审批信息 */
|
||||
int updateLeaseApplyDetailsAuditInfo(@Param("record") LeaseApplyDetails record);
|
||||
|
||||
int deleteByPrimaryKey(Long taskId);
|
||||
int deleteTaskByPrimaryKey(String taskId);
|
||||
|
||||
int deleteTaskInfoByTaskId(String taskId);
|
||||
|
||||
int insert(TmTask record);
|
||||
|
||||
|
|
@ -51,6 +53,11 @@ public interface TmTaskMapper {
|
|||
|
||||
TmTask selectByPrimaryKey(Long taskId);
|
||||
|
||||
/**
|
||||
* 修改Tm_task任务表
|
||||
* @param record 参数对象
|
||||
* @return 结果
|
||||
*/
|
||||
int updateByPrimaryKeySelective(TmTask record);
|
||||
|
||||
int updateByPrimaryKey(TmTask record);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package com.bonus.sgzb.app.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -23,7 +23,7 @@ public interface TmTaskService{
|
|||
|
||||
String genderLeaseCode();
|
||||
|
||||
int deleteByPrimaryKey(Long taskId);
|
||||
AjaxResult deleteByPrimaryKey(String taskId);
|
||||
|
||||
int createTask(TmTask record);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.bonus.sgzb.base.api.domain.LeaseApplyInfo;
|
|||
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -110,8 +111,16 @@ public class TmTaskServiceImpl implements TmTaskService{
|
|||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Long taskId) {
|
||||
return tmTaskMapper.deleteByPrimaryKey(taskId);
|
||||
public AjaxResult deleteByPrimaryKey(String taskId) {
|
||||
boolean taskFlag = tmTaskMapper.deleteTaskByPrimaryKey(taskId) > 0;
|
||||
boolean infoFlag = tmTaskMapper.deleteTaskInfoByTaskId(taskId) > 0;
|
||||
if (taskFlag && infoFlag) {
|
||||
return AjaxResult.success("删除成功");
|
||||
} else if (taskFlag || infoFlag) {
|
||||
return AjaxResult.error("删除失败,任务表或信息表未删除!");
|
||||
} else {
|
||||
return AjaxResult.error("删除失败,请检查任务ID是否正确!!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -83,4 +83,9 @@ public class LargeScreenController extends BaseController {
|
|||
return service.getCarUseByMonth();
|
||||
}
|
||||
|
||||
@Log(title = "检修预警", businessType = BusinessType.QUERY)
|
||||
@PostMapping("getMaintenanceWarning")
|
||||
public AjaxResult getMaintenanceWarning() {
|
||||
return service.getMaintenanceWarning();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.sgzb.largeScreen.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 10488
|
||||
* 检修预警-vo
|
||||
*/
|
||||
@Data
|
||||
public class MaintenanceWarningVo {
|
||||
|
||||
/** 机具名称*/
|
||||
private String machineName;
|
||||
|
||||
/** 机具编号*/
|
||||
private String maCode;
|
||||
|
||||
/** 规格型号*/
|
||||
private String typeName;
|
||||
|
||||
/** 下次检修日期*/
|
||||
private String nextCheckTime;
|
||||
}
|
||||
|
|
@ -92,4 +92,13 @@ public interface LargeScreenMapper {
|
|||
* @date 2023/12/15 18:57
|
||||
*/
|
||||
List<ScrapAnalysisVo> getTotalOwnership(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return List<MaintenanceWarningVo>
|
||||
* @description 检修预警
|
||||
* @author cwchen
|
||||
* @date 2023/12/21 9:53
|
||||
*/
|
||||
List<MaintenanceWarningVo> getMaintenanceWarning(ParamsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,4 +88,12 @@ public interface ILargeScreenService {
|
|||
* @date 2023/12/13 15:40
|
||||
*/
|
||||
AjaxResult getCarUseByMonth();
|
||||
|
||||
/**
|
||||
* @return AjaxResult
|
||||
* @description 检修预警
|
||||
* @author cwchen
|
||||
* @date 2023/12/21 9:42
|
||||
*/
|
||||
AjaxResult getMaintenanceWarning();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -317,6 +317,20 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
|
|||
list.add(carUseVo6);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getMaintenanceWarning() {
|
||||
List<MaintenanceWarningVo> list = new ArrayList<>();
|
||||
try {
|
||||
ParamsDto dto = new ParamsDto();
|
||||
dto.setStartDate(DateTimeHelper.getNowTime());
|
||||
dto.setEndDate(DateTimeHelper.getTimeAfterThirtyDay());
|
||||
list = mapper.getMaintenanceWarning(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("检修预警-查询失败",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -27,14 +27,20 @@
|
|||
from tm_task
|
||||
where task_id = #{taskId,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<select id="selectTaskNumByMonth" resultType="java.lang.Integer">
|
||||
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{taskType}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from tm_task
|
||||
<update id="deleteTaskByPrimaryKey" parameterType="java.lang.Long">
|
||||
update tm_task set `status` = '0'
|
||||
where task_id = #{taskId,jdbcType=BIGINT}
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<update id="deleteTaskInfoByTaskId" parameterType="java.lang.Long">
|
||||
update lease_apply_info set `status` = '0'
|
||||
where task_id = #{taskId}
|
||||
</update>
|
||||
|
||||
<insert id="insert" keyColumn="task_id" keyProperty="taskId" parameterType="com.bonus.sgzb.base.api.domain.TmTask" useGeneratedKeys="true">
|
||||
insert into tm_task (task_type, task_status, code, create_by, create_time, update_by, update_time, remark, company_id)
|
||||
|
|
@ -101,7 +107,6 @@
|
|||
</insert>
|
||||
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.bonus.sgzb.base.api.domain.TmTask">
|
||||
<!--@mbg.generated-->
|
||||
update tm_task
|
||||
<set>
|
||||
<if test="taskType != null">
|
||||
|
|
@ -110,15 +115,6 @@
|
|||
<if test="taskStatus != null">
|
||||
task_status = #{taskStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
code = #{code,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by = #{createBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
|
@ -128,9 +124,6 @@
|
|||
<if test="remark != null and remark != ''">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id = #{companyId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where task_id = #{taskId,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
|
@ -457,7 +450,7 @@
|
|||
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
|
||||
LEFT JOIN bm_project_info bpi ON bpi.pro_id = bai.project_id
|
||||
WHERE
|
||||
tt.task_type = '29'
|
||||
tt.task_type = '29' and tt.status = '1'
|
||||
<if test="record.taskId != null and record.taskId != '' ">
|
||||
AND tt.task_id = #{record.taskId}
|
||||
</if>
|
||||
|
|
@ -469,7 +462,7 @@
|
|||
FROM
|
||||
lease_apply_info lai
|
||||
WHERE
|
||||
lai.task_id = #{record.taskId} AND lai.`code` = #{record.code}
|
||||
lai.task_id = #{record.taskId} AND lai.`code` = #{record.code} AND lai.status = '1'
|
||||
</select>
|
||||
|
||||
<select id="getLeaseApplyDetails" resultType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails">
|
||||
|
|
|
|||
|
|
@ -347,4 +347,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
</if>
|
||||
</select>
|
||||
<!--检修预警-->
|
||||
<select id="getMaintenanceWarning" resultType="com.bonus.sgzb.largeScreen.domain.MaintenanceWarningVo">
|
||||
SELECT mm.ma_code AS maCode,
|
||||
a.typeName,
|
||||
a.typeName2 AS machineName,
|
||||
mm.next_check_time
|
||||
FROM ma_machine mm
|
||||
LEFT JOIN (
|
||||
SELECT mt.type_id,mt.type_name AS typeName,mt2.type_name AS typeName2
|
||||
FROM ma_type mt
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id AND mt2.`level` = '3'
|
||||
WHERE mt.`level` = '4'
|
||||
)a ON mm.type_id = a.type_id
|
||||
WHERE mm.next_check_time BETWEEN #{startDate} AND #{endDate}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue