add - 任务信息

master
yinq 1 year ago
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,329 @@
package com.aucma.report.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
/**
* real_taskinfo
*
* @author Yinq
* @date 2023-11-02
*/
public class RealTaskInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objid;
/**
*
*/
@Excel(name = "任务编号")
private String taskCode;
/**
* 1-2-
*/
@Excel(name = "任务类型", readConverterExp = "1=-入库2-出库")
private Long taskType;
/**
* 1-2-3-
*/
@Excel(name = "任务状态", readConverterExp = "1=-待执行2-执行中3-完成")
private Long taskStatus;
/**
*
*/
@Excel(name = "计划编号")
private String planCode;
/**
*
*/
@Excel(name = "物料编号")
private String materialCode;
/**
*
*/
@Excel(name = "物料类型")
private String materialType;
/**
*
*/
@Excel(name = "货道编号")
private String spaceCode;
/**
*
*/
@Excel(name = "计划数量")
private BigDecimal planAmount;
/**
*
*/
@Excel(name = "完成数量")
private BigDecimal completeAmount;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date beginTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/**
*
*/
// @Excel(name = "是否标识")
private Long isFlag;
/**
*
*/
@Excel(name = "创建人")
private String createdBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/**
*
*/
@Excel(name = "更新人")
private String updatedBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
/**
*
*/
@Excel(name = "仓库编号")
private String storeCode;
/**
*
*/
@Excel(name = "货道名称")
private String spaceName;
/**
* 0-1-
*/
@Excel(name = "任务形式", readConverterExp = "0=-自动1-手动")
private Long taskModel;
public void setObjid(Long objid) {
this.objid = objid;
}
public Long getObjid() {
return objid;
}
public void setTaskCode(String taskCode) {
this.taskCode = taskCode;
}
public String getTaskCode() {
return taskCode;
}
public void setTaskType(Long taskType) {
this.taskType = taskType;
}
public Long getTaskType() {
return taskType;
}
public void setTaskStatus(Long taskStatus) {
this.taskStatus = taskStatus;
}
public Long getTaskStatus() {
return taskStatus;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getPlanCode() {
return planCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialType(String materialType) {
this.materialType = materialType;
}
public String getMaterialType() {
return materialType;
}
public void setSpaceCode(String spaceCode) {
this.spaceCode = spaceCode;
}
public String getSpaceCode() {
return spaceCode;
}
public void setPlanAmount(BigDecimal planAmount) {
this.planAmount = planAmount;
}
public BigDecimal getPlanAmount() {
return planAmount;
}
public void setCompleteAmount(BigDecimal completeAmount) {
this.completeAmount = completeAmount;
}
public BigDecimal getCompleteAmount() {
return completeAmount;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getBeginTime() {
return beginTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Date getEndTime() {
return endTime;
}
public void setIsFlag(Long isFlag) {
this.isFlag = isFlag;
}
public Long getIsFlag() {
return isFlag;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getCreatedTime() {
return createdTime;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Date getUpdatedTime() {
return updatedTime;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
public String getStoreCode() {
return storeCode;
}
public void setSpaceName(String spaceName) {
this.spaceName = spaceName;
}
public String getSpaceName() {
return spaceName;
}
public void setTaskModel(Long taskModel) {
this.taskModel = taskModel;
}
public Long getTaskModel() {
return taskModel;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objid", getObjid())
.append("taskCode", getTaskCode())
.append("taskType", getTaskType())
.append("taskStatus", getTaskStatus())
.append("planCode", getPlanCode())
.append("materialCode", getMaterialCode())
.append("materialType", getMaterialType())
.append("spaceCode", getSpaceCode())
.append("planAmount", getPlanAmount())
.append("completeAmount", getCompleteAmount())
.append("beginTime", getBeginTime())
.append("endTime", getEndTime())
.append("isFlag", getIsFlag())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.append("storeCode", getStoreCode())
.append("spaceName", getSpaceName())
.append("taskModel", getTaskModel())
.toString();
}
}

@ -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…
Cancel
Save