This commit is contained in:
jackal 2024-04-12 09:02:20 +08:00
commit 12d22b9181
9 changed files with 142 additions and 105 deletions

View File

@ -123,6 +123,7 @@ public class BackReceiveController extends BaseController {
* 编码退料--管理方式为0的 * 编码退料--管理方式为0的
* *
* @param record 查询条件 * @param record 查询条件
*
* @return AjaxResult对象 * @return AjaxResult对象
*/ */
@Log(title = "退料接收-编码退料", businessType = BusinessType.INSERT) @Log(title = "退料接收-编码退料", businessType = BusinessType.INSERT)

View File

@ -13,13 +13,14 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* Description: 任务表tm_task * Description: 任务表tm_task
* @Author 阮世耀 *
* @Create 2023/12/13 15:14 * @Author 阮世耀
* @Version 1.0 * @Create 2023/12/13 15:14
*/ * @Version 1.0
*/
@ApiModel(description="任务表tm_task") @ApiModel(description = "任务表tm_task")
@Data @Data
public class TmTask implements Serializable { public class TmTask implements Serializable {
@ -28,221 +29,222 @@ public class TmTask implements Serializable {
private String id; private String id;
/** /**
* 任务ID * 任务ID
*/ */
@ApiModelProperty(value="任务ID") @ApiModelProperty(value = "任务ID")
private Long taskId; private Long taskId;
private Long parentId; private Long parentId;
private Integer outNum; private Integer outNum;
/** /**
* 任务类型(定义数据字典) * 任务类型(定义数据字典)
*/ */
@ApiModelProperty(value="任务类型(数据字典)") @ApiModelProperty(value = "任务类型(数据字典)")
private Integer taskType; private Integer taskType;
/** /**
* 任务状态(定义数据字典) * 任务状态(定义数据字典)
*/ */
@ApiModelProperty(value="任务状态(数据字典)") @ApiModelProperty(value = "任务状态(数据字典)")
private Integer taskStatus; private Integer taskStatus;
private Integer flag; private Integer flag;
/** /**
* 预领料合计数 * 预领料合计数
*/ */
@ApiModelProperty(value="预领料合计数") @ApiModelProperty(value = "预领料合计数")
private Integer preCountNum; private Integer preCountNum;
/** /**
* 预领料合计数 * 预领料合计数
*/ */
@ApiModelProperty(value="已出库数量") @ApiModelProperty(value = "已出库数量")
private Integer alNum; private Integer alNum;
/** /**
* 库存 * 库存
*/ */
@ApiModelProperty(value="库存") @ApiModelProperty(value = "库存")
private Integer num; private Integer num;
/** /**
* 编号 * 编号
*/ */
@ApiModelProperty(value="编号") @ApiModelProperty(value = "编号")
@Excel(name = "领料单号",sort = 1) @Excel(name = "领料单号", sort = 1)
private String code; private String code;
/** /**
* 创建者 * 创建者
*/ */
@ApiModelProperty(value="创建者") @ApiModelProperty(value = "创建者")
private String createBy; private String createBy;
/** /**
* 申请人手机号码 * 申请人手机号码
*/ */
@ApiModelProperty(value="手机号") @ApiModelProperty(value = "手机号")
private String phoneNumber; private String phoneNumber;
/** /**
* 部门名称 单位名称 * 部门名称 单位名称
*/ */
@ApiModelProperty(value="部门/单位名称") @ApiModelProperty(value = "部门/单位名称")
private String deptName; private String deptName;
/** /**
* 工程名称 * 工程名称
*/ */
@ApiModelProperty(value="工程名称") @ApiModelProperty(value = "工程名称")
@Excel(name = "领料工程",sort = 3) @Excel(name = "领料工程", sort = 3)
private String proName; private String proName;
/** /**
* 工程id * 工程id
*/ */
@ApiModelProperty(value="工程id") @ApiModelProperty(value = "工程id")
private Integer proId; private Integer proId;
/** /**
* 创建时间 * 创建时间
*/ */
@ApiModelProperty(value="创建时间") @ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime; private Date createTime;
/** /**
* 更新者 * 更新者
*/ */
@ApiModelProperty(value="更新者") @ApiModelProperty(value = "更新者")
private String updateBy; private String updateBy;
/** /**
* 更新时间 * 更新时间
*/ */
@ApiModelProperty(value="更新时间") @ApiModelProperty(value = "更新时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime; private Date updateTime;
/** /**
* 备注 * 备注
*/ */
@ApiModelProperty(value="备注") @ApiModelProperty(value = "备注")
@Excel(name = "备注",sort = 11) @Excel(name = "备注", sort = 11)
private String remark; private String remark;
/** /**
* 数据所属组织 * 数据所属组织
*/ */
@ApiModelProperty(value="数据所属组织") @ApiModelProperty(value = "数据所属组织")
private Integer companyId; private Integer companyId;
/** /**
* 领料任务实体 * 领料任务实体
*/ */
@ApiModelProperty(value="领料任务实体") @ApiModelProperty(value = "领料任务实体")
private LeaseApplyInfo leaseApplyInfo; private LeaseApplyInfo leaseApplyInfo;
/** /**
* 领料任务实体集合 * 领料任务实体集合
*/ */
@ApiModelProperty(value="领料任务实体集合") @ApiModelProperty(value = "领料任务实体集合")
private List<LeaseApplyInfo> leaseApplyInfoList; private List<LeaseApplyInfo> leaseApplyInfoList;
/** /**
* 领料任务详情集合 * 领料任务详情集合
*/ */
@ApiModelProperty(value="领料任务详情集合") @ApiModelProperty(value = "领料任务详情集合")
private List<LeaseApplyDetails> leaseApplyDetails; private List<LeaseApplyDetails> leaseApplyDetails;
@ApiModelProperty(value="协议id") @ApiModelProperty(value = "协议id")
private Integer agreementId; private Integer agreementId;
@ApiModelProperty(value="退料人") @ApiModelProperty(value = "退料人")
private String backPerson; private String backPerson;
@ApiModelProperty(value="退料人联系电话") @ApiModelProperty(value = "退料人联系电话")
private String phone; private String phone;
@ApiModelProperty(value="退料申请时间") @ApiModelProperty(value = "退料申请时间")
private String backTime; private String backTime;
@ApiModelProperty(value="退料审核人 机具分公司审批人") @ApiModelProperty(value = "退料审核人 机具分公司审批人")
private String directAuditBy; private String directAuditBy;
@ApiModelProperty(value="退料审核时间 机具分公司审批时间") @ApiModelProperty(value = "退料审核时间 机具分公司审批时间")
private String directAuditTime; private String directAuditTime;
@ApiModelProperty(value="退料审核备注 机具分公司审批备注") @ApiModelProperty(value = "退料审核备注 机具分公司审批备注")
private String directAuditRemark; private String directAuditRemark;
@ApiModelProperty(value="往来单位id") @ApiModelProperty(value = "往来单位id")
private Long unitId; private Long unitId;
@ApiModelProperty(value="往来单位") @ApiModelProperty(value = "往来单位")
@Excel(name = "领料单位",sort = 2) @Excel(name = "领料单位", sort = 2)
private String unitName; private String unitName;
@ApiModelProperty(value="工程id") @ApiModelProperty(value = "工程id")
private Long projectId; private Long projectId;
@ApiModelProperty(value="关键字") @ApiModelProperty(value = "关键字")
private String keyWord; private String keyWord;
@ApiModelProperty(value="开始时间") @ApiModelProperty(value = "开始时间")
private String startTime; private String startTime;
@ApiModelProperty(value="结束时间") @ApiModelProperty(value = "结束时间")
private String endTime; private String endTime;
@ApiModelProperty(value="类型") @ApiModelProperty(value = "类型")
private Integer types; private Integer types;
@ApiModelProperty(value="协议编号") @ApiModelProperty(value = "协议编号")
@Excel(name = "协议号",sort = 4) @Excel(name = "协议号", sort = 4)
private String agreementCode; private String agreementCode;
@ApiModelProperty(value="领料人") @ApiModelProperty(value = "领料人")
@Excel(name = "领料人",sort = 5) @Excel(name = "领料人", sort = 5)
private String leasePerson; private String leasePerson;
@ApiModelProperty(value="领料人手机号") @ApiModelProperty(value = "领料人手机号")
@Excel(name = "联系电话",sort = 6) @Excel(name = "联系电话", sort = 6)
private String leasePhone; private String leasePhone;
@ApiModelProperty(value="申请人") @ApiModelProperty(value = "申请人")
@Excel(name = "申请人",sort = 7) @Excel(name = "申请人", sort = 7)
private String applyFor; private String applyFor;
@ApiModelProperty(value="任务状态") @ApiModelProperty(value = "任务状态")
@Excel(name = "任务状态",sort = 9) @Excel(name = "任务状态", sort = 9)
private String taskName; private String taskName;
@ApiModelProperty(value="审批状态id") @ApiModelProperty(value = "审批状态id")
private String examineStatusId; private String examineStatusId;
@ApiModelProperty(value="审批状态的备注") @ApiModelProperty(value = "审批状态的备注")
@Excel(name = "审批结果",sort = 10) @Excel(name = "审批结果", sort = 10)
private String examineStatus; private String examineStatus;
@ApiModelProperty(value="创建时间") @ApiModelProperty(value = "创建时间")
@Excel(name = "申请时间",sort = 8) @Excel(name = "申请时间", sort = 8)
private String createTimes; private String createTimes;
@ApiModelProperty(value="更新时间") @ApiModelProperty(value = "更新时间")
private String updateTimes; private String updateTimes;
@ApiModelProperty(value="公司审批人") @ApiModelProperty(value = "公司审批人")
private String companyAuditBy; private String companyAuditBy;
@ApiModelProperty(value="公司审批时间") @ApiModelProperty(value = "公司审批时间")
private String companyAuditTime; private String companyAuditTime;
@ApiModelProperty(value="公司审批备注") @ApiModelProperty(value = "公司审批备注")
private String companyAuditRemark; private String companyAuditRemark;
@ApiModelProperty(value="分管审批人") @ApiModelProperty(value = "分管审批人")
private String deptAuditBy; private String deptAuditBy;
@ApiModelProperty(value="分管审批时间") @ApiModelProperty(value = "分管审批时间")
private String deptAuditTime; private String deptAuditTime;
@ApiModelProperty(value="分管审批备注") @ApiModelProperty(value = "分管审批备注")
private String deptAuditRemark; private String deptAuditRemark;
@ApiModelProperty(value="领用类型0 短期租赁 1长期领用") @ApiModelProperty(value = "领用类型0 工程租赁 1长期领用")
@Excel(name = "领料类型", readConverterExp = "0=工程租赁,1=长期租赁")
private String leaseType; private String leaseType;
private String userId; private String userId;
@ -255,8 +257,8 @@ public class TmTask implements Serializable {
private String maId; private String maId;
private String maStatus; private String maStatus;
private String typeId; private String typeId;
@ApiModelProperty(value="预计领料时间(重庆)") @ApiModelProperty(value = "预计领料时间(重庆)")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date estimateLeaseTime; private Date estimateLeaseTime;

View File

@ -73,7 +73,7 @@ public class TmTaskVo implements Serializable {
* 领用类型 * 领用类型
*/ */
@ApiModelProperty(value = "领料类型") @ApiModelProperty(value = "领料类型")
@Excel(name = "领料类型", sort = 12, readConverterExp = "0=短期租赁,1=长期租赁") @Excel(name = "领料类型", sort = 12, readConverterExp = "0=工程租赁,1=长期租赁")
private String leaseType; private String leaseType;
/** /**

View File

@ -58,6 +58,11 @@ public class BackApplyController extends BaseController {
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
} }
@ApiOperation(value = "退料申请获取当前类型在用量")
@GetMapping("/getUseNumByTypeId")
public AjaxResult getUseNumByTypeId(String typeId) {
return AjaxResult.success(backApplyService.getUseNumByTypeId(typeId));
}
@ApiOperation(value = "在用设备类型树") @ApiOperation(value = "在用设备类型树")
@PostMapping("/getUseTypeTree") @PostMapping("/getUseTypeTree")

View File

@ -131,4 +131,6 @@ public interface BackApplyMapper {
int delApply(BackApplyInfo bean); int delApply(BackApplyInfo bean);
List<BackApplyInfo> selectIdByTaskId(Integer taskId); List<BackApplyInfo> selectIdByTaskId(Integer taskId);
int getUseNumByTypeId(String typeId);
} }

View File

@ -119,4 +119,6 @@ public interface BackApplyService {
int delApply(BackApplyInfo bean); int delApply(BackApplyInfo bean);
List<BackApplyInfo> selectIdByTaskId(Integer taskId); List<BackApplyInfo> selectIdByTaskId(Integer taskId);
int getUseNumByTypeId(String typeId);
} }

View File

@ -373,4 +373,9 @@ public class BackApplyServiceImpl implements BackApplyService {
return backApplyMapper.selectIdByTaskId(taskId); return backApplyMapper.selectIdByTaskId(taskId);
} }
@Override
public int getUseNumByTypeId(String typeId) {
return backApplyMapper.getUseNumByTypeId(typeId);
}
} }

View File

@ -811,5 +811,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectIdByTaskId" resultType="com.bonus.sgzb.material.domain.BackApplyInfo"> <select id="selectIdByTaskId" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
select * from back_apply_info where task_id = #{taskId} select * from back_apply_info where task_id = #{taskId}
</select> </select>
<select id="getUseNumByTypeId" resultType="java.lang.Integer">
select count(*) as useNum from ma_machine where type_id = #{typeId} and ma_status in (16,84)
</select>
</mapper> </mapper>

View File

@ -486,12 +486,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by status order by status
</select> </select>
<select id="isOperateAll" resultType="java.lang.Integer"> <select id="isOperateAll" resultType="java.lang.Integer">
SELECT SELECT count(*)
count(*) FROM (SELECT CASE
FROM
purchase_check_details WHEN
WHERE pmi.ma_code IS NOT NULL THEN
task_id = #{taskId} and (status = 1 or status=6) CASE
WHEN pmi.STATUS = 0 THEN
1
WHEN pmi.STATUS = 1 THEN
4
WHEN pmi.STATUS = 2 THEN
5
ELSE 1
END
ELSE pcd.STATUS
END AS STATUS
FROM purchase_check_details pcd
LEFT JOIN purchase_macode_info pmi ON pmi.task_id = pcd.task_id
AND pmi.type_id = pcd.type_id
LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code
WHERE pcd.task_id = #{taskId}) aa
WHERE (STATUS = 1 OR STATUS = 6)
</select> </select>
<select id="selectPurchaseCheckDetailsStatus" resultType="java.lang.Integer"> <select id="selectPurchaseCheckDetailsStatus" resultType="java.lang.Integer">
SELECT SELECT