工机具管理-库管员配置;维修班配置

This commit is contained in:
sliang 2023-12-21 18:35:36 +08:00
parent 3a5e6f503a
commit b19a375a4b
10 changed files with 131 additions and 18 deletions

View File

@ -146,6 +146,9 @@ public class TmTask implements Serializable {
@ApiModelProperty(value="往来单位id")
private Long unitId;
@ApiModelProperty(value="往来单位")
private String unitName;
@ApiModelProperty(value="工程id")
private Long projectId;
@ApiModelProperty(value="关键字")
@ -157,4 +160,29 @@ public class TmTask implements Serializable {
@ApiModelProperty(value="类型")
private Integer types;
@ApiModelProperty(value="协议编号")
private String agreementCode;
@ApiModelProperty(value="领料人")
private String leasePerson;
@ApiModelProperty(value="领料人手机号")
private String leasePhone;
@ApiModelProperty(value="申请人")
private String applyFor;
@ApiModelProperty(value="任务状态")
private String taskName;
@ApiModelProperty(value="审批状态")
private String examineStatus;
@ApiModelProperty(value="创建时间")
private String createTimes;
@ApiModelProperty(value="更新时间")
private String updateTimes;
}

View File

@ -82,6 +82,11 @@ public class TmTaskController extends BaseController {
task.setCode(code);
// 创建任务
boolean addTaskResult = tmTaskService.insertSelective(task) > 0;
//任务与协议建立关联关系
boolean i = tmTaskService.insertAgreement(task) > 0;
if (addTaskResult && task.getLeaseApplyInfo() != null) {
if (CollUtil.isEmpty(task.getLeaseApplyDetails())) {
return AjaxResult.error("领料设备明细为空,请重新选择后上传!");
@ -215,11 +220,27 @@ public class TmTaskController extends BaseController {
/**
* 查询机具领料审核列表
* 查询机具领料审核列表 - 后台
* @param task 筛选条件
* @return 列表
*/
@Log(title = "查询机具领料审核列表", businessType = BusinessType.QUERY)
@Log(title = "查询机具领料审核列表- 后台", businessType = BusinessType.QUERY)
@GetMapping(value = "getLeaseAuditListAll")
public AjaxResult getLeaseAuditListAll(TmTask task) {
if (StringUtils.isNull(task)) {
return AjaxResult.error("参数错误");
}
startPage();
List<TmTask> leaseAuditList = tmTaskService.getLeaseAuditList(task);
return AjaxResult.success(getDataTable(leaseAuditList));
}
/**
* 查询机具领料审核列表 - app
* @param task 筛选条件
* @return 列表
*/
@Log(title = "查询机具领料审核列表- app", businessType = BusinessType.QUERY)
@GetMapping(value = "getLeaseAuditList")
public AjaxResult getLeaseAuditList(TmTask task) {
if (StringUtils.isNull(task)) {

View File

@ -69,4 +69,6 @@ public interface TmTaskMapper {
int batchInsert(@Param("list") List<TmTask> list);
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
int insertAgreement(TmTask record);
}

View File

@ -46,4 +46,6 @@ public interface TmTaskService{
int batchInsert(List<TmTask> list);
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
int insertAgreement(TmTask record);
}

View File

@ -178,4 +178,9 @@ public class TmTaskServiceImpl implements TmTaskService{
return tmTaskMapper.selectTaskNumByMonth(date,taskType);
}
@Override
public int insertAgreement(TmTask record) {
return tmTaskMapper.insertAgreement(record);
}
}

View File

@ -67,9 +67,7 @@
<if test="updateBy != null and updateBy != ''">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
@ -94,9 +92,7 @@
<if test="updateBy != null and updateBy != ''">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
now(),
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
@ -439,9 +435,20 @@
</trim>
</insert>
<insert id="insertAgreement">
INSERT INTO tm_task_agreement ( `task_id`, `agreement_id`, `create_by`, `create_time`, `company_id` )
VALUES(#{id},#{agreementId},#{createBy},NOW(),#{companyId})
</insert>
<select id="getAuditListByLeaseTmTask" resultType="com.bonus.sgzb.base.api.domain.TmTask">
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, bpi.pro_name as proName,
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
when d.id = '31' then lai.dept_audit_remark
when d.id = '32' then lai.direct_audit_remark end examineStatus ,
bai.agreement_code as agreementCode,
tt.create_time as createTimes, tt.update_time as updateTimes
FROM
tm_task tt
LEFT JOIN sys_user su ON tt.create_by = su.user_name
@ -449,11 +456,31 @@
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 lease_apply_info lai ON lai.task_id = tt.task_id
LEFT JOIN sys_dic d ON d.id = tt.task_status
WHERE
tt.task_type = '29' and tt.status = '1'
<if test="record.taskId != null and record.taskId != '' ">
AND tt.task_id = #{record.taskId}
</if>
<if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">
AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')
</if>
<if test="record.unitId != null and record.unitId != ''">
AND bui.unit_id = #{record.unitId}
</if>
<if test="record.projectId != null and record.projectId != ''">
AND bpi.pro_id = #{record.projectId}
</if>
<if test="record.keyWord != null and record.keyWord != ''">
AND bai.agreement_code like concat('%', #{record.keyWord}, '%')
</if>
ORDER BY tt.update_time DESC
</select>
<select id="getAuditListByLeaseInfo" resultType="com.bonus.sgzb.base.api.domain.LeaseApplyInfo">

View File

@ -70,7 +70,12 @@ public class AgreementInfoController extends BaseController {
@PostMapping("/add")
public AjaxResult add(@Validated @RequestBody AgreementInfo bean)
{
return toAjax(agreementInfoService.add(bean));
int i = agreementInfoService.add(bean);
if(i==-1){
return AjaxResult.error("已存在重复数据");
}else{
return toAjax(i);
}
}
@ApiOperation("协议管理-修改")

View File

@ -27,4 +27,6 @@ public interface AgreementInfoMapper {
int deleteByIds(AgreementInfo bean);
AgreementInfo getAgreementInfoId(AgreementInfo bean);
List<AgreementInfo> getInfo(AgreementInfo bean);
}

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.material.domain.AgreementInfo;
import com.bonus.sgzb.material.mapper.AgreementInfoMapper;
import com.bonus.sgzb.material.service.AgreementInfoService;
@ -37,9 +38,16 @@ public class AgreementInfoServiceImpl implements AgreementInfoService {
@Override
public int add(AgreementInfo bean) {
List<AgreementInfo> list = agreementInfoMapper.getInfo(bean);
int i = 0;
if(list.size()>0){
i = -1;
}else{
String agreementCode = purchaseCodeRule();
bean.setAgreementCode(agreementCode);
return agreementInfoMapper.add(bean);
i = agreementInfoMapper.add(bean);
}
return i;
}
@Override
@ -63,8 +71,16 @@ public class AgreementInfoServiceImpl implements AgreementInfoService {
Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate);
String result = format.replace("-", "");
int num = agreementInfoMapper.selectNumByMonth(nowDate) + 1;
String code = "XY" + result + "000" + num;
int num = agreementInfoMapper.selectNumByMonth(nowDate) ;
num= num+ 1;
String code="";
if (num>9 && num<100){
code = "XY" + result + "-00" + num;
}else if (num>99 && num<1000){
code = "XY" + result + "-0" + num;
}else {
code = "XY" + result + "-000" + num;
}
return code;
}
}

View File

@ -39,13 +39,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="contractCode != null">contract_code,</if>
<if test="authPerson != null">auth_person,</if>
<if test="phone != null">phone,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
update_time,
<if test="remark != null">remark,</if>
<if test="companyId != null">company_id,</if>
<if test="fileName != null">file_name,</if>
<if test="fileUrl != null">file_url,</if>
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="agreementCode != null">#{agreementCode},</if>
@ -58,13 +58,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="contractCode != null">#{contractCode},</if>
<if test="authPerson != null">#{authPerson},</if>
<if test="phone != null">#{phone},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
NOW(),
<if test="remark != null">#{remark},</if>
<if test="companyId != null">#{companyId},</if>
<if test="fileName != null">#{fileName},</if>
<if test="fileUrl != null">#{fileUrl},</if>
NOW()
</trim>
</insert>
@ -139,4 +139,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE agreement_id = #{agreementId}
</select>
<select id="getInfo" resultType="com.bonus.sgzb.material.domain.AgreementInfo">
SELECT * FROM `bm_agreement_info`
WHERE status = '1' and unit_id = #{unitId} AND project_id = #{projectId}
</select>
</mapper>