获取领料申请-详情列表
This commit is contained in:
parent
7f1e051e42
commit
6d642b7edf
|
|
@ -105,6 +105,12 @@ public class LeaseApplyDetails implements Serializable {
|
||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "计量单位")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备所属类型
|
* 设备所属类型
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,9 @@ public class TmTask implements Serializable {
|
||||||
@ApiModelProperty(value="任务状态")
|
@ApiModelProperty(value="任务状态")
|
||||||
private String taskName;
|
private String taskName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="审批状态id")
|
||||||
|
private String examineStatusId;
|
||||||
|
|
||||||
@ApiModelProperty(value="审批状态")
|
@ApiModelProperty(value="审批状态")
|
||||||
private String examineStatus;
|
private String examineStatus;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import com.bonus.sgzb.base.api.domain.TmTask;
|
||||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.sgzb.common.log.annotation.Log;
|
import com.bonus.sgzb.common.log.annotation.Log;
|
||||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -288,4 +289,14 @@ public class TmTaskController extends BaseController {
|
||||||
return tmTaskService.selectByPrimaryKey(Long.valueOf(id));
|
return tmTaskService.selectByPrimaryKey(Long.valueOf(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Log(title = "获取领料申请-详情列表", businessType = BusinessType.QUERY)
|
||||||
|
@GetMapping("/getLeaseListAll")
|
||||||
|
public TableDataInfo getLeaseListAll(@RequestParam(value ="taskId", required = false, defaultValue = "") String taskId){
|
||||||
|
TmTask task = new TmTask();
|
||||||
|
task.setTaskId(Long.parseLong(taskId));
|
||||||
|
List<TmTask> leaseAuditList = tmTaskService.getLeaseListAll(task);
|
||||||
|
return getDataTable(leaseAuditList);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,6 @@ 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 insert(TmTask record);
|
int insert(TmTask record);
|
||||||
|
|
||||||
int insertOrUpdate(TmTask record);
|
int insertOrUpdate(TmTask record);
|
||||||
|
|
@ -71,4 +67,15 @@ public interface TmTaskMapper {
|
||||||
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||||
|
|
||||||
int insertAgreement(TmTask record);
|
int insertAgreement(TmTask record);
|
||||||
|
|
||||||
|
int deleteTaskByPrimaryKey(String taskId);
|
||||||
|
|
||||||
|
int deleteTaskInfoByTaskId(String taskId);
|
||||||
|
|
||||||
|
int selectNumByMonth(Date nowDate);
|
||||||
|
|
||||||
|
|
||||||
|
TmTask getLeaseListTmTask(TmTask task);
|
||||||
|
|
||||||
|
LeaseApplyInfo getLeaseListByLeaseInfo(TmTask task);
|
||||||
}
|
}
|
||||||
|
|
@ -48,4 +48,6 @@ public interface TmTaskService{
|
||||||
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||||
|
|
||||||
int insertAgreement(TmTask record);
|
int insertAgreement(TmTask record);
|
||||||
|
|
||||||
|
List<TmTask> getLeaseListAll(TmTask task);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,14 @@ import com.bonus.sgzb.base.api.domain.LeaseApplyDetails;
|
||||||
import com.bonus.sgzb.base.api.domain.LeaseApplyInfo;
|
import com.bonus.sgzb.base.api.domain.LeaseApplyInfo;
|
||||||
import com.bonus.sgzb.base.api.domain.TmTask;
|
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
@ -103,22 +106,38 @@ public class TmTaskServiceImpl implements TmTaskService{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String genderLeaseCode() {
|
public String genderLeaseCode() {
|
||||||
Random random = new Random();
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date nowDate = DateUtils.getNowDate();
|
||||||
|
String format = dateFormat.format(nowDate);
|
||||||
|
String result = format.replace("-", "");
|
||||||
|
int num = tmTaskMapper.selectNumByMonth(nowDate) ;
|
||||||
|
num= num+ 1;
|
||||||
|
String code="";
|
||||||
|
if (num>9 && num<100){
|
||||||
|
code = "L" + result + "-00" + num;
|
||||||
|
}else if (num>99 && num<1000){
|
||||||
|
code = "L" + result + "-0" + num;
|
||||||
|
}else {
|
||||||
|
code = "L" + result + "-000" + num;
|
||||||
|
}
|
||||||
|
return code;
|
||||||
|
|
||||||
|
/*Random random = new Random();
|
||||||
// 先生成随机4位字符,后期根据数据库当月最大CODE值+1
|
// 先生成随机4位字符,后期根据数据库当月最大CODE值+1
|
||||||
int number = random.nextInt(9999);
|
int number = random.nextInt(9999);
|
||||||
// 将随机整激格式化4位字符串,不足4位在前面补
|
// 将随机整激格式化4位字符串,不足4位在前面补
|
||||||
return "L" + DateUtils.getDate() + "-" + String.format("%04d", number);
|
return "L" + DateUtils.getDate() + "-" + String.format("%04d", number);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult deleteByPrimaryKey(String taskId) {
|
public AjaxResult deleteByPrimaryKey(String taskId) {
|
||||||
boolean taskFlag = tmTaskMapper.deleteTaskByPrimaryKey(taskId) > 0;
|
int i = tmTaskMapper.deleteTaskByPrimaryKey(taskId);
|
||||||
boolean infoFlag = tmTaskMapper.deleteTaskInfoByTaskId(taskId) > 0;
|
int j = tmTaskMapper.deleteTaskInfoByTaskId(taskId);
|
||||||
if (taskFlag && infoFlag) {
|
if(i==1 && j==1){
|
||||||
return AjaxResult.success("删除成功");
|
return AjaxResult.success("删除成功");
|
||||||
} else if (taskFlag || infoFlag) {
|
}else if(i<1 || j<1){
|
||||||
return AjaxResult.error("删除失败,任务表或信息表未删除!");
|
return AjaxResult.error("删除失败,任务表或信息表未删除!");
|
||||||
} else {
|
}else {
|
||||||
return AjaxResult.error("删除失败,请检查任务ID是否正确!!");
|
return AjaxResult.error("删除失败,请检查任务ID是否正确!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -183,4 +202,19 @@ public class TmTaskServiceImpl implements TmTaskService{
|
||||||
return tmTaskMapper.insertAgreement(record);
|
return tmTaskMapper.insertAgreement(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TmTask> getLeaseListAll(TmTask task) {
|
||||||
|
List<TmTask> tmTaskList = new ArrayList<>();
|
||||||
|
TmTask tmTask = tmTaskMapper.getLeaseListTmTask(task);
|
||||||
|
if(tmTask != null){
|
||||||
|
LeaseApplyInfo leaseApplyInfo = tmTaskMapper.getLeaseListByLeaseInfo(task);
|
||||||
|
tmTask.setLeaseApplyInfo(leaseApplyInfo);
|
||||||
|
if(leaseApplyInfo !=null){
|
||||||
|
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyDetails(leaseApplyInfo);
|
||||||
|
tmTask.setLeaseApplyDetails(leaseApplyDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tmTaskList.add(tmTask);
|
||||||
|
return tmTaskList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,17 @@
|
||||||
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" />
|
||||||
|
|
@ -32,16 +43,6 @@
|
||||||
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>
|
|
||||||
|
|
||||||
<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},
|
||||||
|
|
@ -442,11 +443,14 @@
|
||||||
|
|
||||||
<select id="getAuditListByLeaseTmTask" resultType="com.bonus.sgzb.base.api.domain.TmTask">
|
<select id="getAuditListByLeaseTmTask" resultType="com.bonus.sgzb.base.api.domain.TmTask">
|
||||||
SELECT
|
SELECT
|
||||||
tt.*, su.phonenumber AS phoneNumber, sd.dept_name as deptName, bpi.pro_name as proName,
|
tt.*, su.phonenumber AS phoneNumber, sd.dept_name as deptName,
|
||||||
bui.unit_name as unitName, lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,d.`name` as taskName,
|
bpi.pro_id as proId,bpi.pro_name as proName,
|
||||||
|
bui.unit_id as unitId,bui.unit_name as unitName,
|
||||||
|
lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,d.`name` as taskName,
|
||||||
case when d.id = '30' then lai.company_audit_remark
|
case when d.id = '30' then lai.company_audit_remark
|
||||||
when d.id = '31' then lai.dept_audit_remark
|
when d.id = '31' then lai.dept_audit_remark
|
||||||
when d.id = '32' then lai.direct_audit_remark end examineStatus ,
|
when d.id = '32' then lai.direct_audit_remark end examineStatus ,
|
||||||
|
d.id as examineStatusId,
|
||||||
bai.agreement_code as agreementCode,
|
bai.agreement_code as agreementCode,
|
||||||
tt.create_time as createTimes, tt.update_time as updateTimes
|
tt.create_time as createTimes, tt.update_time as updateTimes
|
||||||
FROM
|
FROM
|
||||||
|
|
@ -494,7 +498,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
|
lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName
|
||||||
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
|
||||||
|
|
@ -503,6 +507,43 @@
|
||||||
lad.parennt_id = #{record.id} AND lad.company_id = #{record.companyId}
|
lad.parennt_id = #{record.id} AND lad.company_id = #{record.companyId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectNumByMonth" resultType="java.lang.Integer">
|
||||||
|
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') AND task_type='29'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getLeaseListTmTask" resultType="com.bonus.sgzb.base.api.domain.TmTask">
|
||||||
|
SELECT
|
||||||
|
tt.*, su.phonenumber AS phoneNumber, sd.dept_name as deptName,
|
||||||
|
bpi.pro_id as proId, bpi.pro_id as projectId,bpi.pro_name as proName,
|
||||||
|
bui.unit_id as unitId,bui.unit_name as unitName,
|
||||||
|
tt.create_by as applyFor,d.`name` as taskName,
|
||||||
|
d.id as examineStatusId,
|
||||||
|
bai.agreement_code as agreementCode,
|
||||||
|
tt.create_time as createTimes, tt.update_time as updateTimes,
|
||||||
|
bai.agreement_id as agreementId
|
||||||
|
FROM
|
||||||
|
tm_task tt
|
||||||
|
LEFT JOIN sys_user su ON tt.create_by = su.user_name
|
||||||
|
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
||||||
|
LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id
|
||||||
|
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
|
||||||
|
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
|
||||||
|
LEFT JOIN sys_dic d ON d.id = tt.task_status
|
||||||
|
WHERE tt.task_id = #{taskId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getLeaseListByLeaseInfo" resultType="com.bonus.sgzb.base.api.domain.LeaseApplyInfo">
|
||||||
|
SELECT
|
||||||
|
lai.*
|
||||||
|
FROM
|
||||||
|
lease_apply_info lai
|
||||||
|
WHERE
|
||||||
|
lai.task_id = #{taskId}
|
||||||
|
</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>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue