删除领料明细接口提交

This commit is contained in:
syruan 2023-12-22 14:52:51 +08:00
parent 6d642b7edf
commit bf0c462853
9 changed files with 126 additions and 97 deletions

View File

@ -117,4 +117,10 @@ public class LeaseApplyDetails implements Serializable {
@ApiModelProperty(value = "数据所属组织") @ApiModelProperty(value = "数据所属组织")
private Integer companyId; private Integer companyId;
/**
* 装备管理方式(0编号 1计数)
*/
@ApiModelProperty(value = "装备管理方式")
private int manageType;
} }

View File

@ -67,9 +67,9 @@ public class TmTask implements Serializable {
private String phoneNumber; private String phoneNumber;
/** /**
* 部门名称 * 部门名称 单位名称
*/ */
@ApiModelProperty(value="部门名称") @ApiModelProperty(value="部门/单位名称")
private String deptName; private String deptName;
/** /**

View File

@ -63,6 +63,18 @@ public class TmTaskController extends BaseController {
return tmTaskService.deleteByPrimaryKey(taskId); return tmTaskService.deleteByPrimaryKey(taskId);
} }
/**
* 根据id删除领料明细表
*/
@Log(title = "删除领料任务明细", businessType = BusinessType.DELETE)
@DeleteMapping("/deleteDetailsByTaskId/{id}")
public AjaxResult deleteDetailsByTaskId(@PathVariable String id) {
if (StringUtils.isEmpty(id)) {
return AjaxResult.error("参数错误,删除失败!");
}
return toAjax(tmTaskService.deleteDetailsByTaskId(id));
}
/** /**
* 往来单位提交工程领用机具信息 * 往来单位提交工程领用机具信息
@ -261,15 +273,16 @@ public class TmTaskController extends BaseController {
return AjaxResult.error("参数错误,传入信息为空!"); return AjaxResult.error("参数错误,传入信息为空!");
} }
try { try {
// 任务编号
String taskId = task.getId();
// 任务类型
Integer taskType = task.getTaskType();
// 任务状态
Integer taskStatus = task.getTaskStatus();
int taskResult = tmTaskService.updateByPrimaryKeySelective(task); int taskResult = tmTaskService.updateByPrimaryKeySelective(task);
if (taskResult > 0) { if (taskResult > 0) {
return AjaxResult.success("任务表修改成功"); if (CollUtil.isNotEmpty(task.getLeaseApplyDetails())) {
for (LeaseApplyDetails leaseApplyDetails : task.getLeaseApplyDetails()) {
leaseApplyDetailsService.updateByPrimaryKeySelective(leaseApplyDetails);
}
return AjaxResult.success("修改成功");
} else {
return AjaxResult.error("任务表修改成功,但领料任务明细修改信息为空");
}
} else { } else {
return AjaxResult.error("任务表修改失败"); return AjaxResult.error("任务表修改失败");
} }

View File

@ -1,10 +1,11 @@
package com.bonus.sgzb.app.mapper; package com.bonus.sgzb.app.mapper;
import com.bonus.sgzb.base.api.domain.LeaseApplyDetails; import com.bonus.sgzb.base.api.domain.LeaseApplyDetails;
import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* Description: 领料任务详情Mapper接口 * Description: 领料任务详情Mapper接口
* @Author 阮世耀 * @Author 阮世耀
@ -26,6 +27,11 @@ public interface LeaseApplyDetailsMapper {
LeaseApplyDetails selectByPrimaryKey(Integer id); LeaseApplyDetails selectByPrimaryKey(Integer id);
/**
* 根据主键更新实体属性不为null的列
* @param record 实体对象
* @return 影响行数
*/
int updateByPrimaryKeySelective(LeaseApplyDetails record); int updateByPrimaryKeySelective(LeaseApplyDetails record);
int updateByPrimaryKey(LeaseApplyDetails record); int updateByPrimaryKey(LeaseApplyDetails record);

View File

@ -39,6 +39,12 @@ public interface TmTaskMapper {
/** 更新leaseApplyDetails审批信息 */ /** 更新leaseApplyDetails审批信息 */
int updateLeaseApplyDetailsAuditInfo(@Param("record") LeaseApplyDetails record); int updateLeaseApplyDetailsAuditInfo(@Param("record") LeaseApplyDetails record);
int deleteTaskByPrimaryKey(String taskId);
int deleteTaskInfoByTaskId(String taskId);
int deleteDetailsByTaskId(@Param("id") String id);
int insert(TmTask record); int insert(TmTask record);
int insertOrUpdate(TmTask record); int insertOrUpdate(TmTask record);
@ -68,13 +74,8 @@ public interface TmTaskMapper {
int insertAgreement(TmTask record); int insertAgreement(TmTask record);
int deleteTaskByPrimaryKey(String taskId);
int deleteTaskInfoByTaskId(String taskId);
int selectNumByMonth(Date nowDate); int selectNumByMonth(Date nowDate);
TmTask getLeaseListTmTask(TmTask task); TmTask getLeaseListTmTask(TmTask task);
LeaseApplyInfo getLeaseListByLeaseInfo(TmTask task); LeaseApplyInfo getLeaseListByLeaseInfo(TmTask task);

View File

@ -25,6 +25,8 @@ public interface TmTaskService{
AjaxResult deleteByPrimaryKey(String taskId); AjaxResult deleteByPrimaryKey(String taskId);
int deleteDetailsByTaskId(@Param("id") String id);
int createTask(TmTask record); int createTask(TmTask record);
int insertOrUpdate(TmTask record); int insertOrUpdate(TmTask record);

View File

@ -142,6 +142,16 @@ public class TmTaskServiceImpl implements TmTaskService{
} }
} }
/**
* 根据id删除详情表配置的设备
* @param id 数据id
* @return 结果
*/
@Override
public int deleteDetailsByTaskId(String id) {
return tmTaskMapper.deleteDetailsByTaskId(id);
}
@Override @Override
public int createTask(TmTask record) { public int createTask(TmTask record) {
return tmTaskMapper.insert(record); return tmTaskMapper.insert(record);

View File

@ -119,16 +119,10 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails"> <update id="updateByPrimaryKeySelective" parameterType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails">
<!--@mbg.generated-->
update lease_apply_details update lease_apply_details
<set> <set>
<if test="parenntId != null">
parennt_id = #{parenntId,jdbcType=INTEGER},
</if>
<if test="typeId != null">
type_id = #{typeId,jdbcType=INTEGER},
</if>
<if test="preNum != null"> <if test="preNum != null">
pre_num = #{preNum,jdbcType=FLOAT}, pre_num = #{preNum,jdbcType=FLOAT},
</if> </if>
@ -138,12 +132,6 @@
<if test="status != null and status != ''"> <if test="status != null and status != ''">
`status` = #{status,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR},
</if> </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 != ''"> <if test="updateBy != null and updateBy != ''">
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
</if> </if>

View File

@ -21,17 +21,6 @@
remark, company_id remark, company_id
</sql> </sql>
<update id="deleteTaskByPrimaryKey">
update tm_task set `status` = '0'
where task_id = #{taskId}
</update>
<update id="deleteTaskInfoByTaskId">
update lease_apply_info set `status` = '0'
where task_id = #{taskId}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
@ -43,6 +32,20 @@
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{taskType} select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{taskType}
</select> </select>
<update id="deleteTaskByPrimaryKey" parameterType="java.lang.Long">
update tm_task set `status` = '0'
where task_id = #{taskId,jdbcType=BIGINT}
</update>
<update id="deleteTaskInfoByTaskId" parameterType="java.lang.Long">
update lease_apply_info set `status` = '0'
where task_id = #{taskId}
</update>
<delete id="deleteDetailsByTaskId" parameterType="java.lang.String">
delete from lease_apply_details where id = #{id}
</delete>
<insert id="insert" keyColumn="task_id" keyProperty="taskId" parameterType="com.bonus.sgzb.base.api.domain.TmTask" useGeneratedKeys="true"> <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) insert into tm_task (task_type, task_status, code, create_by, create_time, update_by, update_time, remark, company_id)
values (#{taskType,jdbcType=INTEGER}, #{taskStatus,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, values (#{taskType,jdbcType=INTEGER}, #{taskStatus,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
@ -436,6 +439,7 @@
</trim> </trim>
</insert> </insert>
<insert id="insertAgreement"> <insert id="insertAgreement">
INSERT INTO tm_task_agreement ( `task_id`, `agreement_id`, `create_by`, `create_time`, `company_id` ) INSERT INTO tm_task_agreement ( `task_id`, `agreement_id`, `create_by`, `create_time`, `company_id` )
VALUES(#{id},#{agreementId},#{createBy},NOW(),#{companyId}) VALUES(#{id},#{agreementId},#{createBy},NOW(),#{companyId})
@ -498,7 +502,7 @@
<select id="getLeaseApplyDetails" resultType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails"> <select id="getLeaseApplyDetails" resultType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails">
SELECT SELECT
lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType
FROM FROM
lease_apply_details lad lease_apply_details lad
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
@ -543,7 +547,6 @@
lai.task_id = #{taskId} lai.task_id = #{taskId}
</select> </select>
<update id="updateTmTaskAuditStatus"> <update id="updateTmTaskAuditStatus">
UPDATE tm_task SET task_status = #{record.taskStatus} WHERE task_id = #{record.taskId} UPDATE tm_task SET task_status = #{record.taskStatus} WHERE task_id = #{record.taskId}
</update> </update>