退料申请表数据问题修改
This commit is contained in:
parent
85aecf7f66
commit
99ff64473d
|
|
@ -15,6 +15,7 @@ import com.bonus.sgzb.common.core.web.controller.BaseController;
|
|||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -51,6 +52,7 @@ public class BackApplyController extends BaseController {
|
|||
@PostMapping("getbackList")
|
||||
public AjaxResult getbackList(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
record.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
List<BackApplyInfo> list = backApplyService.getbackList(record);
|
||||
return success(list);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -6,10 +6,12 @@ import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
|||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.app.mapper.BackApplyAppMapper;
|
||||
import com.bonus.sgzb.app.service.BackApplyService;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -80,14 +82,31 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
@Override
|
||||
public List<BackApplyInfo> examineList(BackApplyInfo record) {
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
if (roles.contains("admin")) {
|
||||
//管理员可以看到所有退料申请
|
||||
return backApplyMapper.examineList(record);
|
||||
}
|
||||
//个人只能看到自己的申请的退料
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
record.setCreateBy(username);
|
||||
return backApplyMapper.examineListByUser(record);
|
||||
List<BackApplyInfo> backApplyInfos = backApplyMapper.examineList(record);
|
||||
List<BackApplyInfo> backApplyInfoList = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(backApplyInfos)) {
|
||||
if (roles.contains("jjfgs")) {
|
||||
for (BackApplyInfo backApplyInfo : backApplyInfos) {
|
||||
if (StringUtils.hasText(backApplyInfo.getCompanyId()) && backApplyInfo.getCompanyId().contains(String.valueOf(companyId))) {
|
||||
backApplyInfoList.add(backApplyInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (roles.contains("tsfgs")) {
|
||||
for (BackApplyInfo backApplyInfo : backApplyInfos) {
|
||||
if (StringUtils.hasText(backApplyInfo.getCompanyId()) && backApplyInfo.getCompanyId().contains(String.valueOf(companyId))) {
|
||||
backApplyInfoList.add(backApplyInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return backApplyInfoList;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -409,6 +409,7 @@
|
|||
LEFT JOIN sys_user us on us.user_id=bai.create_by
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id=bad.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id=mt1.parent_id
|
||||
WHERE tt.create_by = #{createBy}
|
||||
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
|
||||
ORDER BY bai.create_time desc
|
||||
</select>
|
||||
|
|
@ -490,6 +491,7 @@
|
|||
bai.back_time as backTime,
|
||||
bagi.plan_start_time as planStartTime,
|
||||
tt.task_status as taskStatus,
|
||||
GROUP_CONCAT(bai.company_id) as companyId,
|
||||
GROUP_CONCAT(DISTINCT bad.type_id) as typeId,
|
||||
GROUP_CONCAT(CONCAT_WS('/', IFNULL(mt2.type_name, ''))) AS typeName,
|
||||
SUM(DISTINCT bad.pre_num) AS num,
|
||||
|
|
|
|||
|
|
@ -9,8 +9,11 @@ import com.bonus.sgzb.common.core.utils.StringUtils;
|
|||
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.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
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.TaskService;
|
||||
|
|
@ -108,7 +111,7 @@ public class WorkSiteDirectManageController extends BaseController {
|
|||
|
||||
@ApiOperation(value = "通过")
|
||||
@PostMapping("/pass")
|
||||
public AjaxResult pass(@RequestBody DirectApplyInfoDetails directApplyInfoDetails) {
|
||||
public AjaxResult pass(@RequestBody DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
// 修改direct_apply_info 状态
|
||||
if (StringUtils.isNotBlank(directApplyInfoDetails.getDirectApplyInfoId())) {
|
||||
DirectApplyInfo directApplyInfos = workSiteDirectManageService.getDirectApplyInfoById(directApplyInfoDetails.getDirectApplyInfoId());
|
||||
|
|
@ -120,7 +123,7 @@ public class WorkSiteDirectManageController extends BaseController {
|
|||
|
||||
TmTask task = directApplyInfoDetails.getTask();
|
||||
if (task == null) {
|
||||
return AjaxResult.error("任务参数为空");
|
||||
return AjaxResult.error("领料任务参数为空");
|
||||
}
|
||||
// 创建领料任务
|
||||
// 生成领料code
|
||||
|
|
@ -157,31 +160,38 @@ public class WorkSiteDirectManageController extends BaseController {
|
|||
return AjaxResult.error("新增出库记录失败");
|
||||
}
|
||||
|
||||
|
||||
//创建退料任务
|
||||
BackApplyInfo backApplyInfo = directApplyInfoDetails.getBackApplyInfo();
|
||||
if (backApplyInfo == null){
|
||||
return AjaxResult.error("退料任务参数为空");
|
||||
}
|
||||
// 生成退料code
|
||||
String tcode = tmTaskService.genderBackCode();
|
||||
task.setCode(tcode);
|
||||
backApplyInfo.setCode(tcode);
|
||||
//创建退料任务(tm_task)
|
||||
int res5 = workSiteDirectManageService.insertTmTask(task);
|
||||
backApplyInfo.setTaskType(36);
|
||||
backApplyInfo.setTaskStatus("37");
|
||||
int res5 = workSiteDirectManageService.insertTmTaskByBackInfo(backApplyInfo);
|
||||
if (res5 == 0) {
|
||||
return AjaxResult.error("退料任务新建失败");
|
||||
}
|
||||
//任务与协议建立关联关系 (tm_task_agreement)
|
||||
int res6 = workSiteDirectManageService.insertAgreement(task);
|
||||
int res6 = workSiteDirectManageService.insertAgreementByBackInfo(backApplyInfo);
|
||||
if (res6 == 0) {
|
||||
return AjaxResult.error("协议建立失败");
|
||||
}
|
||||
|
||||
//新增领料信息和详情(back_apply_info、back_apply_details)
|
||||
int res7 = workSiteDirectManageService.insertBackApplyInfoAndDetails(task);
|
||||
int res7 = workSiteDirectManageService.insertBackApplyInfoAndDetails(backApplyInfo);
|
||||
if (res7 == 0) {
|
||||
return AjaxResult.error("退料信息和详情新增失败");
|
||||
}
|
||||
|
||||
workSiteDirectManageService.insertBackCheckDetails(backApplyInfo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 不通过
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -42,6 +42,15 @@ public class BackApplyInfo extends BaseEntity {
|
|||
|
||||
private int flag;
|
||||
|
||||
private BackApplyInfo[] arr;
|
||||
|
||||
private Integer maId;
|
||||
|
||||
/**
|
||||
* 退料状态
|
||||
*/
|
||||
private String backStatus;
|
||||
|
||||
/** 退料单号 */
|
||||
@Excel(name = "退料单号")
|
||||
@ApiModelProperty(value = "退料单号")
|
||||
|
|
|
|||
|
|
@ -15,13 +15,7 @@ import java.util.List;
|
|||
@Data
|
||||
public class DirectApplyInfoDetails extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String directApplyInfoId;
|
||||
private DirectApplyInfo directApplyInfo;
|
||||
|
||||
private List<DirectApplyDetails> directApplyInfoDetails;
|
||||
|
||||
private TmTask task;
|
||||
|
||||
private LeaseOutDetails leaseOutDetails;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
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.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:梁超
|
||||
* @date:2024/3/4 - 16:10
|
||||
*/
|
||||
@Data
|
||||
public class DirectPassApplyInfoDetails extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String directApplyInfoId;
|
||||
|
||||
private TmTask task;
|
||||
|
||||
private BackApplyInfo backApplyInfo;
|
||||
|
||||
private LeaseOutDetails leaseOutDetails;
|
||||
}
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.BackRecord;
|
||||
import com.bonus.sgzb.material.domain.LeaseRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -20,4 +22,10 @@ public interface BackRecordMapper {
|
|||
* @return List<BackRecord>
|
||||
*/
|
||||
List<BackRecord> getBackRecordList(BackRecord bean);
|
||||
|
||||
int insertBcd(BackApplyInfo backApplyInfo);
|
||||
|
||||
int insertCheckDetails(BackApplyInfo backApplyInfo);
|
||||
|
||||
int updateMaStatus(@Param("maId") int maId, @Param("maStatus") String maStatus);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -72,7 +73,11 @@ public interface TaskMapper {
|
|||
*/
|
||||
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||
|
||||
int insertSelective(TmTask task);
|
||||
int insertSelective(TmTask bean);
|
||||
|
||||
int insertAgreement(TmTask task);
|
||||
|
||||
int insertTmTaskByBackInfo(BackApplyInfo backApplyInfo);
|
||||
|
||||
int insertAgreementByBackInfo(BackApplyInfo backApplyInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.sgzb.material.mapper;
|
|||
import com.bonus.sgzb.base.api.domain.*;
|
||||
import com.bonus.sgzb.material.domain.LeaseApplyDetails;
|
||||
import com.bonus.sgzb.material.domain.LeaseApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -53,4 +54,6 @@ public interface WorkSiteDirectManageMapper {
|
|||
int updateMaTypeStockNum(@Param("record")LeaseOutDetails leaseOutDetails);
|
||||
|
||||
int updateMaMachineStatus(@Param("record")LeaseOutDetails leaseOutDetails);
|
||||
|
||||
int insertBackApplyInfo(TmTask task);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.material.service;
|
||||
|
||||
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -63,9 +64,13 @@ public interface TaskService
|
|||
|
||||
String genderLeaseCode();
|
||||
|
||||
int insertSelective(TmTask task);
|
||||
int insertSelective(TmTask bean);
|
||||
|
||||
int insertAgreement(TmTask task);
|
||||
|
||||
String genderBackCode();
|
||||
|
||||
int insertTmTaskByBackInfo(BackApplyInfo backApplyInfo);
|
||||
|
||||
int insertAgreementByBackInfo(BackApplyInfo backApplyInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,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.TmTask;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -24,7 +25,7 @@ public interface WorkSiteDirectManageService {
|
|||
|
||||
DirectApplyInfo getDirectApplyInfoById(String directApplyInfoDetails);
|
||||
|
||||
int insertTmTask(TmTask task);
|
||||
int insertTmTask(TmTask bean);
|
||||
|
||||
int insertAgreement(TmTask task);
|
||||
|
||||
|
|
@ -32,5 +33,11 @@ public interface WorkSiteDirectManageService {
|
|||
|
||||
int insertLeaseOutDetail(LeaseOutDetails leaseOutDetails);
|
||||
|
||||
int insertBackApplyInfoAndDetails(TmTask task);
|
||||
int insertBackApplyInfoAndDetails(BackApplyInfo backApplyInfo);
|
||||
|
||||
int insertTmTaskByBackInfo(BackApplyInfo backApplyInfo);
|
||||
|
||||
int insertAgreementByBackInfo(BackApplyInfo backApplyInfo);
|
||||
|
||||
int insertBackCheckDetails(BackApplyInfo backApplyInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -118,8 +119,8 @@ public class TaskServiceImpl implements TaskService
|
|||
}
|
||||
|
||||
@Override
|
||||
public int insertSelective(TmTask task) {
|
||||
return tmTaskMapper.insertSelective(task);
|
||||
public int insertSelective(TmTask bean) {
|
||||
return tmTaskMapper.insertSelective(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -143,4 +144,14 @@ public class TaskServiceImpl implements TaskService
|
|||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertTmTaskByBackInfo(BackApplyInfo backApplyInfo) {
|
||||
return tmTaskMapper.insertTmTaskByBackInfo(backApplyInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertAgreementByBackInfo(BackApplyInfo backApplyInfo) {
|
||||
return tmTaskMapper.insertAgreementByBackInfo(backApplyInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ 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.mapper.BackRecordMapper;
|
||||
import com.bonus.sgzb.material.mapper.WorkSiteDirectManageMapper;
|
||||
import com.bonus.sgzb.material.service.BackApplyService;
|
||||
import com.bonus.sgzb.material.service.TaskService;
|
||||
import com.bonus.sgzb.material.service.WorkSiteDirectManageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -42,6 +44,12 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
@Resource
|
||||
private TaskService tmTaskService;
|
||||
|
||||
@Autowired
|
||||
private BackApplyService backApplyService;
|
||||
|
||||
@Autowired
|
||||
private BackRecordMapper backRecordMapper;
|
||||
|
||||
@Override
|
||||
public List<SltAgreementInfo> getUseringData(String agreementId) {
|
||||
return workSiteDirectManageMapper.getUseringData(agreementId);
|
||||
|
|
@ -86,14 +94,14 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
public int insertTmTask(TmTask task) {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertTmTask(TmTask bean) {
|
||||
int res = 0;
|
||||
if (StringUtils.isNull(task)) {
|
||||
if (StringUtils.isNull(bean)) {
|
||||
return res;
|
||||
}
|
||||
// 创建任务
|
||||
int i = tmTaskService.insertSelective(task);
|
||||
int i = tmTaskService.insertSelective(bean);
|
||||
if (i < 1) {
|
||||
return res;
|
||||
} else {
|
||||
|
|
@ -103,7 +111,7 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertAgreement(TmTask task) {
|
||||
int res = 0;
|
||||
boolean b = tmTaskService.insertAgreement(task) > 0;
|
||||
|
|
@ -114,7 +122,7 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertApplyInfoAndDetails(TmTask task) {
|
||||
int res = 0;
|
||||
if (task.getLeaseApplyInfo() != null) {
|
||||
|
|
@ -218,24 +226,18 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertBackApplyInfoAndDetails(TmTask task) {
|
||||
/* boolean addLeaseTaskResult = false;
|
||||
public int insertBackApplyInfoAndDetails(BackApplyInfo bean) {
|
||||
int res = 0;
|
||||
boolean addLeaseTaskResult = false;
|
||||
Long backApplyInfoId = 0L;
|
||||
|
||||
try {
|
||||
task.setTaskType(36);
|
||||
task.setTaskStatus(37);
|
||||
// 创建任务
|
||||
boolean addTaskResult = workSiteDirectManageMapper.insertSelective(task) > 0;
|
||||
if (addTaskResult && bean.getTaskId() != null) {
|
||||
//任务协议表(tm_task_agreement)
|
||||
Boolean addTaskAgreementRes = backApplyService.insertTaskAgreement(bean) > 0;
|
||||
if (addTaskAgreementRes && bean.getBackApplyInfo() != null) {
|
||||
if (bean.getTaskId() != null) {
|
||||
if (bean.getBackApplyInfo() != null) {
|
||||
if (CollUtil.isEmpty(bean.getBackApplyDetails())) {
|
||||
return AjaxResult.error("退料设备明细为空,请重新选择后上传!");
|
||||
return res;
|
||||
}
|
||||
if (StringUtils.isNull(bean.getBackApplyInfo())) {
|
||||
return AjaxResult.error("退料任务信息为空,请重新选择后上传!");
|
||||
return res;
|
||||
}
|
||||
|
||||
Integer taskId = bean.getTaskId();
|
||||
|
|
@ -248,11 +250,11 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
BackApplyInfo backApplyInfo1 = leaseApplyDetailsList.get(0);
|
||||
// 对领料任务表的对象做数据处理
|
||||
BackApplyInfo backApplyInfo = bean.getBackApplyInfo();
|
||||
*//* 创建领料单号*//*
|
||||
backApplyInfo.setCode(code);
|
||||
*//*设置任务ID*//*
|
||||
// 创建领料单号
|
||||
backApplyInfo.setCode(bean.getCode());
|
||||
// 设置任务ID
|
||||
backApplyInfo.setTaskId(taskId);
|
||||
*//*设置设备所属分公司,用于交给哪家审核*//*
|
||||
// 设置设备所属分公司,用于交给哪家审核
|
||||
backApplyInfo.setCompanyId(backApplyInfo1.getCompanyId());
|
||||
// 创建领料任务,返回领料任务编号
|
||||
addLeaseTaskResult = backApplyService.insertBackApply(backApplyInfo) > 0;
|
||||
|
|
@ -263,35 +265,85 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
if (addLeaseTaskResult) {
|
||||
if (StringUtils.isNotNull(backApplyInfoId)) {
|
||||
for (BackApplyInfo leaseApplyDetails : leaseApplyDetailsList) {
|
||||
*//* 设置领料任务ID*//*
|
||||
//设置领料任务ID
|
||||
leaseApplyDetails.setId(backApplyInfoId);
|
||||
// 插入领料任务明细
|
||||
boolean addLeaseTaskDetailsResult = backApplyService.upload(leaseApplyDetails) > 0;
|
||||
if (!addLeaseTaskDetailsResult) {
|
||||
return AjaxResult.error("退料任务创建成功,但退料任务明细插入失败");
|
||||
log.info("退料任务创建成功,但退料任务明细插入失败");
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return AjaxResult.error("退料任务编号为空");
|
||||
log.info("退料任务编号为空");
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("创建退料任务失败,或退料明细为空");
|
||||
log.info("创建退料任务失败,或退料明细为空");
|
||||
return res;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("创建任务失败,缺少数据");
|
||||
log.info("创建任务失败,缺少数据");
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("创建任务失败");
|
||||
log.info("创建任务失败");
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("创建任务失败");
|
||||
log.info("创建任务失败");
|
||||
return res;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("创建任务失败," + e.getCause().toString() + "," + e.getMessage());
|
||||
log.info("创建任务失败");
|
||||
return res;
|
||||
}
|
||||
return AjaxResult.success("退料任务创建成功");*/
|
||||
return 1;
|
||||
res = 1;
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertTmTaskByBackInfo(BackApplyInfo backApplyInfo) {
|
||||
int res = 0;
|
||||
if (StringUtils.isNull(backApplyInfo)) {
|
||||
return res;
|
||||
}
|
||||
// 创建任务
|
||||
int i = tmTaskService.insertTmTaskByBackInfo(backApplyInfo);
|
||||
if (i < 1) {
|
||||
return res;
|
||||
} else {
|
||||
res = 1;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertAgreementByBackInfo(BackApplyInfo backApplyInfo) {
|
||||
return tmTaskService.insertAgreementByBackInfo(backApplyInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertBackCheckDetails(BackApplyInfo backApplyInfo) {
|
||||
//插入back_check_details
|
||||
return this.insertBcd(backApplyInfo);
|
||||
}
|
||||
public int insertBcd(BackApplyInfo backApplyInfo) {
|
||||
int res =0;
|
||||
BackApplyInfo[] arr = backApplyInfo.getArr();
|
||||
if(arr.length>0){
|
||||
for(int i=0 ; i< arr.length;i++){
|
||||
res = backRecordMapper.insertCheckDetails(arr[i]);
|
||||
String backStatus = arr[i].getBackStatus();
|
||||
int maId = arr[i].getMaId();
|
||||
//退料合格状态变为退料带入库84
|
||||
backRecordMapper.updateMaStatus(maId,"84");
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,79 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.material.mapper.BackRecordMapper">
|
||||
<insert id="insertBcd">
|
||||
|
||||
</insert>
|
||||
<insert id="insertCheckDetails">
|
||||
insert into back_check_details
|
||||
(
|
||||
<if test="parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
ma_id,
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
back_num,
|
||||
</if>
|
||||
<if test="backStatus != null">
|
||||
back_status,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
update_time,
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
<if test="parentId != null">
|
||||
#{parentId},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
#{maId},
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
#{backNum},
|
||||
</if>
|
||||
<if test="backStatus != null">
|
||||
#{backStatus},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
NOW(),
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
<update id="updateMaStatus">
|
||||
update ma_machine
|
||||
set ma_status=#{maStatus}
|
||||
where ma_id = #{maId}
|
||||
</update>
|
||||
|
||||
<select id="getBackRecordList" resultType="com.bonus.sgzb.material.domain.BackRecord">
|
||||
SELECT
|
||||
|
|
|
|||
|
|
@ -117,6 +117,80 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
INSERT INTO tm_task_agreement ( `task_id`, `agreement_id`, `create_by`, `create_time`, `company_id` )
|
||||
VALUES(#{id},#{agreementId},#{createBy},NOW(),#{companyId})
|
||||
</insert>
|
||||
<insert id="insertTmTaskByBackInfo" keyColumn="task_id" keyProperty="taskId" parameterType="com.bonus.sgzb.material.domain.BackApplyInfo" useGeneratedKeys="true">
|
||||
insert into tm_task (
|
||||
<if test="taskType != null">task_type, </if>
|
||||
<if test="taskStatus != null">task_status, </if>
|
||||
<if test="code != null and code != ''">code, </if>
|
||||
<if test="createBy != null and createBy != ''">create_by, </if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by, </if>
|
||||
<if test="updateTime != null">update_time, </if>
|
||||
<if test="remark != null and remark != ''">remark, </if>
|
||||
<if test="companyId != null">company_id, </if>
|
||||
create_time
|
||||
) values (
|
||||
<if test="taskType != null">#{taskType}, </if>
|
||||
<if test="taskStatus != null">#{taskStatus}, </if>
|
||||
<if test="code != null and code != ''">#{code}, </if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy}, </if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy}, </if>
|
||||
<if test="updateTime != null">#{updateTime}, </if>
|
||||
<if test="remark != null and remark != ''">#{remark}, </if>
|
||||
<if test="companyId != null">#{companyId}, </if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertAgreementByBackInfo">
|
||||
insert into tm_task_agreement
|
||||
(
|
||||
<if test="taskId != null">
|
||||
task_id,
|
||||
</if>
|
||||
<if test="agreementId != null">
|
||||
agreement_id,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
create_time
|
||||
) values (
|
||||
<if test="taskId != null">
|
||||
#{taskId},
|
||||
</if>
|
||||
<if test="agreementId != null">
|
||||
#{agreementId},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
|
||||
</insert>
|
||||
|
||||
<update id="updateTmTask" parameterType="com.bonus.sgzb.material.domain.TmTask">
|
||||
update tm_task
|
||||
|
|
|
|||
|
|
@ -287,6 +287,29 @@
|
|||
NOW()
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertBackApplyInfo" keyColumn="task_id" keyProperty="taskId" parameterType="com.bonus.sgzb.material.domain.BackApplyInfo" useGeneratedKeys="true">
|
||||
insert into tm_task (
|
||||
<if test="taskType != null">task_type, </if>
|
||||
<if test="taskStatus != null">task_status, </if>
|
||||
<if test="code != null and code != ''">code, </if>
|
||||
<if test="createBy != null and createBy != ''">create_by, </if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by, </if>
|
||||
<if test="updateTime != null">update_time, </if>
|
||||
<if test="remark != null and remark != ''">remark, </if>
|
||||
<if test="companyId != null">company_id, </if>
|
||||
create_time
|
||||
) values (
|
||||
<if test="taskType != null">#{taskType}, </if>
|
||||
<if test="taskStatus != null">#{taskStatus}, </if>
|
||||
<if test="code != null and code != ''">#{code}, </if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy}, </if>
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy}, </if>
|
||||
<if test="updateTime != null">#{updateTime}, </if>
|
||||
<if test="remark != null and remark != ''">#{remark}, </if>
|
||||
<if test="companyId != null">#{companyId}, </if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
<update id="refuseDirectApplyInfo">
|
||||
update direct_apply_info set status = #{status} where id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
Loading…
Reference in New Issue