Merge branch 'dev' of http://192.168.0.56:3000/bonus/devicesmgt into dev
This commit is contained in:
commit
c45a655aa8
|
|
@ -49,11 +49,15 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
@Resource
|
||||
private BmFlowRelationService bmFlowRelationService;
|
||||
|
||||
// 领料申请表Service
|
||||
/**
|
||||
* 领料申请信息service
|
||||
*/
|
||||
@Resource
|
||||
private LeaseApplyInfoService leaseApplyInfoService;
|
||||
|
||||
// 领料申请明细表Service
|
||||
/**
|
||||
* 领料申请信息明细service
|
||||
*/
|
||||
@Resource
|
||||
private LeaseApplyDetailsService leaseApplyDetailsService;
|
||||
|
||||
|
|
@ -250,14 +254,14 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
// -----------审批流处理结束 -------------
|
||||
|
||||
// 生成领料编码
|
||||
String code = genderLeaseCode();
|
||||
String code = this.genderLeaseCode();
|
||||
if (StringUtils.isEmpty(code)) { return AjaxResult.error("后台生成CODE编号异常,请重试!"); }
|
||||
task.setCode(code);
|
||||
|
||||
// 创建任务
|
||||
if (insertSelective(task) < 1) { return AjaxResult.error("创建领料任务失败,请重试!"); }
|
||||
if (this.insertSelective(task) < 1) { return AjaxResult.error("创建领料任务失败,请重试!"); }
|
||||
//任务与协议建立关联关系
|
||||
if (insertAgreement(task) < 1) { return AjaxResult.error("领料任务与协议建立关联关系失败,请重试!"); }
|
||||
if (this.insertAgreement(task) < 1) { return AjaxResult.error("领料任务与协议建立关联关系失败,请重试!"); }
|
||||
|
||||
// 获取任务编号
|
||||
String taskId = task.getId();
|
||||
|
|
|
|||
|
|
@ -107,105 +107,12 @@ public class WorkSiteDirectManageController extends BaseController {
|
|||
@ApiOperation(value = "通过")
|
||||
@PostMapping("/pass")
|
||||
public AjaxResult pass(@RequestBody DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
// 修改direct_apply_info 状态
|
||||
if (StringUtils.isNotBlank(directApplyInfoDetails.getId())) {
|
||||
DirectApplyInfo directApplyInfos = workSiteDirectManageService.getDirectApplyInfoById(directApplyInfoDetails.getId());
|
||||
directApplyInfos.setStatus("1");
|
||||
workSiteDirectManageService.refuseDirectApplyInfo(directApplyInfos);
|
||||
int rows = workSiteDirectManageService.passDirectApplyInfoDetails(directApplyInfoDetails);
|
||||
if (rows == 1) {
|
||||
return AjaxResult.success("已通过");
|
||||
} else {
|
||||
return AjaxResult.error("直转信息为空,未通过");
|
||||
return AjaxResult.error("未通过");
|
||||
}
|
||||
|
||||
TmTask task = directApplyInfoDetails.getLeaseApplyInfo();
|
||||
if (task == null) {
|
||||
return AjaxResult.error("领料任务参数为空");
|
||||
}
|
||||
// 创建领料任务
|
||||
// 生成领料code
|
||||
String lcode = tmTaskService.genderLeaseCode();
|
||||
if (StringUtils.isEmpty(lcode)) {
|
||||
return AjaxResult.error("领料单号生成失败");
|
||||
}
|
||||
task.setCode(lcode);
|
||||
// 创建领料任务(tm_task)
|
||||
int res1 = workSiteDirectManageService.insertTmTask(task);
|
||||
if (res1 == 0) {
|
||||
return AjaxResult.error("领料任务新建失败");
|
||||
}
|
||||
|
||||
//任务与协议建立关联关系 (tm_task_agreement)
|
||||
int res2 = workSiteDirectManageService.insertAgreement(task);
|
||||
if (res2 == 0) {
|
||||
return AjaxResult.error("协议建立失败");
|
||||
}
|
||||
|
||||
//新增领料信息和详情(lease_apply_info、lease_apply_details)
|
||||
int res3 = workSiteDirectManageService.insertApplyInfoAndDetails(task);
|
||||
if (res3 == 0) {
|
||||
return AjaxResult.error("领料信息和详情新增失败");
|
||||
}
|
||||
|
||||
List<LeaseApplyDetails> leaseApplyDetails = task.getLeaseApplyDetails();
|
||||
if (CollUtil.isEmpty(leaseApplyDetails)) {
|
||||
return AjaxResult.error("领料出库信息为空");
|
||||
}
|
||||
List<LeaseApplyInfo> leaseApplyInfoList = applyInfoService.selectIdByTaskId(Integer.parseInt(task.getId()));
|
||||
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(list);
|
||||
if (res4 == 0) {
|
||||
return AjaxResult.error("新增出库记录失败");
|
||||
}
|
||||
//-----------------------------------------------分割线--------------------------------------------------------
|
||||
//创建退料任务
|
||||
BackApplyInfo backApplyInfo = directApplyInfoDetails.getBackApplyInfo();
|
||||
if (backApplyInfo == null) {
|
||||
return AjaxResult.error("退料任务参数为空");
|
||||
}
|
||||
// 生成退料code
|
||||
String tcode = tmTaskService.genderBackCode();
|
||||
backApplyInfo.setCode(tcode);
|
||||
//创建退料任务(tm_task)
|
||||
backApplyInfo.setTaskType(36);
|
||||
backApplyInfo.setTaskStatus("40");
|
||||
int res5 = workSiteDirectManageService.insertTmTaskByBackInfo(backApplyInfo);
|
||||
if (res5 == 0) {
|
||||
return AjaxResult.error("退料任务新建失败");
|
||||
}
|
||||
//任务与协议建立关联关系 (tm_task_agreement)
|
||||
int res6 = workSiteDirectManageService.insertAgreementByBackInfo(backApplyInfo);
|
||||
if (res6 == 0) {
|
||||
return AjaxResult.error("协议建立失败");
|
||||
}
|
||||
|
||||
//新增领料信息和详情(back_apply_info、back_apply_details)
|
||||
int res7 = workSiteDirectManageService.insertBackApplyInfoAndDetails(backApplyInfo);
|
||||
if (res7 == 0) {
|
||||
return AjaxResult.error("退料信息和详情新增失败");
|
||||
}
|
||||
|
||||
List<BackApplyInfo> backApplyDetails = backApplyInfo.getBackApplyDetails();
|
||||
if (CollUtil.isEmpty(backApplyDetails)) {
|
||||
return AjaxResult.error("退料详情信息为空");
|
||||
}
|
||||
int res8 = workSiteDirectManageService.insertBackCheckDetails(backApplyDetails);
|
||||
if (res8 == 0) {
|
||||
return AjaxResult.error("新增入库记录失败");
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,12 @@ public class BackApplyInfo extends BaseEntity {
|
|||
|
||||
@ApiModelProperty(value="工程id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
private Integer parentId;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:梁超
|
||||
* @date:2024/3/18 - 13:52
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BackCheckDetails extends BaseEntity {
|
||||
private static final long serialVersionUID = 2227217051604273598L;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
private Integer parentId;
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
private Integer typeId;
|
||||
/**
|
||||
* 机具ID
|
||||
*/
|
||||
private Integer maId;
|
||||
/**
|
||||
* 退料数量
|
||||
*/
|
||||
private float backNum;
|
||||
/**
|
||||
* 退料状态(1合格,2维修,3待报废)
|
||||
*/
|
||||
private String backStatus;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 数据所属组织
|
||||
*/
|
||||
private Integer companyId;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -128,4 +128,6 @@ public interface BackApplyMapper {
|
|||
int updateTmTaskBytaskId(BackApplyInfo bean);
|
||||
|
||||
int delApply(BackApplyInfo bean);
|
||||
|
||||
List<BackApplyInfo> selectIdByTaskId(Integer taskId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.BackRecord;
|
||||
import com.bonus.sgzb.material.domain.LeaseRecord;
|
||||
|
|
@ -27,4 +28,14 @@ public interface BackRecordMapper {
|
|||
int insertCheckDetails(BackApplyInfo backApplyInfo);
|
||||
|
||||
int updateMaStatus(@Param("maId") int maId, @Param("maStatus") String maStatus);
|
||||
|
||||
List<BackApplyInfo> getAllList(BackApplyInfo backApplyInfo);
|
||||
|
||||
List<SltAgreementInfo> getStlInfo(BackApplyInfo bean);
|
||||
|
||||
int updateStlInfo(@Param("info") SltAgreementInfo info,@Param("record") BackApplyInfo record);
|
||||
|
||||
int updateStlInfoTwo(@Param("info") SltAgreementInfo info,@Param("record") BackApplyInfo record, @Param("backNum") Double backNum);
|
||||
|
||||
int insStlInfoTwo(@Param("info")SltAgreementInfo info, @Param("many")Double many);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.LeaseRecord;
|
||||
import com.bonus.sgzb.material.domain.TypeTreeNode;
|
||||
|
|
@ -23,4 +26,16 @@ public interface LeaseRecordMapper {
|
|||
* @return List<LeaseRecord>
|
||||
*/
|
||||
List<LeaseRecord> getLeaseRecordList(LeaseRecord bean);
|
||||
|
||||
SltAgreementInfo getSltAgreementInfo(LeaseOutDetails leaseOutDetail);
|
||||
|
||||
int updSltInfo(SltAgreementInfo sltAgreementInfo);
|
||||
|
||||
String getAgreementId(String taskId);
|
||||
|
||||
String getProtocol(String agreementId);
|
||||
|
||||
MaType getMaType(Integer typeId);
|
||||
|
||||
int insSltInfo(@Param("record") LeaseOutDetails record, @Param("agreementId")String agreementId,@Param("ma") MaType ma);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,9 +33,8 @@ public interface WorkSiteDirectManageMapper {
|
|||
|
||||
int refuseDirectApplyInfo(DirectApplyInfo directApplyInfos);
|
||||
|
||||
List<DirectApplyInfo> getList();
|
||||
|
||||
List<DirectApplyInfo> getList(@Param("record") DirectApplyInfo directApplyInfo);
|
||||
List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo);
|
||||
|
||||
DirectApplyInfo getDirectApplyInfoById(String id);
|
||||
|
||||
|
|
@ -62,4 +61,6 @@ public interface WorkSiteDirectManageMapper {
|
|||
DirectApplyInfo getInfoById(String id);
|
||||
|
||||
List<DirectApplyDetails> getDetailById(String id);
|
||||
|
||||
List<DirectApplyInfo> getListAll();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.sgzb.material.service;
|
|||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.LeaseApplyInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -115,4 +116,6 @@ public interface BackApplyService {
|
|||
List<BackApplyInfo> exportList(BackApplyInfo bean);
|
||||
|
||||
int delApply(BackApplyInfo bean);
|
||||
|
||||
List<BackApplyInfo> selectIdByTaskId(Integer taskId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.sgzb.material.service;
|
|||
import com.bonus.sgzb.base.api.domain.*;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.DirectPassApplyInfoDetails;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -19,9 +20,6 @@ public interface WorkSiteDirectManageService {
|
|||
int saveDirectApplyDetails(DirectApplyDetails directApplyInfos);
|
||||
int refuseDirectApplyInfo(DirectApplyInfo directApplyInfos);
|
||||
|
||||
List<DirectApplyInfo> getList();
|
||||
|
||||
|
||||
List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo);
|
||||
|
||||
String genderLeaseCode();
|
||||
|
|
@ -34,7 +32,7 @@ public interface WorkSiteDirectManageService {
|
|||
|
||||
int insertApplyInfoAndDetails(TmTask task);
|
||||
|
||||
int insertLeaseOutDetail(List<LeaseOutDetails> leaseOutDetails);
|
||||
int insertLeaseOutDetail(List<LeaseOutDetails> leaseOutDetails,TmTask task);
|
||||
|
||||
int insertBackApplyInfoAndDetails(BackApplyInfo backApplyInfo);
|
||||
|
||||
|
|
@ -45,4 +43,6 @@ public interface WorkSiteDirectManageService {
|
|||
int insertBackCheckDetails(List<BackApplyInfo> backApplyDetails);
|
||||
|
||||
DirectApplyInfo getInfoById(String id);
|
||||
|
||||
int passDirectApplyInfoDetails(DirectPassApplyInfoDetails directApplyInfoDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,52 +245,55 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
|
||||
@Override
|
||||
public AjaxResult refuse(BackApplyInfo bean) {
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId();
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
int num = 0;
|
||||
if (!StringUtils.isEmpty(bean.getIds())) {
|
||||
String[] ids = bean.getIds().split(",");
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
String id = ids[i];
|
||||
bean.setId(Long.valueOf(id));
|
||||
if (roles.contains("admin")) {
|
||||
bean.setCreateBy(userId.toString());
|
||||
bean.setStatus("2");
|
||||
int re = backApplyMapper.refuse(bean);
|
||||
if (re < 1) {
|
||||
return AjaxResult.error("驳回失败");
|
||||
}
|
||||
}
|
||||
if (roles.contains("jjfgs")) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
bean.setCreateBy(userId.toString());
|
||||
bean.setStatus("2");
|
||||
int re = backApplyMapper.refuse(bean);
|
||||
if (re < 1) {
|
||||
return AjaxResult.error("驳回失败");
|
||||
}
|
||||
}
|
||||
if (roles.contains("tsfgs")) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
bean.setCreateBy(userId.toString());
|
||||
bean.setStatus("4");
|
||||
int re = backApplyMapper.refuse(bean);
|
||||
if (re < 1) {
|
||||
return AjaxResult.error("驳回失败");
|
||||
}
|
||||
}
|
||||
List<Integer> taskIdById = backApplyMapper.getTaskIdById(bean);
|
||||
if (CollUtil.isNotEmpty(taskIdById)) {
|
||||
for (Integer taskId : taskIdById) {
|
||||
if (taskId == 2 || taskId == 4) {
|
||||
num++;
|
||||
if (SecurityUtils.getLoginUser() != null) {
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId();
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
|
||||
int num = 0;
|
||||
if (!StringUtils.isEmpty(bean.getIds())) {
|
||||
String[] ids = bean.getIds().split(",");
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
String id = ids[i];
|
||||
bean.setId(Long.valueOf(id));
|
||||
if (userId == 1) {
|
||||
bean.setCreateBy(userId.toString());
|
||||
bean.setStatus("2");
|
||||
int re = backApplyMapper.refuse(bean);
|
||||
if (re < 1) {
|
||||
return AjaxResult.error("驳回失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num > 0) {
|
||||
bean.setTaskStatus("101");
|
||||
backApplyMapper.updateTmTask(bean);
|
||||
if (roles.contains("jjfgs")) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
bean.setCreateBy(userId.toString());
|
||||
bean.setStatus("2");
|
||||
int re = backApplyMapper.refuse(bean);
|
||||
if (re < 1) {
|
||||
return AjaxResult.error("驳回失败");
|
||||
}
|
||||
}
|
||||
if (roles.contains("tsfgs")) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
bean.setCreateBy(userId.toString());
|
||||
bean.setStatus("4");
|
||||
int re = backApplyMapper.refuse(bean);
|
||||
if (re < 1) {
|
||||
return AjaxResult.error("驳回失败");
|
||||
}
|
||||
}
|
||||
List<Integer> taskIdById = backApplyMapper.getTaskIdById(bean);
|
||||
if (CollUtil.isNotEmpty(taskIdById)) {
|
||||
for (Integer taskId : taskIdById) {
|
||||
if (taskId == 2 || taskId == 4) {
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num > 0) {
|
||||
bean.setTaskStatus("101");
|
||||
backApplyMapper.updateTmTask(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success("驳回成功");
|
||||
|
|
@ -327,4 +330,9 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
return backApplyMapper.delApply(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BackApplyInfo> selectIdByTaskId(Integer taskId) {
|
||||
return backApplyMapper.selectIdByTaskId(taskId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,16 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.sgzb.base.api.domain.DirectApplyDetails;
|
||||
import com.bonus.sgzb.base.api.domain.DirectApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.base.api.domain.*;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.LeaseApplyDetails;
|
||||
import com.bonus.sgzb.material.domain.LeaseApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
import com.bonus.sgzb.material.mapper.BackRecordMapper;
|
||||
import com.bonus.sgzb.material.mapper.LeaseRecordMapper;
|
||||
import com.bonus.sgzb.material.mapper.WorkSiteDirectManageMapper;
|
||||
import com.bonus.sgzb.material.service.BackApplyService;
|
||||
import com.bonus.sgzb.material.service.LeaseRecordService;
|
||||
import com.bonus.sgzb.material.service.TaskService;
|
||||
import com.bonus.sgzb.material.service.WorkSiteDirectManageService;
|
||||
import com.bonus.sgzb.material.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -51,6 +43,11 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
@Autowired
|
||||
private BackRecordMapper backRecordMapper;
|
||||
|
||||
@Resource
|
||||
private ApplyInfoService applyInfoService;
|
||||
@Resource
|
||||
private LeaseRecordMapper leaseRecordMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SltAgreementInfo> getUseringData(String agreementId) {
|
||||
|
|
@ -74,11 +71,6 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
return workSiteDirectManageMapper.refuseDirectApplyInfo(directApplyInfos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectApplyInfo> getList() {
|
||||
return workSiteDirectManageMapper.getList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo) {
|
||||
return workSiteDirectManageMapper.getList(directApplyInfo);
|
||||
|
|
@ -89,7 +81,7 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date date = new Date();
|
||||
String format = simpleDateFormat.format(date);
|
||||
List<DirectApplyInfo> list = workSiteDirectManageMapper.getList();
|
||||
List<DirectApplyInfo> list = workSiteDirectManageMapper.getListAll();
|
||||
int i = list.size() + 1;
|
||||
String code = "ZZ" + format + "-" + list.size() + i;
|
||||
return code;
|
||||
|
|
@ -101,7 +93,6 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertTmTask(TmTask bean) {
|
||||
int res = 0;
|
||||
if (StringUtils.isNull(bean)) {
|
||||
|
|
@ -118,7 +109,6 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertAgreement(TmTask task) {
|
||||
int res = 0;
|
||||
boolean b = tmTaskService.insertAgreement(task) > 0;
|
||||
|
|
@ -129,7 +119,6 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertApplyInfoAndDetails(TmTask task) {
|
||||
int res = 0;
|
||||
if (task.getLeaseApplyInfo() != null) {
|
||||
|
|
@ -191,7 +180,7 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertLeaseOutDetail(List<LeaseOutDetails> leaseOutDetails) {
|
||||
public int insertLeaseOutDetail(List<LeaseOutDetails> leaseOutDetails, TmTask lTask) {
|
||||
int res = 0;
|
||||
String maStatus = "15";
|
||||
double outNum = 0.1;
|
||||
|
|
@ -218,8 +207,10 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
return res;
|
||||
}
|
||||
// 更新 (ma_machine 设备表)的状态
|
||||
int updateMaMachineNum = workSiteDirectManageMapper.updateMaMachineStatus(leaseOutDetail);
|
||||
if (updateMaMachineNum < 1) {
|
||||
workSiteDirectManageMapper.updateMaMachineStatus(leaseOutDetail);
|
||||
|
||||
int insSltInfoNum = insSltInfo(lTask.getAgreementId().toString(), leaseOutDetail);
|
||||
if (insSltInfoNum < 1) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
@ -227,6 +218,11 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
return res;
|
||||
}
|
||||
|
||||
private int insSltInfo(String agreementId, LeaseOutDetails leaseOutDetail) {
|
||||
MaType ma = leaseRecordMapper.getMaType(leaseOutDetail.getTypeId());
|
||||
return leaseRecordMapper.insSltInfo(leaseOutDetail, agreementId, ma);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertBackApplyInfoAndDetails(BackApplyInfo bean) {
|
||||
|
|
@ -239,9 +235,6 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
if (CollUtil.isEmpty(bean.getBackApplyDetails())) {
|
||||
return res;
|
||||
}
|
||||
if (StringUtils.isNull(bean.getBackApplyInfo())) {
|
||||
return res;
|
||||
}
|
||||
|
||||
Integer taskId = bean.getTaskId();
|
||||
// 根据设备所属分公司拆分集合
|
||||
|
|
@ -341,10 +334,283 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
return directApplyInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int passDirectApplyInfoDetails(DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
int res = 0;
|
||||
try {
|
||||
// 修改状态为通过
|
||||
res = updateDirectApplyInfo(directApplyInfoDetails);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("updateDirectApplyInfo异常");
|
||||
}
|
||||
|
||||
//创建领料信息和详情
|
||||
res = createLeaseInfo(directApplyInfoDetails);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("createLeaseInfo异常");
|
||||
}
|
||||
|
||||
//创建退料信息和详情
|
||||
res = createBackInfo(directApplyInfoDetails);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("createBackInfo异常");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int createBackInfo(DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
int res = 0;
|
||||
try {
|
||||
BackApplyInfo backApplyInfo = directApplyInfoDetails.getBackApplyInfo();
|
||||
// 创建退料任务(1、创建tm_task )
|
||||
res = createTmTaskByBackInfo(backApplyInfo);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("createBackTmTask异常");
|
||||
}
|
||||
//2.创建协议tm_task_agreement
|
||||
res = createAgreementByBackInfo(backApplyInfo);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("createBackAgreement异常");
|
||||
}
|
||||
// 3、创建back_apply_info和back_apply_details和出库记录back_check_details和计算结算数据
|
||||
res = createtBackApplyInfoAndDetails(backApplyInfo);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("createBackApplyInfoAndDetails异常");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
private int createtBackApplyInfoAndDetails(BackApplyInfo backApplyInfo) {
|
||||
int res = 0;
|
||||
//新增退料信息和详情(back_apply_info、back_apply_details)
|
||||
res = insertBackApplyInfoAndDetails(backApplyInfo);
|
||||
if (res == 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
List<BackApplyInfo> backApplyDetails = backApplyInfo.getBackApplyDetails();
|
||||
if (CollUtil.isEmpty(backApplyDetails)) {
|
||||
return res;
|
||||
}
|
||||
//新增退料核查(back_check_details)
|
||||
Integer taskId = backApplyInfo.getTaskId();
|
||||
List<BackApplyInfo> backApplyInfoList = backApplyService.selectIdByTaskId(taskId);
|
||||
List<BackApplyInfo> list = new ArrayList();
|
||||
for (BackApplyInfo backApplyInfo1 : backApplyDetails) {
|
||||
BackApplyInfo backCheckDetails = new BackApplyInfo();
|
||||
for (BackApplyInfo backApplyInfo2 : backApplyInfoList) {
|
||||
if (backApplyInfo1.getCompanyId().equals(backApplyInfo2.getCompanyId())) {
|
||||
backCheckDetails.setParentId(backApplyInfo1.getId().intValue());
|
||||
backCheckDetails.setTypeId(backApplyInfo1.getTypeId());
|
||||
backCheckDetails.setMaId(backApplyInfo1.getMaId());
|
||||
backCheckDetails.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
backCheckDetails.setBackNum(backApplyInfo1.getDirectNum());
|
||||
}
|
||||
}
|
||||
list.add(backCheckDetails);
|
||||
}
|
||||
res = insertBackCheckDetails(list);
|
||||
if (res == 0) {
|
||||
return res;
|
||||
}
|
||||
for (BackApplyInfo applyInfo : list) {
|
||||
List<BackApplyInfo> allList = backRecordMapper.getAllList(applyInfo);
|
||||
if (allList != null && allList.size() > 0) {
|
||||
res = updateSlt(applyInfo, allList);
|
||||
if (res == 0) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int updateSlt(BackApplyInfo record, List<BackApplyInfo> hgList) {
|
||||
for (BackApplyInfo bean : hgList) {
|
||||
List<SltAgreementInfo> infoList = backRecordMapper.getStlInfo(bean);
|
||||
if (infoList.size() > 0) {
|
||||
Double backNum = Double.valueOf(bean.getBackNum());
|
||||
for (SltAgreementInfo info : infoList) {
|
||||
Double num = Double.valueOf(info.getNum());
|
||||
if (backNum.equals(num)) {
|
||||
backRecordMapper.updateStlInfo(info, record);
|
||||
break;
|
||||
} else if (backNum > num) {
|
||||
backNum = backNum - num;
|
||||
backRecordMapper.updateStlInfo(info, record);
|
||||
} else if (backNum < num) {
|
||||
Double many = num - backNum;
|
||||
backRecordMapper.updateStlInfoTwo(info, record, backNum);
|
||||
backRecordMapper.insStlInfoTwo(info, many);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
private int createAgreementByBackInfo(BackApplyInfo backApplyInfo) {
|
||||
int res = 0;
|
||||
res = insertAgreementByBackInfo(backApplyInfo);
|
||||
if (res == 0) {
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int createTmTaskByBackInfo(BackApplyInfo backApplyInfo) {
|
||||
int res = 0;
|
||||
if (backApplyInfo == null) {
|
||||
return res;
|
||||
}
|
||||
// 生成退料code
|
||||
String tcode = tmTaskService.genderBackCode();
|
||||
backApplyInfo.setCode(tcode);
|
||||
//创建退料任务(tm_task)
|
||||
backApplyInfo.setTaskType(36);
|
||||
backApplyInfo.setTaskStatus("40");
|
||||
res = insertTmTaskByBackInfo(backApplyInfo);
|
||||
if (res == 0) {
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int createLeaseInfo(DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
int res = 0;
|
||||
try {
|
||||
TmTask lTask = directApplyInfoDetails.getLeaseApplyInfo();
|
||||
// 创建领料任务(1、创建tm_task )
|
||||
int leaseTaskId = createTmTask(lTask, "1");
|
||||
if (leaseTaskId == 0) {
|
||||
throw new RuntimeException("createLeaseTmTask异常");
|
||||
}
|
||||
//2.创建协议tm_task_agreement
|
||||
lTask.setId(leaseTaskId + "");
|
||||
res = createAgreementInfo(lTask);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("createAgreementInfo异常");
|
||||
}
|
||||
// 3、创建lease_apply_info和lease_apply_details和出库记录lease_out_details
|
||||
res = createLeaseDetails(lTask);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("createLeaseDetails异常");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
private int createLeaseDetails(TmTask lTask) {
|
||||
int res = 0;
|
||||
//新增领料信息和详情(lease_apply_info、lease_apply_details)
|
||||
int res3 = insertApplyInfoAndDetails(lTask);
|
||||
if (res3 == 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
List<LeaseApplyDetails> leaseApplyDetails = lTask.getLeaseApplyDetails();
|
||||
if (CollUtil.isEmpty(leaseApplyDetails)) {
|
||||
return res;
|
||||
}
|
||||
List<LeaseApplyInfo> leaseApplyInfoList = applyInfoService.selectIdByTaskId(Integer.parseInt(lTask.getId()));
|
||||
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);
|
||||
}
|
||||
// 新增领料出库记录
|
||||
res = insertLeaseOutDetail(list, lTask);
|
||||
if (res == 0) {
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
private int createAgreementInfo(TmTask task) {
|
||||
//任务与协议建立关联关系 (tm_task_agreement)
|
||||
int res = 0;
|
||||
try {
|
||||
res = insertAgreement(task);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("insertAgreement异常");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int createTmTask(TmTask task, String taskType) {
|
||||
int taskId = 0;
|
||||
int res = 0;
|
||||
try {
|
||||
if ("1".equals(taskType)) {
|
||||
// 生成领料code
|
||||
String lcode = tmTaskService.genderLeaseCode();
|
||||
if (StringUtils.isEmpty(lcode)) {
|
||||
return res;
|
||||
}
|
||||
task.setCode(lcode);
|
||||
// 创建领料任务(tm_task)
|
||||
res = insertTmTask(task);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("insertTmTask异常");
|
||||
}
|
||||
taskId = Integer.valueOf(task.getId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return taskId;
|
||||
|
||||
}
|
||||
|
||||
private int updateDirectApplyInfo(DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
int res = 0;
|
||||
if (StringUtils.isNotBlank(directApplyInfoDetails.getId())) {
|
||||
DirectApplyInfo directApplyInfos = getDirectApplyInfoById(directApplyInfoDetails.getId());
|
||||
directApplyInfos.setStatus("1");
|
||||
directApplyInfos.setAuditor(SecurityUtils.getLoginUser().getUsername());
|
||||
directApplyInfos.setAuditTime(new Date().toString());
|
||||
res = refuseDirectApplyInfo(directApplyInfos);
|
||||
} else {
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public int insertBcd(List<BackApplyInfo> backApplyDetails) {
|
||||
int res = 0;
|
||||
for (BackApplyInfo backApplyDetail : backApplyDetails) {
|
||||
backApplyDetail.setBackNum(Integer.valueOf(backApplyDetail.getDirectNum()));
|
||||
backApplyDetail.setBackStatus("1");
|
||||
res = backRecordMapper.insertCheckDetails(backApplyDetail);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -787,5 +787,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP BY bai.task_id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
|
||||
ORDER BY bai.create_time desc
|
||||
</select>
|
||||
<select id="selectIdByTaskId" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
select * from back_apply_info where task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -68,11 +68,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
NOW()
|
||||
)
|
||||
</insert>
|
||||
<insert id="insStlInfoTwo">
|
||||
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id)
|
||||
values (#{info.agreementId},#{info.typeId},#{info.maId},#{many},#{info.startTime},#{info.status},#{info.leaseId},#{info.leasePrice},#{info.buyPrice},'0',#{info.companyId});
|
||||
</insert>
|
||||
<update id="updateMaStatus">
|
||||
update ma_machine
|
||||
set ma_status=#{maStatus}
|
||||
where ma_id = #{maId}
|
||||
</update>
|
||||
<update id="updateStlInfo">
|
||||
update slt_agreement_info
|
||||
set end_time = now(),
|
||||
back_id = #{record.parentId},
|
||||
status = '1'
|
||||
where id = #{info.id}
|
||||
</update>
|
||||
<update id="updateStlInfoTwo">
|
||||
update slt_agreement_info
|
||||
set num = #{backNum},
|
||||
end_time = now(),
|
||||
back_id = #{record.parentId},
|
||||
status = '1'
|
||||
where id = #{info.id}
|
||||
</update>
|
||||
|
||||
<select id="getBackRecordList" resultType="com.bonus.sgzb.material.domain.BackRecord">
|
||||
SELECT
|
||||
|
|
@ -121,4 +140,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and bai.agreement_code like concat('%',#{agreementCode},'%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getAllList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
SELECT
|
||||
tta.agreement_id AS agreementId,
|
||||
bai.id,
|
||||
bai.task_id AS taskId,
|
||||
bcd.type_id AS typeId,
|
||||
SUM(bcd.back_num) AS backNum,
|
||||
bcd.parent_id AS parentId,
|
||||
bcd.create_by AS createBy,
|
||||
bcd.ma_id AS maId,
|
||||
bai.company_id AS companyId
|
||||
FROM
|
||||
back_check_details bcd
|
||||
LEFT JOIN back_apply_info bai ON bai.id = bcd.parent_id
|
||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
|
||||
WHERE
|
||||
parent_id = #{parentId}
|
||||
GROUP BY bcd.type_id,bcd.ma_id
|
||||
</select>
|
||||
<select id="getStlInfo" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
|
||||
SELECT
|
||||
id,
|
||||
agreement_id AS agreementId,
|
||||
type_id AS typeId,
|
||||
ma_id AS maId,
|
||||
num AS num,
|
||||
start_time AS startTime,
|
||||
end_time AS endTime,
|
||||
status AS status,
|
||||
lease_id AS leaseId,
|
||||
back_id AS backId,
|
||||
lease_price AS leasePrice,
|
||||
buy_price AS buyPrice,
|
||||
company_id AS companyId
|
||||
FROM
|
||||
slt_agreement_info
|
||||
WHERE
|
||||
agreement_id = #{agreementId}
|
||||
AND
|
||||
type_id = #{typeId}
|
||||
<if test="maId != null">
|
||||
AND ma_id = #{maId}
|
||||
</if>
|
||||
order by start_time asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -3,6 +3,15 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.material.mapper.LeaseRecordMapper">
|
||||
<insert id="insSltInfo">
|
||||
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id)
|
||||
values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},now(),0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},'0',#{record.companyId});
|
||||
</insert>
|
||||
<update id="updSltInfo">
|
||||
update slt_agreement_info
|
||||
set num = #{num}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getLeaseRecordList" resultType="com.bonus.sgzb.material.domain.LeaseRecord">
|
||||
SELECT mt2.type_name as typeName,
|
||||
|
|
@ -48,5 +57,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getSltAgreementInfo" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
|
||||
SELECT
|
||||
id,
|
||||
agreement_id AS agreementId,
|
||||
type_id AS typeId,
|
||||
ma_id AS maId,
|
||||
num AS num,
|
||||
start_time AS startTime,
|
||||
end_time AS endTime,
|
||||
status AS status,
|
||||
lease_id AS leaseId,
|
||||
back_id AS backId,
|
||||
lease_price AS leasePrice,
|
||||
buy_price AS buyPrice,
|
||||
company_id AS companyId
|
||||
FROM
|
||||
slt_agreement_info
|
||||
WHERE
|
||||
lease_id = #{parentId}
|
||||
AND
|
||||
type_id = #{typeId}
|
||||
AND
|
||||
ma_id IS NULL
|
||||
AND
|
||||
DATE(start_time) = CURDATE();
|
||||
</select>
|
||||
<select id="getAgreementId" resultType="java.lang.String">
|
||||
select agreement_id
|
||||
from tm_task_agreement
|
||||
where task_id = #{taskId}
|
||||
</select>
|
||||
<select id="getProtocol" resultType="java.lang.String">
|
||||
select protocol
|
||||
from bm_agreement_info
|
||||
where agreement_id = #{agreementId}
|
||||
</select>
|
||||
<select id="getMaType" resultType="com.bonus.sgzb.base.api.domain.MaType">
|
||||
select lease_price as leasePrice,
|
||||
rent_price as rentPrice,
|
||||
buy_price as buyPrice,
|
||||
pay_price as payPrice,
|
||||
company_id as companyId
|
||||
from ma_type
|
||||
where type_id = #{typeId} and del_flag = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -311,7 +311,7 @@
|
|||
)
|
||||
</insert>
|
||||
<update id="refuseDirectApplyInfo">
|
||||
update direct_apply_info set status = #{status} where id = #{id}
|
||||
update direct_apply_info set status = #{status},auditor=#{auditor},audit_time=#{auditTime} where id = #{id}
|
||||
</update>
|
||||
<update id="updateLeaseApplyDetailsOutNum">
|
||||
UPDATE
|
||||
|
|
@ -392,23 +392,23 @@
|
|||
LEFT JOIN bm_unit_info bui1 ON bui1.unit_id = bai1.unit_id
|
||||
WHERE
|
||||
1=1
|
||||
<if test="record.keyWord != null and record.keyWord != ''">
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (bpl.lot_name like concat('%', #{keyWord}, '%') or
|
||||
bui.unit_name like concat('%', #{keyWord}, '%'))
|
||||
</if>
|
||||
<if test="record.lotId != null and record.lotId != ''">
|
||||
and bpl.lot_id = #{record.lotId}
|
||||
<if test="lotId != null and lotId != ''">
|
||||
and bpl.lot_id = #{lotId}
|
||||
</if>
|
||||
<if test="record.unitId != null and record.unitId != ''">
|
||||
and bui.unitId = #{record.unitId}
|
||||
<if test="unitId != null and unitId != ''">
|
||||
and bui.unitId = #{unitId}
|
||||
</if>
|
||||
<if test="record.backMan != null and record.backMan != ''">
|
||||
<if test="backMan != null and backMan != ''">
|
||||
and dai.back_man like concat('%', #{backMan}, '%')
|
||||
</if>
|
||||
<if test="record.backPhone != null and record.backPhone != ''">
|
||||
<if test="backPhone != null and backPhone != ''">
|
||||
and dai.back_phone like concat('%', #{backPhone}, '%')
|
||||
</if>
|
||||
<if test="record.status != null and record.status != ''">
|
||||
<if test="status != null and status != ''">
|
||||
and dai.status = #{status}
|
||||
</if>
|
||||
</select>
|
||||
|
|
@ -465,7 +465,8 @@
|
|||
mt.type_name AS modelName,
|
||||
mt.unit_name AS unitName,
|
||||
sum( sai.num ) AS useNum,
|
||||
mm.ma_code AS maCode
|
||||
mm.ma_code AS maCode,
|
||||
mm.ma_id AS maId
|
||||
FROM
|
||||
direct_apply_info dai
|
||||
LEFT JOIN direct_apply_details dad ON dai.id = dad.direct_id
|
||||
|
|
@ -481,4 +482,24 @@
|
|||
GROUP BY
|
||||
dad.id,sai.ma_id,sai.type_id
|
||||
</select>
|
||||
<select id="getListAll" resultType="com.bonus.sgzb.base.api.domain.DirectApplyInfo">
|
||||
SELECT
|
||||
dai.*,
|
||||
bpl.lot_id AS backProId,
|
||||
bpl.lot_name AS backProName,
|
||||
bui.unit_id AS backUnitId,
|
||||
bui.unit_name AS backUnitName,
|
||||
bpl1.lot_id AS leaseProId,
|
||||
bpl1.lot_name AS leaseProName,
|
||||
bui1.unit_id AS leaseUnitId,
|
||||
bui1.unit_name AS leaseUnitName
|
||||
FROM
|
||||
direct_apply_info dai
|
||||
LEFT JOIN bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_agreement_info bai1 ON dai.lease_agreement_id = bai1.agreement_id
|
||||
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
|
||||
LEFT JOIN bm_project_lot bpl1 ON bpl1.lot_id = bai1.project_id
|
||||
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
|
||||
LEFT JOIN bm_unit_info bui1 ON bui1.unit_id = bai1.unit_id
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue