工地直转
This commit is contained in:
parent
6b7767fec0
commit
39c42e931f
|
|
@ -12,22 +12,29 @@ public class DirectApplyDetails extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
private int id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 直转单号
|
* 直转单号
|
||||||
*/
|
*/
|
||||||
private int directId;
|
private Integer directId;
|
||||||
/**
|
/**
|
||||||
* 退料单位协议
|
* 机具类型
|
||||||
*/
|
*/
|
||||||
private int typeId;
|
private Integer typeId;
|
||||||
/**
|
/**
|
||||||
* 退料人
|
* 机具id
|
||||||
*/
|
*/
|
||||||
private int maId;
|
private Integer maId;
|
||||||
/**
|
/**
|
||||||
* 手机号
|
* 直转数量
|
||||||
*/
|
*/
|
||||||
private String directNum;
|
private String directNum;
|
||||||
|
private String typeName;
|
||||||
|
private String kindName;
|
||||||
|
private String modelName;
|
||||||
|
private String maCode;
|
||||||
|
private String unitName;
|
||||||
|
private String useNum;
|
||||||
|
private String companyId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.bonus.sgzb.base.api.domain;
|
||||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:梁超
|
* @Author:梁超
|
||||||
* @date:2024/3/4 - 15:17
|
* @date:2024/3/4 - 15:17
|
||||||
|
|
@ -13,7 +15,7 @@ public class DirectApplyInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
private int id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 直转单号(ZZ20240226-1)
|
* 直转单号(ZZ20240226-1)
|
||||||
*/
|
*/
|
||||||
|
|
@ -21,7 +23,7 @@ public class DirectApplyInfo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 退料单位协议
|
* 退料单位协议
|
||||||
*/
|
*/
|
||||||
private int backAgreementId;
|
private Integer backAgreementId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料工程id
|
* 退料工程id
|
||||||
|
|
@ -105,5 +107,15 @@ public class DirectApplyInfo extends BaseEntity {
|
||||||
* 审核备注
|
* 审核备注
|
||||||
*/
|
*/
|
||||||
private String auditRemark;
|
private String auditRemark;
|
||||||
|
/**
|
||||||
|
* 退料单位协议
|
||||||
|
*/
|
||||||
|
private String backAgreementCode;
|
||||||
|
/**
|
||||||
|
* 领料单位协议
|
||||||
|
*/
|
||||||
|
private String leaseAgreementCode;
|
||||||
|
|
||||||
|
private List<DirectApplyDetails> directApplyDetails;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,7 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
import com.bonus.sgzb.material.domain.*;
|
||||||
import com.bonus.sgzb.material.domain.DirectApplyInfoDetails;
|
|
||||||
import com.bonus.sgzb.material.domain.DirectPassApplyInfoDetails;
|
|
||||||
import com.bonus.sgzb.material.domain.TmTask;
|
|
||||||
import com.bonus.sgzb.material.service.ApplyInfoService;
|
import com.bonus.sgzb.material.service.ApplyInfoService;
|
||||||
import com.bonus.sgzb.material.service.TaskService;
|
import com.bonus.sgzb.material.service.TaskService;
|
||||||
import com.bonus.sgzb.material.service.WorkSiteDirectManageService;
|
import com.bonus.sgzb.material.service.WorkSiteDirectManageService;
|
||||||
|
|
@ -44,6 +41,9 @@ public class WorkSiteDirectManageController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private TaskService tmTaskService;
|
private TaskService tmTaskService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ApplyInfoService applyInfoService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表展示
|
* 列表展示
|
||||||
|
|
@ -145,12 +145,27 @@ public class WorkSiteDirectManageController extends BaseController {
|
||||||
return AjaxResult.error("领料信息和详情新增失败");
|
return AjaxResult.error("领料信息和详情新增失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<LeaseOutDetails> leaseOutDetails = directApplyInfoDetails.getLeaseOutDetails();
|
List<LeaseApplyDetails> leaseApplyDetails = task.getLeaseApplyDetails();
|
||||||
if (CollUtil.isEmpty(leaseOutDetails)) {
|
if (CollUtil.isEmpty(leaseApplyDetails)) {
|
||||||
return AjaxResult.error("领料出库信息为空");
|
return AjaxResult.error("领料出库信息为空");
|
||||||
}
|
}
|
||||||
|
List<LeaseApplyInfo> leaseApplyInfoList = applyInfoService.selectIdByTaskId(task.getTaskId().intValue());
|
||||||
|
List<LeaseOutDetails> list = new ArrayList();
|
||||||
|
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
|
||||||
|
LeaseOutDetails leaseOutDetails = new LeaseOutDetails();
|
||||||
|
for (LeaseApplyInfo leaseApplyInfo : leaseApplyInfoList) {
|
||||||
|
if (leaseApplyInfo.getCompanyId().equals(leaseApplyDetail.getCompanyId())) {
|
||||||
|
leaseOutDetails.setParentId(leaseApplyInfo.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
leaseOutDetails.setTypeId(leaseApplyDetail.getTypeId());
|
||||||
|
leaseOutDetails.setMaId(leaseApplyDetail.getMaId());
|
||||||
|
leaseOutDetails.setOutNum(leaseApplyDetail.getPreNum());
|
||||||
|
leaseOutDetails.setCompanyId(leaseApplyDetail.getCompanyId());
|
||||||
|
list.add(leaseOutDetails);
|
||||||
|
}
|
||||||
// 新增出库记录
|
// 新增出库记录
|
||||||
int res4 = workSiteDirectManageService.insertLeaseOutDetail(leaseOutDetails);
|
int res4 = workSiteDirectManageService.insertLeaseOutDetail(list);
|
||||||
if (res4 == 0) {
|
if (res4 == 0) {
|
||||||
return AjaxResult.error("新增出库记录失败");
|
return AjaxResult.error("新增出库记录失败");
|
||||||
}
|
}
|
||||||
|
|
@ -182,7 +197,11 @@ public class WorkSiteDirectManageController extends BaseController {
|
||||||
return AjaxResult.error("退料信息和详情新增失败");
|
return AjaxResult.error("退料信息和详情新增失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
int res8 = workSiteDirectManageService.insertBackCheckDetails(backApplyInfo);
|
List<BackApplyInfo> backApplyDetails = backApplyInfo.getBackApplyDetails();
|
||||||
|
if (CollUtil.isEmpty(backApplyDetails)) {
|
||||||
|
return AjaxResult.error("退料详情信息为空");
|
||||||
|
}
|
||||||
|
int res8 = workSiteDirectManageService.insertBackCheckDetails(backApplyDetails);
|
||||||
if (res8 == 0) {
|
if (res8 == 0) {
|
||||||
return AjaxResult.error("新增入库记录失败");
|
return AjaxResult.error("新增入库记录失败");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,12 @@ public class BackApplyInfo extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String backStatus;
|
private String backStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料数量
|
||||||
|
*/
|
||||||
|
private Integer backNum;
|
||||||
|
private Integer directNum;
|
||||||
|
|
||||||
/** 退料单号 */
|
/** 退料单号 */
|
||||||
@Excel(name = "退料单号")
|
@Excel(name = "退料单号")
|
||||||
@ApiModelProperty(value = "退料单号")
|
@ApiModelProperty(value = "退料单号")
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,13 @@ public class LeaseApplyDetails implements Serializable {
|
||||||
@ApiModelProperty(value = "规格ID")
|
@ApiModelProperty(value = "规格ID")
|
||||||
private Integer typeId;
|
private Integer typeId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机具ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "机具Id")
|
||||||
|
private Integer maId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型名称
|
* 类型名称
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,6 @@ import java.util.List;
|
||||||
public interface ApplyInfoMapper {
|
public interface ApplyInfoMapper {
|
||||||
|
|
||||||
int insertSelective(LeaseApplyInfo record);
|
int insertSelective(LeaseApplyInfo record);
|
||||||
|
|
||||||
|
List<LeaseApplyInfo> selectIdByTaskId(Integer id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,14 @@ package com.bonus.sgzb.material.service;
|
||||||
|
|
||||||
import com.bonus.sgzb.material.domain.LeaseApplyInfo;
|
import com.bonus.sgzb.material.domain.LeaseApplyInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:梁超
|
* @Author:梁超
|
||||||
* @date:2024/3/6 - 17:41
|
* @date:2024/3/6 - 17:41
|
||||||
*/
|
*/
|
||||||
public interface ApplyInfoService {
|
public interface ApplyInfoService {
|
||||||
int genderLeaseCode(LeaseApplyInfo record);
|
int genderLeaseCode(LeaseApplyInfo record);
|
||||||
|
|
||||||
|
List<LeaseApplyInfo> selectIdByTaskId(Integer id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public interface WorkSiteDirectManageService {
|
||||||
|
|
||||||
int insertAgreementByBackInfo(BackApplyInfo backApplyInfo);
|
int insertAgreementByBackInfo(BackApplyInfo backApplyInfo);
|
||||||
|
|
||||||
int insertBackCheckDetails(BackApplyInfo backApplyInfo);
|
int insertBackCheckDetails(List<BackApplyInfo> backApplyDetails);
|
||||||
|
|
||||||
DirectApplyInfo getInfoById(String id);
|
DirectApplyInfo getInfoById(String id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:梁超
|
* @Author:梁超
|
||||||
|
|
@ -22,4 +23,9 @@ public class ApplyInfoServiceImpl implements ApplyInfoService {
|
||||||
public int genderLeaseCode(LeaseApplyInfo record) {
|
public int genderLeaseCode(LeaseApplyInfo record) {
|
||||||
return leaseApplyInfoMapper.insertSelective(record);
|
return leaseApplyInfoMapper.insertSelective(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LeaseApplyInfo> selectIdByTaskId(Integer id) {
|
||||||
|
return leaseApplyInfoMapper.selectIdByTaskId(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -323,9 +323,9 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertBackCheckDetails(BackApplyInfo backApplyInfo) {
|
public int insertBackCheckDetails(List<BackApplyInfo> backApplyDetails) {
|
||||||
//插入back_check_details
|
//插入back_check_details
|
||||||
return insertBcd(backApplyInfo);
|
return insertBcd(backApplyDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -336,16 +336,12 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
||||||
return directApplyInfo;
|
return directApplyInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int insertBcd(BackApplyInfo backApplyInfo) {
|
public int insertBcd(List<BackApplyInfo> backApplyDetails) {
|
||||||
int res = 0;
|
int res = 0;
|
||||||
BackApplyInfo[] arr = backApplyInfo.getArr();
|
for (BackApplyInfo backApplyDetail : backApplyDetails) {
|
||||||
if (arr.length > 0) {
|
backApplyDetail.setBackNum(Integer.valueOf(backApplyDetail.getDirectNum()));
|
||||||
for (int i = 0; i < arr.length; i++) {
|
backApplyDetail.setBackStatus("1");
|
||||||
res = backRecordMapper.insertCheckDetails(arr[i]);
|
res = backRecordMapper.insertCheckDetails(backApplyDetail);
|
||||||
int maId = arr[i].getMaId();
|
|
||||||
//退料完成状态改成在库
|
|
||||||
backRecordMapper.updateMaStatus(maId, "15");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,5 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<select id="selectIdByTaskId" resultType="com.bonus.sgzb.material.domain.LeaseApplyInfo">
|
||||||
|
select * from lease_apply_info where task_id = #{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -438,6 +438,7 @@
|
||||||
SELECT
|
SELECT
|
||||||
dad.direct_num AS directNum,
|
dad.direct_num AS directNum,
|
||||||
dad.type_id AS typeId,
|
dad.type_id AS typeId,
|
||||||
|
mt.company_id AS companyId,
|
||||||
mt3.type_name AS typeName,
|
mt3.type_name AS typeName,
|
||||||
mt2.type_name AS kindName,
|
mt2.type_name AS kindName,
|
||||||
mt.type_name AS modelName,
|
mt.type_name AS modelName,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue