Merge remote-tracking branch 'origin/master'

This commit is contained in:
mashuai 2025-03-28 15:57:16 +08:00
commit 6ba42d5d9e
16 changed files with 1863 additions and 37 deletions

View File

@ -28,6 +28,11 @@ public class SltAgreementInfo {
* 协议id
*/
private String agreementId;
private List<String> agreementIds;
/**
* 项目id
*/
/**
* 编码
*/

View File

@ -185,6 +185,17 @@ public class LeaseOutDetailsController extends BaseController {
}
}
/**
* 出库单修改出库时间
*
* @param bean
*/
@Log(title = "出库单修改出库时间", businessType = BusinessType.UPDATE)
@PostMapping("/updateOutTime")
public AjaxResult updateOutTime(@RequestBody TmTask bean) {
return leaseOutDetailsService.updateOutTime(bean);
}
/**
* 综合查询--领用记录查询
*
@ -217,4 +228,6 @@ public class LeaseOutDetailsController extends BaseController {
}
}
}

View File

@ -57,4 +57,5 @@ public interface LeaseApplyDetailsMapper {
List<LeaseOutDetailRecord> getOrderBody(@Param("parentId") String parentId,@Param("typeId") String typeId);
List<com.bonus.sgzb.material.domain.LeaseApplyDetails> getLeaseApplyDetailsTypeCount(BackApplyInfo bean);
}

View File

@ -109,4 +109,14 @@ public interface LeaseOutDetailsMapper {
LeaseApplyDetails getLeaseApplyDetails(@Param("record") LeaseOutDetails record);
int updateLeaseApplyDetails(@Param("record") LeaseOutDetails record);
int updateOutTimeTmTask(TmTask bean);
List<TmTask> getDetail(TmTask bean);
int updateOutTimeDetails(TmTask bean);
List<TmTask> getSlt(TmTask bean);
int updateOutTimeSlt(TmTask bean);
}

View File

@ -81,4 +81,6 @@ public interface LeaseOutDetailsService {
TmTask getLeaseOutOrder(String parentId,String typeId);
int delMachineByRfid(MaMachine maMachine);
AjaxResult updateOutTime(TmTask bean);
}

View File

@ -160,6 +160,39 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
return orderHead;
}
@Override
@Transactional
public AjaxResult updateOutTime(TmTask bean) {
try {
//修改tm_task表的出库时间
int i = leaseOutDetailsMapper.updateOutTimeTmTask(bean);
if (i == 0) {
return AjaxResult.error("出库时间修改失败");
}
List<TmTask> detailList = leaseOutDetailsMapper.getDetail(bean);
if(!detailList.isEmpty()){
int j = leaseOutDetailsMapper.updateOutTimeDetails(bean);
if (j == 0) {
return AjaxResult.error("出库时间修改失败");
}
}
List<TmTask> sltList = leaseOutDetailsMapper.getSlt(bean);
if(!sltList.isEmpty()){
int k = leaseOutDetailsMapper.updateOutTimeSlt(bean);
if (k == 0) {
return AjaxResult.error("出库时间修改失败");
}
}
} catch (Exception e) {
log.error("出库时间修改成功", e.getMessage());
throw new RuntimeException("出库时间修改成功");
}
return AjaxResult.success("出库时间修改成功");
}
@Override
public int delMachineByRfid(MaMachine maMachine) {
List<MaMachine> maMachineByMaIdAndMaCode = maMachineMapper.getMaMachineByMaIdAndMaCode(maMachine);

View File

@ -1,9 +1,19 @@
package com.bonus.sgzb.material.controller;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSONObject;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.common.security.annotation.PreventRepeatSubmit;
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
import com.bonus.sgzb.material.config.PoiOutPage;
import com.bonus.sgzb.material.domain.PurchaseInput;
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
@ -11,6 +21,8 @@ import com.bonus.sgzb.material.service.PurchaseCheckServiceCenterService;
import com.bonus.sgzb.material.vo.NoticeInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.bonus.sgzb.common.log.annotation.Log;
@ -19,7 +31,6 @@ import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
/**
* 新购验收任务
*
@ -149,4 +160,43 @@ public class PurchaseCheckInfoController extends BaseController {
public AjaxResult remove(@PathVariable Long taskId) {
return toAjax(purchaseCheckInfoService.deletePurchaseCheckInfoByTaskId(taskId));
}
/**
* 机具模板下载--all
*/
@ApiOperation(value = "机具模板下载")
@PreventRepeatSubmit
// @RequiresPermissions("settlement:info:export")
@Log(title = "机具模板下载")
@PostMapping("/downLoadTypeModel")
public void downLoadTypeModel(HttpServletResponse response, @RequestParam("params") String params) {
// try {
// List<SltAgreementInfo> sltAgreementInfo = JSONObject.parseArray(params,SltAgreementInfo.class);
// // 创建工作簿
// HSSFWorkbook workbook = new HSSFWorkbook();
// int sheetIndex = 1;
//
// // 创建工作表
// HSSFSheet sheet = workbook.createSheet("机具新增" + sheetIndex);
//
// // 创建工作簿和工作表
// PoiOutPage.excelForcheckEach(workbook, sheet, resultsLease,resultsLose,resultsRepair,resultsScrap,resultsReduction, headersLease,headersLose,headersRepair,headersScrap,headersReduction,projectName,unitName,totalCostLease,totalCostLose,totalCostRepair,totalCostScrap,totalCostReduction);
//
// sheetIndex++;
//
// OutputStream out = null;
// response.setContentType("application/vnd.ms-excel;charset=UTF-8");
// response.addHeader("Content-Disposition",
// "attachment;filename=" + URLEncoder.encode("各结算明细", "UTF-8") + ".xls");
// response.setHeader("Pragma", "No-cache");
// out = response.getOutputStream();
// workbook.write(out);
// out.flush();
// out.close();
//
// } catch (Exception e) {
// log.error(e.toString(), e);
// }
}
}

View File

@ -16,10 +16,12 @@ import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
import com.bonus.sgzb.material.config.PoiOutPage;
import com.bonus.sgzb.material.domain.*;
import com.bonus.sgzb.material.service.SltAgreementInfoService;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@ -27,9 +29,12 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @author c liu
@ -140,13 +145,317 @@ public class SltAgreementInfoController extends BaseController {
@Log(title = "租赁明细导出", businessType = BusinessType.EXPORT)
@PostMapping("/exportLeaseOne")
@RequiresPermissions("ndertake:export_1")
public void exportLeaseOne(HttpServletResponse response, @RequestBody List<AgreementInfo> list) {
public void exportLeaseOne(HttpServletResponse response, @RequestBody List<AgreementInfo> list) throws Exception {
List<String> projectNames = new ArrayList<>();
List<String> unitNames = new ArrayList<>();
String fileName = "重庆市送变电工程有限公司设备租赁结算单";
//设置单位和工程名称
for (AgreementInfo info : list) {
projectNames.add(info.getProjectName());
unitNames.add(info.getUnitName());
}
List<SltAgreementInfo> explist = sltAgreementInfoService.getLeaseListOne(list);
String projectName = handleData(projectNames);
String unitName = handleData(unitNames);
BigDecimal totalCost = BigDecimal.valueOf(0.00);
for (SltAgreementInfo sltAgreementInfo : explist) {
totalCost = totalCost.add(sltAgreementInfo.getRealCosts());
}
List<LeaseInfo> leaseInfoList = Convert.toList(LeaseInfo.class, explist);
expOutExcel(response,leaseInfoList,fileName,projectName,unitName,totalCost,1);
ExcelUtil<LeaseInfo> util = new ExcelUtil<LeaseInfo>(LeaseInfo.class);
util.exportExcel(response, leaseInfoList, "租赁明细导出");
}
/**
* 去重单位和工程名称
*/
public String handleData(List<String> list){
StringBuilder sb = new StringBuilder();
Set<String> set = new HashSet<>(list);
for (String str : set) {
sb.append(str).append("");
}
return StringUtils.removeEnd(sb.toString(), "");
}
/**
* 导出结算单
* @param response
* @param list
* @param filename
* @throws Exception
*/
private void expOutExcel(HttpServletResponse response, List<LeaseInfo> list, String filename,String projectName,String unitName,BigDecimal totalCost,int type)
throws Exception {
if (list != null) {
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
int size = list.size();
for (int i = 0; i < size; i++) {
LeaseInfo bean = list.get(i);
Map<String, Object> maps = outReceiveDetailsBeanToMap(bean,type,0);
results.add(maps);
}
List<String> headers = receiveDetailsHeader(type,0);
HSSFWorkbook workbook = PoiOutPage.excelForcheckTwo(results, headers, filename,projectName,unitName,totalCost);
OutputStream out = null;
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.addHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode(filename, "UTF-8") + ".xls");
response.setHeader("Pragma", "No-cache");
out = response.getOutputStream();
workbook.write(out);
out.flush();
out.close();
}else{
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
List<String> headers = receiveDetailsHeader(type,0);
HSSFWorkbook workbook = PoiOutPage.excel(results, headers, filename);
OutputStream out = null;
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.addHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode(filename, "UTF-8") + ".xls");
response.setHeader("Pragma", "No-cache");
out = response.getOutputStream();
workbook.write(out);
out.flush();
out.close();
}
}
/**
* 租赁费用单数据转换
* @param bean
* @return
*/
private Map<String, Object> outReceiveDetailsBeanToMap(LeaseInfo bean,int type,int flag) {
// 创建一个SimpleDateFormat对象定义日期格式
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Map<String, Object> maps = new LinkedHashMap<String, Object>();
if(type==1){
// maps.put("unitName", bean.getUnitName());
// maps.put("projectName", bean.getProjectName());
if (flag==0){
maps.put("typeName", bean.getTypeName());
maps.put("modelName", bean.getModelName());
maps.put("nuitName", bean.getNuitName());
maps.put("num", bean.getNum());
maps.put("leasePrice", bean.getLeasePrice());
maps.put("startTime", bean.getStartTime());
maps.put("endTime", bean.getEndTime());
maps.put("leaseDays", bean.getLeaseDays());
maps.put("costs", bean.getCosts().setScale(2, RoundingMode.HALF_UP));
maps.put("trimDay", bean.getTrimDay());
maps.put("realDays", bean.getRealDays());
maps.put("realCosts", bean.getRealCosts());
maps.put("monthCosts", bean.getRealCosts());
maps.put("nowCosts", bean.getRealCosts());
maps.put("remark", bean.getRemark());
}else {
// maps.put("typeName", bean.getTypeName());
// maps.put("modelName", bean.getModelName());
// maps.put("mtUnitName", bean.getMtUnitName());
// maps.put("leasePrice", bean.getLeasePrice());
// maps.put("num", bean.getNum());
// maps.put("startTime", bean.getStartTime()==null ? null:dateFormat.format(bean.getStartTime()));
// maps.put("endTime", bean.getEndTime()==null ? null:dateFormat.format(bean.getEndTime()));
// maps.put("leaseDays", bean.getLeaseDays());
// maps.put("costs", bean.getCosts().setScale(2, RoundingMode.HALF_UP));
// maps.put("t1", "");
}
}else if(type==2) {
// if(flag==0){
// maps.put("typeName", bean.getTypeName());
// maps.put("modelName", bean.getModelName());
// maps.put("mtUnitName", bean.getMtUnitName());
// maps.put("num", bean.getNum());
// maps.put("costs", bean.getCosts());
// }else{
// maps.put("typeName", bean.getTypeName());
// maps.put("modelName", bean.getModelName());
// maps.put("mtUnitName", bean.getMtUnitName());
// maps.put("num", bean.getNum());
// maps.put("costs", bean.getCosts());
// maps.put("t1", "");
// maps.put("t2", "");
// maps.put("t3", "");
// maps.put("t4", "");
// maps.put("t5", "");
// }
}else if(type==3){
// if(flag==0){
// maps.put("typeName", bean.getTypeName());
// maps.put("modelName", bean.getModelName());
// maps.put("mtUnitName", bean.getMtUnitName());
// maps.put("num", bean.getNum());
// maps.put("partType", bean.getPartType());
// maps.put("costs", bean.getCosts());
// }else{
// maps.put("typeName", bean.getTypeName());
// maps.put("modelName", bean.getModelName());
// maps.put("mtUnitName", bean.getMtUnitName());
// maps.put("num", bean.getNum());
// maps.put("partType", bean.getPartType());
// maps.put("costs", bean.getCosts());
// maps.put("t1", "");
// maps.put("t2", "");
// maps.put("t3", "");
// maps.put("t4", "");
// }
}else if(type==4){
// if(flag==0){
// maps.put("typeName", bean.getTypeName());
// maps.put("modelName", bean.getModelName());
// maps.put("mtUnitName", bean.getMtUnitName());
// maps.put("num", bean.getNum());
// maps.put("partType", bean.getPartType());
// maps.put("costs", bean.getCosts());
// }else{
// maps.put("typeName", bean.getTypeName());
// maps.put("modelName", bean.getModelName());
// maps.put("mtUnitName", bean.getMtUnitName());
// maps.put("num", bean.getNum());
// maps.put("partType", bean.getPartType());
// maps.put("costs", bean.getCosts());
// maps.put("t1", "");
// maps.put("t2", "");
// maps.put("t3", "");
// maps.put("t4", "");
// }
} else if(type==5){
// maps.put("typeName", bean.getTypeName());
// maps.put("modelName", bean.getModelName());
// maps.put("mtUnitName", bean.getUnitName());
// maps.put("leasePrice", bean.getLeasePrice());
// maps.put("num", bean.getReduceNum());
// maps.put("startTime", bean.getStartTime()==null ? null:dateFormat.format(bean.getStartTime()));
// maps.put("endTime", bean.getEndTime()==null ? null:dateFormat.format(bean.getEndTime()));
// maps.put("leaseDays", bean.getDays());
// maps.put("remark", bean.getRemark());
// maps.put("costs", bean.getLeaseMoney().setScale(2, RoundingMode.HALF_UP));
}
return maps;
}
/**
* 租赁费用单表头
* @return
*/
private List<String> receiveDetailsHeader(int type,int flag) {
ArrayList<String> list = new ArrayList<String>();
if(type==1){
// list.add("结算单位");
// list.add("结算工程");
if (flag==0){
list.add("设备名称");
list.add("规格型号");
list.add("单位");
list.add("数量");
list.add("台班费单价(元/天)");
list.add("起租日期");
list.add("终止日期");
list.add("应结算天数");
list.add("应结算金额(元)");
list.add("调整天数");
list.add("实际结算天数");
list.add("实际结算金额(元)");
list.add("月结已入账金额(元)");
list.add("本次结算金额(元)");
list.add("备注");
}else {
list.add("设备名称");
list.add("规格型号");
list.add("计量单位");
list.add("租赁单价");
list.add("租赁数量");
list.add("租赁日期");
list.add("归还日期");
list.add("租赁天数");
list.add("租赁费用(元)");
list.add(" ");
}
}else if(type==2){
if(flag==0){
list.add("设备名称");
list.add("规格型号");
list.add("计量单位");
list.add("丢失数量");
list.add("丢失费用(元)");
}else{
list.add("设备名称");
list.add("规格型号");
list.add("计量单位");
list.add("丢失数量");
list.add("丢失费用(元)");
list.add(" ");
list.add(" ");
list.add(" ");
list.add(" ");
list.add(" ");
}
}else if(type==3){
if(flag==0){
list.add("设备名称");
list.add("规格型号");
list.add("计量单位");
list.add("维修数量");
list.add("是否收费");
list.add("维修费用(元)");
}else{
list.add("设备名称");
list.add("规格型号");
list.add("计量单位");
list.add("维修数量");
list.add("是否收费");
list.add("维修费用(元)");
list.add("");
list.add("");
list.add("");
list.add(" ");
}
}else if(type==4){
if(flag==0){
list.add("设备名称");
list.add("规格型号");
list.add("计量单位");
list.add("报废数量");
list.add("是否收费");
list.add("报废费用(元)");
}else{
list.add("设备名称");
list.add("规格型号");
list.add("计量单位");
list.add("报废数量");
list.add("是否收费");
list.add("报废费用(元)");
list.add("");
list.add("");
list.add("");
list.add(" ");
}
}else if (type==5){
list.add("设备名称");
list.add("规格型号");
list.add("单位");
list.add("租赁单价");
list.add("减免数量");
list.add("减免开始日期");
list.add("减免结束日期");
list.add("减免天数");
list.add("减免原因");
list.add("减免费用(元)");
}
return list;
}
/**
* 租赁明细导出
*/

View File

@ -95,12 +95,12 @@ public class LeaseInfo {
/**
*领料时间
*/
@Excel(name = "起租日期")
@Excel(name = "起租日期",width = 30, dateFormat = "yyyy-MM-dd")
private String startTime;
/**
*退料时间
*/
@Excel(name = "终止日期")
@Excel(name = "终止日期",width = 30, dateFormat = "yyyy-MM-dd")
private String endTime;
/**
* 租赁天数

View File

@ -56,7 +56,9 @@ public interface SltAgreementInfoMapper {
int updateTrimDay(SltAgreementInfo sltAgreementInfo);
int updateInfoOneStatus(SltAgreementInfo apply);
int updateInfoOneStatus(@Param("agreementIds") List<String> agreementIds,@Param("costBearingParty") String costBearingParty);
int updateAgreementStatus(SltAgreementInfo apply);
List<SltAgreementInfo> getLeaseListOneMonth(@Param("bean") AgreementInfo bean, @Param("ids") List<String> idList);
@ -80,7 +82,7 @@ public interface SltAgreementInfoMapper {
List<SltAgreementInfo> checkEndTime(SltAgreementApply apply);
List<AgreementInfo> getProjectListByUnitIds(@Param("unitIds") int[] unitIds);
List<AgreementInfo> getProjectListByUnitIds(Long unitId);
List<AgreementInfo> getUnitListByProjetctIds(Long projectId);
List<AgreementInfo> getUnitListByProjetctIds(@Param("projectIds") Long[] projectIds);
}

View File

@ -570,6 +570,13 @@ public class BackApplyServiceImpl implements BackApplyService {
return AjaxResult.error("退料数不能超过在用数");
}
}
String backTime = null;
if(bean.getBackApplyInfo().getBackTime()!=null){
backTime = bean.getBackApplyInfo().getBackTime();
} else {
backTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
}
BackApplyInfo backApplyInfo = bean.getBackApplyInfo();
try {
int result = 0;
@ -645,6 +652,7 @@ public class BackApplyServiceImpl implements BackApplyService {
// 根据任务详情往back_check_details插入数据
// 退料合格数据处理
if ("1".equals(leaseApplyDetails.getManageType()) && leaseApplyDetails.getPassNum() > 0) {
leaseApplyDetails.setEndTime(backTime);
AjaxResult error = getHgAjaxResult(bean, taskId, leaseApplyDetails);
if (error != null) {
return error;
@ -652,6 +660,7 @@ public class BackApplyServiceImpl implements BackApplyService {
}
// 维修数据处理
if ("1".equals(leaseApplyDetails.getManageType()) && leaseApplyDetails.getMaintenanceNum() > 0) {
leaseApplyDetails.setEndTime(backTime);
AjaxResult error = getWxAjaxResult(bean, backApplyInfoId, leaseApplyDetails);
if (error != null) {
return error;
@ -659,6 +668,7 @@ public class BackApplyServiceImpl implements BackApplyService {
}
// 编码设备合格数据处理
if ("0".equals(leaseApplyDetails.getManageType()) && !CollectionUtils.isEmpty(leaseApplyDetails.getPassMaCodeDtoList())){
leaseApplyDetails.setEndTime(backTime);
AjaxResult error = getMaCodeHgAjaxResult(bean, taskId, leaseApplyDetails);
if (error != null) {
return error;
@ -666,6 +676,7 @@ public class BackApplyServiceImpl implements BackApplyService {
}
// 编码维修数据处理
if ("0".equals(leaseApplyDetails.getManageType()) && !CollectionUtils.isEmpty(leaseApplyDetails.getRepairMaCodeDtoList())){
leaseApplyDetails.setEndTime(backTime);
AjaxResult error = getMaCodeWxAjaxResult(bean, backApplyInfoId, leaseApplyDetails);
if (error != null) {
return error;
@ -675,6 +686,7 @@ public class BackApplyServiceImpl implements BackApplyService {
bean.getIsFinishBack() != null && bean.getIsFinishBack() == 1) {
//更新结算表 slt_agreement_info
leaseApplyDetails.setAgreementId(bean.getAgreementId());
leaseApplyDetails.setEndTime(backTime);
int r = updateSlt4Bean(leaseApplyDetails);
if (r == 0) {
throw new RuntimeException("该机具未被领料使用");
@ -713,6 +725,7 @@ public class BackApplyServiceImpl implements BackApplyService {
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult submitBackApply(BackApplyInfo bean) {
if (bean == null || bean.getBackApplyInfo() == null || CollectionUtils.isEmpty(bean.getBackApplyDetails())) {
return AjaxResult.error("退料申请数据不能为空");
@ -724,6 +737,13 @@ public class BackApplyServiceImpl implements BackApplyService {
return AjaxResult.error("退料数不能超过在用数");
}
}
String backTime = null;
if(bean.getBackApplyInfo().getBackTime()!=null){
backTime = bean.getBackApplyInfo().getBackTime();
} else {
backTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
}
boolean addLeaseTaskResult = false;
Long backApplyInfoId = 0L;
try {
@ -800,7 +820,14 @@ public class BackApplyServiceImpl implements BackApplyService {
leaseApplyDetails.setCreateBy(SecurityUtils.getUserId().toString());
// 根据任务详情往back_check_details插入数据
// 退料合格数据处理
if(leaseApplyDetails.getPassNum()==null){
leaseApplyDetails.setPassNum(0);
}
if(leaseApplyDetails.getMaintenanceNum()==null){
leaseApplyDetails.setMaintenanceNum(0);
}
if ("1".equals(leaseApplyDetails.getManageType()) && leaseApplyDetails.getPassNum() > 0) {
leaseApplyDetails.setEndTime(backTime);
AjaxResult error = getHgAjaxResult(bean, taskId, leaseApplyDetails);
if (error != null) {
return error;
@ -808,6 +835,7 @@ public class BackApplyServiceImpl implements BackApplyService {
}
// 维修数据处理
if ("1".equals(leaseApplyDetails.getManageType()) && leaseApplyDetails.getMaintenanceNum() > 0) {
leaseApplyDetails.setEndTime(backTime);
AjaxResult error = getWxAjaxResult(bean, backApplyInfoId, leaseApplyDetails);
if (error != null) {
return error;
@ -815,6 +843,7 @@ public class BackApplyServiceImpl implements BackApplyService {
}
// 编码设备合格数据处理
if ("0".equals(leaseApplyDetails.getManageType()) && !CollectionUtils.isEmpty(leaseApplyDetails.getPassMaCodeDtoList())){
leaseApplyDetails.setEndTime(backTime);
AjaxResult error = getMaCodeHgAjaxResult(bean, taskId, leaseApplyDetails);
if (error != null) {
return error;
@ -822,6 +851,7 @@ public class BackApplyServiceImpl implements BackApplyService {
}
// 编码维修数据处理
if ("0".equals(leaseApplyDetails.getManageType()) && !CollectionUtils.isEmpty(leaseApplyDetails.getRepairMaCodeDtoList())){
leaseApplyDetails.setEndTime(backTime);
AjaxResult error = getMaCodeWxAjaxResult(bean, backApplyInfoId, leaseApplyDetails);
if (error != null) {
return error;
@ -832,6 +862,7 @@ public class BackApplyServiceImpl implements BackApplyService {
bean.getIsFinishBack() != null && bean.getIsFinishBack() == 1) {
//更新结算表 slt_agreement_info
leaseApplyDetails.setAgreementId(bean.getAgreementId());
leaseApplyDetails.setEndTime(backTime);
int res = updateSlt4Bean(leaseApplyDetails);
if (res == 0) {
throw new RuntimeException("该机具未被领料使用");

View File

@ -293,14 +293,14 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
}
}
// 判断是否已经结算(01承担方)
boolean b = leaseListOne.stream().allMatch(t -> "1".equals(t.getIsSlt()));
boolean b = leaseListOne.stream().allMatch(t -> "1".equals(t.getIsSlt()) || "2".equals(t.getIsSlt()));
if (b) {
relation.setIsSltOne("1");
} else {
relation.setIsSltOne("0");
}
// 判断是否已经结算(03承担方)
boolean f = leaseListThree.stream().allMatch(t -> "1".equals(t.getIsSlt()));
boolean f = leaseListThree.stream().allMatch(t -> "1".equals(t.getIsSlt()) || "2".equals(t.getIsSlt()));
if (f) {
relation.setIsSltThree("1");
} else {
@ -350,9 +350,16 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
@Override
public AjaxResult submitFeeOne(SltAgreementInfo apply) {
int i = sltAgreementInfoMapper.updateInfoOneStatus(apply);
int i = sltAgreementInfoMapper.updateInfoOneStatus(apply.getAgreementIds(),apply.getCostBearingParty());
if (i > 0) {
i = sltAgreementInfoMapper.updateAgreementStatus(apply);
if(i>0){
return AjaxResult.success("结算成功");
}else{
return AjaxResult.error("结算失败");
}
} else {
return AjaxResult.error("结算失败");
}
@ -640,8 +647,8 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
public AjaxResult getProjectListByUnitIds(AgreementInfo agreementInfo) {
List<AgreementInfo> list = new ArrayList<>();
try {
if(agreementInfo.getUnitIds()!=null){
list = sltAgreementInfoMapper.getProjectListByUnitIds(agreementInfo.getUnitIds());
if(agreementInfo.getUnitId()!=null){
list = sltAgreementInfoMapper.getProjectListByUnitIds(agreementInfo.getUnitId());
}
} catch (Exception e) {
@ -659,8 +666,8 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
public AjaxResult getUnitListByProjetctIds(AgreementInfo agreementInfo) {
List<AgreementInfo> list = new ArrayList<>();
try {
if(agreementInfo.getProjectId()!=null){
list = sltAgreementInfoMapper.getUnitListByProjetctIds(agreementInfo.getProjectId());
if(agreementInfo.getProjectIds()!=null){
list = sltAgreementInfoMapper.getUnitListByProjetctIds(agreementInfo.getProjectIds());
}
} catch (Exception e) {

View File

@ -622,7 +622,7 @@
</update>
<update id="updateStlInfo">
update slt_agreement_info
set end_time = now(),
set end_time = #{record.endTime},
update_time = now(),
back_id = #{record.parentId},
status = '1'
@ -631,7 +631,7 @@
<update id="updateStlInfoTwo">
update slt_agreement_info
set num = #{backNum},
end_time = now(),
end_time = #{record.endTime},
update_time = now(),
back_id = #{record.parentId},
status = '1'

View File

@ -415,7 +415,7 @@
</insert>
<insert id="insSltInfo">
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,type_name,model_name,replace_type_id,is_slt,company_id,lease_type,create_time,ck_remark)
values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},now(),0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},#{ma.typeName},#{ma.modelName},#{ma.replaceTypeId},'0',#{record.companyId},#{record.leaseType},now(),#{record.remark});
values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},#{record.createTime},0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},#{ma.typeName},#{ma.modelName},#{ma.replaceTypeId},'0',#{record.companyId},#{record.leaseType},now(),#{record.remark});
</insert>
<select id="leaseOutRecordList" resultType="com.bonus.sgzb.base.api.domain.LeaseOutDetails">
@ -511,4 +511,51 @@
parennt_id = #{record.parentId}
AND type_id = #{record.typeId}
</select>
<update id="updateOutTimeTmTask">
UPDATE
tm_task
SET
update_time = #{updateTime}
WHERE
task_id = #{taskId}
</update>
<select id="getDetail" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT
id AS id
FROM
lease_out_details
WHERE
parent_id = #{id}
</select>
<update id="updateOutTimeDetails">
UPDATE
lease_out_details
SET
create_time = #{updateTime}
WHERE
parent_id = #{id}
</update>
<select id="getSlt" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT
id AS id
FROM
slt_agreement_info
WHERE
lease_id = #{id}
</select>
<update id="updateOutTimeSlt">
UPDATE
slt_agreement_info
SET
start_time = #{updateTime}
WHERE
lease_id = #{id}
</update>
</mapper>

View File

@ -108,11 +108,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateInfoOneStatus">
UPDATE slt_agreement_info sai
LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id
SET sai.is_slt = '1'
SET sai.is_slt = '2'
WHERE
sai.agreement_id = #{agreementId}
sai.agreement_id in
<foreach item="agreementId" collection="agreementIds" open="(" separator="," close=")">
#{agreementId}
</foreach>
AND sai.lease_type = 0
AND lai.cost_bearing_party = #{costBearingParty}
AND lai.cost_bearing_party = #{costBearingParty,jdbcType=VARCHAR}
</update>
<update id="updateOutSourceCosts">
update repair_cost set out_source_costs = #{outSourceCosts} where id = #{id}
@ -123,6 +126,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateRecodeIsSlt">
update repair_apply_record set is_slt = 1,update_time = now() where id = #{id}
</update>
<update id="updateAgreementStatus">
update bm_agreement_info bai set is_slt = 2
WHERE
bai.agreement_id in
<foreach item="agreementId" collection="agreementIds" open="(" separator="," close=")">
#{agreementId}
</foreach>
</update>
<select id="getSltAgreementInfo" resultType="com.bonus.sgzb.material.domain.AgreementInfo">
SELECT bai.agreement_id, bai.agreement_code , contract_code,file_url ,file_name,sign_time,
bui.unit_id,bui.unit_name , bp.lot_id as projectId , bp.lot_name as projectName,
@ -133,11 +144,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
left join slt_agreement_relation sar on bai.agreement_id = sar.agreement_id
where bai.status = '1'
<if test="unitIds != null and unitIds.length > 0">
and bui.unit_id in
<foreach item="unitId" collection="unitIds" open="(" separator="," close=")">
#{unitId}
</foreach>
<if test="unitId != null">
and bui.unit_id = #{unitId}
</if>
<if test="projectIds != null">
AND bp.lot_id IN
@ -632,13 +640,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join bm_unit_info bui on bui.unit_id = bai.unit_id
left join bm_project_lot bpl ON bpl.lot_id = bai.project_id
where bai.status = '1'
<if test="unitIds != null and unitIds.length > 0">
and bui.unit_id in
<foreach item="unitId" collection="unitIds" open="(" separator="," close=")">
#{unitId}
</foreach>
<if test="unitId != null ">
and bui.unit_id = #{unitId}
</if>
ORDER BY bai.agreement_id desc
</select>
@ -649,8 +653,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join bm_unit_info bui on bui.unit_id = bai.unit_id
left join bm_project_lot bpl ON bpl.lot_id = bai.project_id
where bai.status = '1'
<if test="projectId != null">
and bai.project_id = #{projectId}
<if test="projectIds != null and projectIds.length > 0">
and bai.project_id in
<foreach item="projectId" collection="projectIds" open="(" separator="," close=")">
#{projectId}
</foreach>
</if>
GROUP BY bai.unit_id
ORDER BY bai.agreement_id desc