add - 任务信息
parent
9aaab3eeea
commit
bc02b7352e
@ -0,0 +1,103 @@
|
||||
package com.aucma.report.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.aucma.common.utils.DateUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.aucma.common.annotation.Log;
|
||||
import com.aucma.common.core.controller.BaseController;
|
||||
import com.aucma.common.core.domain.AjaxResult;
|
||||
import com.aucma.common.enums.BusinessType;
|
||||
import com.aucma.report.domain.RealTaskInfo;
|
||||
import com.aucma.report.service.IRealTaskInfoService;
|
||||
import com.aucma.common.utils.poi.ExcelUtil;
|
||||
import com.aucma.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 任务信息Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/report/RealTaskInfo" )
|
||||
public class RealTaskInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IRealTaskInfoService realTaskInfoService;
|
||||
|
||||
/**
|
||||
* 查询任务信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:RealTaskInfo:list')" )
|
||||
@GetMapping("/list" )
|
||||
public TableDataInfo list(RealTaskInfo realTaskInfo) {
|
||||
startPage();
|
||||
List<RealTaskInfo> list = realTaskInfoService.selectRealTaskInfoList(realTaskInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出任务信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:RealTaskInfo:export')" )
|
||||
@Log(title = "任务信息" , businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export" )
|
||||
public void export(HttpServletResponse response, RealTaskInfo realTaskInfo) {
|
||||
List<RealTaskInfo> list = realTaskInfoService.selectRealTaskInfoList(realTaskInfo);
|
||||
ExcelUtil<RealTaskInfo> util = new ExcelUtil<RealTaskInfo>(RealTaskInfo. class);
|
||||
util.exportExcel(response, list, "任务信息数据" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:RealTaskInfo:query')" )
|
||||
@GetMapping(value = "/{objid}" )
|
||||
public AjaxResult getInfo(@PathVariable("objid" ) Long objid) {
|
||||
return success(realTaskInfoService.selectRealTaskInfoByObjid(objid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:RealTaskInfo:add')" )
|
||||
@Log(title = "任务信息" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RealTaskInfo realTaskInfo) {
|
||||
realTaskInfo.setCreatedBy(getUsername());
|
||||
realTaskInfo.setCreatedTime(DateUtils.getNowDate());
|
||||
return toAjax(realTaskInfoService.insertRealTaskInfo(realTaskInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:RealTaskInfo:edit')" )
|
||||
@Log(title = "任务信息" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RealTaskInfo realTaskInfo) {
|
||||
realTaskInfo.setUpdatedBy(getUsername());
|
||||
realTaskInfo.setUpdatedTime(DateUtils.getNowDate());
|
||||
return toAjax(realTaskInfoService.updateRealTaskInfo(realTaskInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:RealTaskInfo:remove')" )
|
||||
@Log(title = "任务信息" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objids}" )
|
||||
public AjaxResult remove(@PathVariable Long[] objids) {
|
||||
return toAjax(realTaskInfoService.deleteRealTaskInfoByObjids(objids));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.report.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.report.domain.RealTaskInfo;
|
||||
|
||||
/**
|
||||
* 任务信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-02
|
||||
*/
|
||||
public interface RealTaskInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询任务信息
|
||||
*
|
||||
* @param objid 任务信息主键
|
||||
* @return 任务信息
|
||||
*/
|
||||
public RealTaskInfo selectRealTaskInfoByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 查询任务信息列表
|
||||
*
|
||||
* @param realTaskInfo 任务信息
|
||||
* @return 任务信息集合
|
||||
*/
|
||||
public List<RealTaskInfo> selectRealTaskInfoList(RealTaskInfo realTaskInfo);
|
||||
|
||||
/**
|
||||
* 新增任务信息
|
||||
*
|
||||
* @param realTaskInfo 任务信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRealTaskInfo(RealTaskInfo realTaskInfo);
|
||||
|
||||
/**
|
||||
* 修改任务信息
|
||||
*
|
||||
* @param realTaskInfo 任务信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRealTaskInfo(RealTaskInfo realTaskInfo);
|
||||
|
||||
/**
|
||||
* 删除任务信息
|
||||
*
|
||||
* @param objid 任务信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRealTaskInfoByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 批量删除任务信息
|
||||
*
|
||||
* @param objids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRealTaskInfoByObjids(Long[] objids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.report.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.report.domain.RealTaskInfo;
|
||||
|
||||
/**
|
||||
* 任务信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-02
|
||||
*/
|
||||
public interface IRealTaskInfoService
|
||||
{
|
||||
/**
|
||||
* 查询任务信息
|
||||
*
|
||||
* @param objid 任务信息主键
|
||||
* @return 任务信息
|
||||
*/
|
||||
public RealTaskInfo selectRealTaskInfoByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 查询任务信息列表
|
||||
*
|
||||
* @param realTaskInfo 任务信息
|
||||
* @return 任务信息集合
|
||||
*/
|
||||
public List<RealTaskInfo> selectRealTaskInfoList(RealTaskInfo realTaskInfo);
|
||||
|
||||
/**
|
||||
* 新增任务信息
|
||||
*
|
||||
* @param realTaskInfo 任务信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRealTaskInfo(RealTaskInfo realTaskInfo);
|
||||
|
||||
/**
|
||||
* 修改任务信息
|
||||
*
|
||||
* @param realTaskInfo 任务信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRealTaskInfo(RealTaskInfo realTaskInfo);
|
||||
|
||||
/**
|
||||
* 批量删除任务信息
|
||||
*
|
||||
* @param objids 需要删除的任务信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRealTaskInfoByObjids(Long[] objids);
|
||||
|
||||
/**
|
||||
* 删除任务信息信息
|
||||
*
|
||||
* @param objid 任务信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRealTaskInfoByObjid(Long objid);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.aucma.report.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.aucma.report.mapper.RealTaskInfoMapper;
|
||||
import com.aucma.report.domain.RealTaskInfo;
|
||||
import com.aucma.report.service.IRealTaskInfoService;
|
||||
|
||||
/**
|
||||
* 任务信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-11-02
|
||||
*/
|
||||
@Service
|
||||
public class RealTaskInfoServiceImpl implements IRealTaskInfoService
|
||||
{
|
||||
@Autowired
|
||||
private RealTaskInfoMapper realTaskInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询任务信息
|
||||
*
|
||||
* @param objid 任务信息主键
|
||||
* @return 任务信息
|
||||
*/
|
||||
@Override
|
||||
public RealTaskInfo selectRealTaskInfoByObjid(Long objid)
|
||||
{
|
||||
return realTaskInfoMapper.selectRealTaskInfoByObjid(objid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务信息列表
|
||||
*
|
||||
* @param realTaskInfo 任务信息
|
||||
* @return 任务信息
|
||||
*/
|
||||
@Override
|
||||
public List<RealTaskInfo> selectRealTaskInfoList(RealTaskInfo realTaskInfo)
|
||||
{
|
||||
return realTaskInfoMapper.selectRealTaskInfoList(realTaskInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务信息
|
||||
*
|
||||
* @param realTaskInfo 任务信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRealTaskInfo(RealTaskInfo realTaskInfo)
|
||||
{
|
||||
return realTaskInfoMapper.insertRealTaskInfo(realTaskInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务信息
|
||||
*
|
||||
* @param realTaskInfo 任务信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRealTaskInfo(RealTaskInfo realTaskInfo)
|
||||
{
|
||||
return realTaskInfoMapper.updateRealTaskInfo(realTaskInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除任务信息
|
||||
*
|
||||
* @param objids 需要删除的任务信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRealTaskInfoByObjids(Long[] objids)
|
||||
{
|
||||
return realTaskInfoMapper.deleteRealTaskInfoByObjids(objids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务信息信息
|
||||
*
|
||||
* @param objid 任务信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRealTaskInfoByObjid(Long objid)
|
||||
{
|
||||
return realTaskInfoMapper.deleteRealTaskInfoByObjid(objid);
|
||||
}
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.aucma.report.mapper.RealTaskInfoMapper">
|
||||
|
||||
<resultMap type="RealTaskInfo" id="RealTaskInfoResult">
|
||||
<result property="objid" column="objid" />
|
||||
<result property="taskCode" column="task_code" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="taskStatus" column="task_status" />
|
||||
<result property="planCode" column="plan_code" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialType" column="material_type" />
|
||||
<result property="spaceCode" column="space_code" />
|
||||
<result property="planAmount" column="plan_amount" />
|
||||
<result property="completeAmount" column="complete_amount" />
|
||||
<result property="beginTime" column="begin_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="isFlag" column="is_flag" />
|
||||
<result property="createdBy" column="created_by" />
|
||||
<result property="createdTime" column="created_time" />
|
||||
<result property="updatedBy" column="updated_by" />
|
||||
<result property="updatedTime" column="updated_time" />
|
||||
<result property="storeCode" column="store_code" />
|
||||
<result property="spaceName" column="space_name" />
|
||||
<result property="taskModel" column="task_model" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRealTaskInfoVo">
|
||||
select objid, task_code, task_type, task_status, plan_code, material_code, material_type, space_code, plan_amount, complete_amount, begin_time, end_time, is_flag, created_by, created_time, updated_by, updated_time, store_code, space_name, task_model from real_taskinfo
|
||||
</sql>
|
||||
|
||||
<select id="selectRealTaskInfoList" parameterType="RealTaskInfo" resultMap="RealTaskInfoResult">
|
||||
<include refid="selectRealTaskInfoVo"/>
|
||||
<where>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
|
||||
<if test="taskType != null "> and task_type = #{taskType}</if>
|
||||
<if test="taskStatus != null "> and task_status = #{taskStatus}</if>
|
||||
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
|
||||
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||||
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
|
||||
<if test="spaceCode != null and spaceCode != ''"> and space_code = #{spaceCode}</if>
|
||||
<if test="planAmount != null "> and plan_amount = #{planAmount}</if>
|
||||
<if test="completeAmount != null "> and complete_amount = #{completeAmount}</if>
|
||||
<if test="params.beginBeginTime != null and params.beginBeginTime != '' and params.endBeginTime != null and params.endBeginTime != ''"> and begin_time between to_date(#{params.beginBeginTime}, 'yyyy-mm-dd hh24:mi:ss') and to_date(#{params.endBeginTime}, 'yyyy-mm-dd hh24:mi:ss')</if>
|
||||
<if test="params.beginEndTime != null and params.beginEndTime != '' and params.endEndTime != null and params.endEndTime != ''"> and end_time between to_date(#{params.beginEndTime}, 'yyyy-mm-dd hh24:mi:ss') and to_date(#{params.endEndTime}, 'yyyy-mm-dd hh24:mi:ss')</if>
|
||||
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
|
||||
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
|
||||
<if test="createdTime != null "> and created_time = #{createdTime}</if>
|
||||
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
|
||||
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
|
||||
<if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode}</if>
|
||||
<if test="spaceName != null and spaceName != ''"> and space_name like concat(concat('%', #{spaceName}), '%')</if>
|
||||
<if test="taskModel != null "> and task_model = #{taskModel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRealTaskInfoByObjid" parameterType="Long" resultMap="RealTaskInfoResult">
|
||||
<include refid="selectRealTaskInfoVo"/>
|
||||
where objid = #{objid}
|
||||
</select>
|
||||
|
||||
<insert id="insertRealTaskInfo" parameterType="RealTaskInfo">
|
||||
<selectKey keyProperty="objid" resultType="long" order="BEFORE">
|
||||
SELECT SEQ_REAL_TASK_INFO.NEXTVAL as objid FROM DUAL
|
||||
</selectKey>
|
||||
insert into real_taskinfo
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objid != null">objid,</if>
|
||||
<if test="taskCode != null">task_code,</if>
|
||||
<if test="taskType != null">task_type,</if>
|
||||
<if test="taskStatus != null">task_status,</if>
|
||||
<if test="planCode != null">plan_code,</if>
|
||||
<if test="materialCode != null">material_code,</if>
|
||||
<if test="materialType != null">material_type,</if>
|
||||
<if test="spaceCode != null">space_code,</if>
|
||||
<if test="planAmount != null">plan_amount,</if>
|
||||
<if test="completeAmount != null">complete_amount,</if>
|
||||
<if test="beginTime != null">begin_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="isFlag != null">is_flag,</if>
|
||||
<if test="createdBy != null">created_by,</if>
|
||||
<if test="createdTime != null">created_time,</if>
|
||||
<if test="updatedBy != null">updated_by,</if>
|
||||
<if test="updatedTime != null">updated_time,</if>
|
||||
<if test="storeCode != null">store_code,</if>
|
||||
<if test="spaceName != null">space_name,</if>
|
||||
<if test="taskModel != null">task_model,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objid != null">#{objid},</if>
|
||||
<if test="taskCode != null">#{taskCode},</if>
|
||||
<if test="taskType != null">#{taskType},</if>
|
||||
<if test="taskStatus != null">#{taskStatus},</if>
|
||||
<if test="planCode != null">#{planCode},</if>
|
||||
<if test="materialCode != null">#{materialCode},</if>
|
||||
<if test="materialType != null">#{materialType},</if>
|
||||
<if test="spaceCode != null">#{spaceCode},</if>
|
||||
<if test="planAmount != null">#{planAmount},</if>
|
||||
<if test="completeAmount != null">#{completeAmount},</if>
|
||||
<if test="beginTime != null">#{beginTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="isFlag != null">#{isFlag},</if>
|
||||
<if test="createdBy != null">#{createdBy},</if>
|
||||
<if test="createdTime != null">#{createdTime},</if>
|
||||
<if test="updatedBy != null">#{updatedBy},</if>
|
||||
<if test="updatedTime != null">#{updatedTime},</if>
|
||||
<if test="storeCode != null">#{storeCode},</if>
|
||||
<if test="spaceName != null">#{spaceName},</if>
|
||||
<if test="taskModel != null">#{taskModel},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRealTaskInfo" parameterType="RealTaskInfo">
|
||||
update real_taskinfo
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskCode != null">task_code = #{taskCode},</if>
|
||||
<if test="taskType != null">task_type = #{taskType},</if>
|
||||
<if test="taskStatus != null">task_status = #{taskStatus},</if>
|
||||
<if test="planCode != null">plan_code = #{planCode},</if>
|
||||
<if test="materialCode != null">material_code = #{materialCode},</if>
|
||||
<if test="materialType != null">material_type = #{materialType},</if>
|
||||
<if test="spaceCode != null">space_code = #{spaceCode},</if>
|
||||
<if test="planAmount != null">plan_amount = #{planAmount},</if>
|
||||
<if test="completeAmount != null">complete_amount = #{completeAmount},</if>
|
||||
<if test="beginTime != null">begin_time = #{beginTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||||
<if test="createdBy != null">created_by = #{createdBy},</if>
|
||||
<if test="createdTime != null">created_time = #{createdTime},</if>
|
||||
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
||||
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
||||
<if test="storeCode != null">store_code = #{storeCode},</if>
|
||||
<if test="spaceName != null">space_name = #{spaceName},</if>
|
||||
<if test="taskModel != null">task_model = #{taskModel},</if>
|
||||
</trim>
|
||||
where objid = #{objid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRealTaskInfoByObjid" parameterType="Long">
|
||||
delete from real_taskinfo where objid = #{objid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRealTaskInfoByObjids" parameterType="String">
|
||||
delete from real_taskinfo where objid in
|
||||
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||
#{objid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue