Merge branch 'master' of http://192.168.30.2:3000/bonus/Bonus-Cloud-Material
This commit is contained in:
commit
b3c97bce82
|
|
@ -182,9 +182,10 @@ public class ClzSltAgreementInfoController extends BaseController {
|
|||
|
||||
List<MaterialSltAgreementInfo> oneOfList = clzSltAgreementInfoMapper.getLeaseList(sltAgreementInfo);
|
||||
//设定班组实际出场时间
|
||||
String date = null;
|
||||
if(!oneOfList.isEmpty()){
|
||||
|
||||
String date = "暂无" ;
|
||||
|
||||
//先判断是否在场
|
||||
String exitTime = clzSltAgreementInfoMapper.getTeamSjOutTime(oneOfList.get(0));
|
||||
if( exitTime!=null && !exitTime.isEmpty() ){
|
||||
|
|
@ -196,7 +197,10 @@ public class ClzSltAgreementInfoController extends BaseController {
|
|||
|
||||
if(date!=null && !date.isEmpty()){
|
||||
oneOfList.get(0).setActualExitTime(date);
|
||||
}else{
|
||||
oneOfList.get(0).setActualExitTime("暂无");
|
||||
}
|
||||
|
||||
actualTimeAndNames.add(oneOfList.get(0).getUnitName() + "(" + oneOfList.get(0).getActualExitTime()+")");
|
||||
projectNames.add(oneOfList.get(0).getProjectName());
|
||||
unitNames.add(oneOfList.get(0).getUnitName());
|
||||
|
|
@ -216,7 +220,7 @@ public class ClzSltAgreementInfoController extends BaseController {
|
|||
if (Objects.isNull(bean.getLeaseDays())) {
|
||||
bean.setLeaseDay(0L);
|
||||
}
|
||||
|
||||
bean.setActualExitTime(date);
|
||||
BigDecimal leasePrice = bean.getLeasePrice();
|
||||
BigDecimal num = bean.getNum();
|
||||
// 根据班组退场时间计算租赁费用
|
||||
|
|
@ -290,9 +294,9 @@ public class ClzSltAgreementInfoController extends BaseController {
|
|||
List<MaterialSltAgreementInfo> overdueReturnedList = getOverdueReturnedMaterials(sltAgreementInfo);
|
||||
loseList.addAll(overdueReturnedList);
|
||||
//设定班组实际出场时间
|
||||
String date = null;
|
||||
if(!loseList.isEmpty()){
|
||||
|
||||
String date = "暂无" ;
|
||||
//先判断是否在场
|
||||
String exitTime = clzSltAgreementInfoMapper.getTeamSjOutTime(oneOfList.get(0));
|
||||
if( exitTime!=null && !exitTime.isEmpty() ){
|
||||
|
|
@ -303,6 +307,8 @@ public class ClzSltAgreementInfoController extends BaseController {
|
|||
|
||||
if(date!=null && !date.isEmpty()){
|
||||
loseList.get(0).setActualExitTime(date);
|
||||
}else{
|
||||
loseList.get(0).setActualExitTime("暂无");
|
||||
}
|
||||
actualTimeAndNames.add(loseList.get(0).getUnitName() + "(" + loseList.get(0).getActualExitTime()+")");
|
||||
projectNames.add(loseList.get(0).getProjectName());
|
||||
|
|
@ -462,7 +468,7 @@ public class ClzSltAgreementInfoController extends BaseController {
|
|||
}
|
||||
//设定班组实际出场时间
|
||||
if(!listAll.isEmpty()){
|
||||
String date = "暂无" ;
|
||||
String date = null ;
|
||||
//先判断是否在场
|
||||
String exitTime = clzSltAgreementInfoMapper.getTeamSjOutTime(listAll.get(0));
|
||||
if( exitTime!=null && !exitTime.isEmpty() ){
|
||||
|
|
@ -593,27 +599,19 @@ public class ClzSltAgreementInfoController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
// 物资是否已退还(根据endTime字段判断)
|
||||
boolean isReturned = bean.getEndTime() != null;
|
||||
|
||||
if (!isReturned) {
|
||||
// 1.4 如果当前领用物资还未退还,不收取任何租赁费用,直接计作丢失,收取物资原值 不在租赁费用中体现
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
// 物资已退还,按照天数来计算费用
|
||||
Date materialReturnTime = bean.getEndTime();
|
||||
|
||||
if(materialReturnTime == null){
|
||||
materialReturnTime = DateTime.now();
|
||||
}
|
||||
// 计算超期天数
|
||||
long overdueDays = calculateOverdueDays(materialReturnTime, exitTime);
|
||||
|
||||
if (overdueDays <= 0) {
|
||||
// 1.3 在班组退场之前归还的物资不收费
|
||||
return BigDecimal.ZERO;
|
||||
} else if (overdueDays >= 16) {
|
||||
// 1.2 超期15天以上也就是16天及以上计为丢失,算作丢失的话直接收取原值、所有租赁费用不收费了
|
||||
// 注意:丢失费用应该在getLoseList中处理,这里不收费
|
||||
return BigDecimal.ZERO;
|
||||
} else {
|
||||
// 计算超期费用
|
||||
return calculateOverdueCost(bean, leasePrice, num, overdueDays);
|
||||
|
|
@ -629,7 +627,7 @@ public class ClzSltAgreementInfoController extends BaseController {
|
|||
if (overdueDays <= 7) {
|
||||
// 超期1~7天不收费
|
||||
overdueCost = BigDecimal.ZERO;
|
||||
} else if (overdueDays <= 15) {
|
||||
} else {
|
||||
// 超期第8天~第15天双倍计费
|
||||
// 前7天不收费,只计算第8天开始的双倍费用
|
||||
long doubleBillingDays = overdueDays - 7;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.bonus.common.core.web.controller.BaseController;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.clz.domain.back.MaterialBackExportVO;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.clz.domain.back.MaterialBackApplyTotalInfo;
|
||||
import com.bonus.material.clz.domain.back.MaterialBackApplyDetails;
|
||||
|
|
@ -51,6 +52,27 @@ public class MaterialBackApplyInfoController extends BaseController {
|
|||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出退料任务列表")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "退料任务", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出退料任务")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MaterialBackApplyInfo backApplyInfo) {
|
||||
backApplyInfo.setIsExport(true);
|
||||
String fileName = "退料记录";
|
||||
if (backApplyInfo.getStartTime() != null && backApplyInfo.getEndTime() != null) {
|
||||
fileName = "退料记录"+ "(退料时间" +backApplyInfo.getStartTime() + "至" + backApplyInfo.getEndTime()+ ")";
|
||||
}
|
||||
List<MaterialBackApplyInfo> list = materialBackApplyInfoService.selectBackApplyInfoList(backApplyInfo);
|
||||
// 根据list集合数,去填充序号
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
list.get(i).setSerialNumber(i + 1);
|
||||
}
|
||||
ExcelUtil<MaterialBackApplyInfo> util = new ExcelUtil<>(MaterialBackApplyInfo.class);
|
||||
// 获取当前年月日时分秒导出时间,用括号拼接在后面
|
||||
String title = "班组退料记录" + "(" + "导出时间:" + DateUtils.getTime() + ")";
|
||||
util.exportExcel(response, list, fileName, title);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询总站点退料记录数据
|
||||
* @param backApplyInfo
|
||||
|
|
@ -274,4 +296,22 @@ public class MaterialBackApplyInfoController extends BaseController {
|
|||
public AjaxResult getMachine(MaterialBackApplyInfo dto) {
|
||||
return materialBackApplyInfoService.getMachine(dto);
|
||||
}
|
||||
|
||||
@ApiOperation("导出材料站退料记录")
|
||||
@PostMapping("/exportBackInfoExcl")
|
||||
public void exportBackInfoExcl(HttpServletResponse response, MaterialBackApplyInfo bean) {
|
||||
String fileName = "退料记录";
|
||||
if (bean.getStartTime() != null && bean.getEndTime() != null) {
|
||||
fileName = "退料记录"+ "(退料时间" +bean.getStartTime() + "至" + bean.getEndTime()+ ")";
|
||||
}
|
||||
List<MaterialBackExportVO> list = materialBackApplyInfoService.exportBackInfoExcl(bean);
|
||||
// 根据list集合数,去填充序号
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
list.get(i).setSerialNumber(i + 1);
|
||||
}
|
||||
ExcelUtil<MaterialBackExportVO> util = new ExcelUtil<>(MaterialBackExportVO.class);
|
||||
// 获取当前年月日时分秒导出时间,用括号拼接在后面
|
||||
String title = "材料站退料记录" + "(" + "导出时间:" + DateUtils.getTime() + ")";
|
||||
util.exportExcel(response, list, fileName, title);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,9 +126,19 @@ public class MaterialLeaseInfoController extends BaseController {
|
|||
@SysLog(title = "领料任务", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出领料任务")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MaterialLeaseApplyInfo leaseApplyInfo) {
|
||||
String fileName = "领料记录";
|
||||
if (leaseApplyInfo.getStartTime() != null && leaseApplyInfo.getEndTime() != null) {
|
||||
fileName = "领料记录"+ "(领料时间" +leaseApplyInfo.getStartTime() + "至" + leaseApplyInfo.getEndTime()+ ")";
|
||||
}
|
||||
List<MaterialLeaseApplyInfo> list = materialLeaseInfoService.selectLeaseApplyInfoList(leaseApplyInfo);
|
||||
// 根据list集合数,去填充序号
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
list.get(i).setSerialNumber(i + 1);
|
||||
}
|
||||
ExcelUtil<MaterialLeaseApplyInfo> util = new ExcelUtil<>(MaterialLeaseApplyInfo.class);
|
||||
util.exportExcel(response, list, "领料任务数据");
|
||||
// 获取当前年月日时分秒导出时间,用括号拼接在后面
|
||||
String title = "班组领料记录" + "(" + "导出时间:" + DateUtils.getTime() + ")";
|
||||
util.exportExcel(response, list, fileName, title);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ public class MaterialBackApplyInfo implements Serializable {
|
|||
|
||||
private Boolean isExport;
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
@Excel(name = "序号", isSequence = true, sort = 0, width = 5)
|
||||
private Integer serialNumber;
|
||||
|
||||
@ApiModelProperty(value = "是否退料 0 否,1 是")
|
||||
private Integer isBack;
|
||||
|
||||
|
|
@ -202,6 +206,7 @@ public class MaterialBackApplyInfo implements Serializable {
|
|||
private String backStyle;
|
||||
|
||||
@ApiModelProperty(value = "分公司")
|
||||
@Excel(name = "分公司",sort = 3)
|
||||
private String impUnitName;
|
||||
|
||||
@ApiModelProperty(value = "分包单位")
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ import java.util.Date;
|
|||
public class MaterialBackExportVO {
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
@Excel(name = "序号", isSequence = true, sort = 0)
|
||||
private String serialNumber;
|
||||
@Excel(name = "序号", isSequence = true, sort = 0, width = 5)
|
||||
private Integer serialNumber;
|
||||
|
||||
@Excel(name = "分公司")
|
||||
@ApiModelProperty(value = "分公司")
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ public class MaterialLeaseApplyInfo extends BaseEntity {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
@Excel(name = "序号", isSequence = true, sort = 0, width = 5)
|
||||
private Integer serialNumber;
|
||||
|
||||
@ApiModelProperty(value = "是否出库 0 否,1 是")
|
||||
private Integer isOut;
|
||||
|
||||
|
|
@ -64,7 +68,6 @@ public class MaterialLeaseApplyInfo extends BaseEntity {
|
|||
@Excel(name = "领料班组",sort = 6)
|
||||
private String teamName;
|
||||
|
||||
@Excel(name = "租赁工程",sort = 7)
|
||||
@ApiModelProperty(value = "租赁工程")
|
||||
private String leaseProject;
|
||||
|
||||
|
|
@ -327,7 +330,6 @@ public class MaterialLeaseApplyInfo extends BaseEntity {
|
|||
private String departName;
|
||||
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
@Excel(name = "工程名称")
|
||||
private String proName;
|
||||
|
||||
@ApiModelProperty(value = "是否人为修改:0:否,1:是")
|
||||
|
|
|
|||
|
|
@ -98,11 +98,11 @@ public class MaterialRetainedEquipmentInfo {
|
|||
private String allNumStr;
|
||||
|
||||
@ApiModelProperty(value = "购置单价")
|
||||
@Excel(name = "购置单价", cellType = Excel.ColumnType.NUMERIC,align = HorizontalAlignment.RIGHT)
|
||||
//@Excel(name = "购置单价", cellType = Excel.ColumnType.NUMERIC,align = HorizontalAlignment.RIGHT)
|
||||
private BigDecimal buyPrice;
|
||||
|
||||
@ApiModelProperty(value = "原值")
|
||||
@Excel(name = "原值(万元)", cellType = Excel.ColumnType.NUMERIC,align = HorizontalAlignment.RIGHT)
|
||||
//@Excel(name = "原值(万元)", cellType = Excel.ColumnType.NUMERIC,align = HorizontalAlignment.RIGHT)
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@ApiModelProperty(value = "五年以内成新率")
|
||||
|
|
@ -279,4 +279,7 @@ public class MaterialRetainedEquipmentInfo {
|
|||
|
||||
@ApiModelProperty(value = "是否班组标志(0 是 1 否)")
|
||||
private String bzFlag;
|
||||
|
||||
@ApiModelProperty(value = "租赁费用(万元)")
|
||||
private BigDecimal rentPrice;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,6 +156,13 @@ public class MaterialSltAgreementInfo extends BaseEntity {
|
|||
@ApiModelProperty(value = "租赁天数")
|
||||
private Long leaseDay;
|
||||
|
||||
/**
|
||||
* 超期天数
|
||||
*/
|
||||
@Excel(name = "超期天数")
|
||||
@ApiModelProperty(value = "超期天数")
|
||||
private Long overDay;
|
||||
|
||||
/**
|
||||
* 租赁费用
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.bonus.common.core.annotation.Excel;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
|
@ -83,4 +82,12 @@ public class MaterialTotalMentInfo {
|
|||
@ApiModelProperty(value = "绳索类在用数量")
|
||||
@Excel(name = "绳索类在用数量")
|
||||
private BigDecimal useRopeNum;
|
||||
|
||||
@ApiModelProperty(value = "投入费用(万元)")
|
||||
@Excel(name = "投入费用(万元)")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@ApiModelProperty(value = "租赁费用(万元)")
|
||||
@Excel(name = "租赁费用(万元)")
|
||||
private BigDecimal rentPrice;
|
||||
}
|
||||
|
|
@ -327,4 +327,11 @@ public interface MaterialMachineMapper {
|
|||
* @return
|
||||
*/
|
||||
List<MaterialStorageInfo> getSubList(MaterialStorageInfo bean);
|
||||
|
||||
/**
|
||||
* 租赁费用
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getLeaseInfo(MaterialRetainedEquipmentInfo bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -807,7 +807,33 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
|||
if (Objects.isNull(bean.getLeaseDays())) {
|
||||
bean.setLeaseDay(0L);
|
||||
}
|
||||
// 物资已退还,按照天数来计算费用
|
||||
Date materialReturnTime = bean.getEndTime();
|
||||
|
||||
if(materialReturnTime == null){
|
||||
materialReturnTime = DateTime.now();
|
||||
}
|
||||
String teamExitTime = bean.getActualExitTime();
|
||||
if (teamExitTime == null) {
|
||||
teamExitTime = DateTime.now().toString("yyyy-MM-dd");
|
||||
}
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date exitTime = null;
|
||||
try {
|
||||
exitTime = format.parse(teamExitTime);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 计算超期天数
|
||||
long overdueDays = calculateOverdueDays(materialReturnTime, exitTime);
|
||||
if(overdueDays < 8 ){
|
||||
bean.setOverDay(0L);
|
||||
}else{
|
||||
bean.setOverDay(overdueDays-7);
|
||||
}
|
||||
|
||||
|
||||
bean.setActualExitTime(date);
|
||||
BigDecimal leasePrice = bean.getLeasePrice();
|
||||
BigDecimal num = bean.getNum();
|
||||
// 根据班组退场时间计算租赁费用
|
||||
|
|
@ -840,27 +866,21 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
|||
}
|
||||
|
||||
|
||||
// 物资是否已退还(根据endTime字段判断)
|
||||
boolean isReturned = bean.getEndTime() != null;
|
||||
|
||||
if (!isReturned) {
|
||||
// 1.4 如果当前领用物资还未退还,不收取任何租赁费用,直接计作丢失,收取物资原值 不在租赁费用中体现
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
// 物资已退还,按照天数来计算费用
|
||||
Date materialReturnTime = bean.getEndTime();
|
||||
|
||||
if(materialReturnTime == null){
|
||||
materialReturnTime = DateTime.now();
|
||||
}
|
||||
|
||||
// 计算超期天数
|
||||
long overdueDays = calculateOverdueDays(materialReturnTime, exitTime);
|
||||
|
||||
if (overdueDays <= 0) {
|
||||
// 1.3 在班组退场之前归还的物资不收费
|
||||
return BigDecimal.ZERO;
|
||||
} else if (overdueDays >= 16) {
|
||||
// 1.2 超期15天以上也就是16天及以上计为丢失,算作丢失的话直接收取原值、所有租赁费用不收费了
|
||||
// 注意:丢失费用应该在getLoseList中处理,这里不收费
|
||||
return BigDecimal.ZERO;
|
||||
} else {
|
||||
// 计算超期费用
|
||||
return calculateOverdueCost(bean, leasePrice, num, overdueDays);
|
||||
|
|
@ -876,7 +896,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
|||
if (overdueDays <= 7) {
|
||||
// 超期1~7天不收费
|
||||
overdueCost = BigDecimal.ZERO;
|
||||
} else if (overdueDays <= 15) {
|
||||
} else {
|
||||
// 超期第8天~第15天双倍计费
|
||||
// 前7天不收费,只计算第8天开始的双倍费用
|
||||
long doubleBillingDays = overdueDays - 7;
|
||||
|
|
|
|||
|
|
@ -896,6 +896,10 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
BigDecimal inCountNum = BigDecimal.ZERO;
|
||||
// 绳索类站内数量
|
||||
BigDecimal inRopeNum = BigDecimal.ZERO;
|
||||
// 投入总费用(万元),保留3位小数
|
||||
BigDecimal totalPrice = BigDecimal.ZERO;
|
||||
// 租赁总费用(万元),保留3位小数
|
||||
BigDecimal rentPrice = BigDecimal.ZERO;
|
||||
|
||||
// 获取在用量
|
||||
List<MaterialRetainedEquipmentInfo> useInfoList = materialMachineMapper.getUsInfoList(bean);
|
||||
|
|
@ -986,6 +990,13 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.count());
|
||||
// 合计list中的totalPrice费用至totalCost
|
||||
totalPrice = useInfoList.stream()
|
||||
.map(MaterialRetainedEquipmentInfo::getTotalPrice)
|
||||
.filter(Objects::nonNull)
|
||||
.reduce(BigDecimal::add)
|
||||
.orElse(BigDecimal.ZERO)
|
||||
.setScale(3, RoundingMode.HALF_UP);
|
||||
} else {
|
||||
info.setProNum(0);
|
||||
info.setDepartNum(0);
|
||||
|
|
@ -1003,6 +1014,21 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
info.setCountNum(inCountNum.add(useCountNum).add(useCountNumSub));
|
||||
// 绳索类保有量
|
||||
info.setRopeNum(inRopeNum.add(useRopeNum).add(useRopeNumSub));
|
||||
// 投入费用(万元)
|
||||
info.setTotalPrice(totalPrice);
|
||||
/*// 租赁费用(万元)
|
||||
List<MaterialRetainedEquipmentInfo> leaseInfoList = materialMachineMapper.getLeaseInfo(bean);
|
||||
if (CollectionUtils.isNotEmpty(leaseInfoList)) {
|
||||
rentPrice = leaseInfoList.stream()
|
||||
.map(MaterialRetainedEquipmentInfo::getRentPrice)
|
||||
.filter(Objects::nonNull)
|
||||
.reduce(BigDecimal::add)
|
||||
.orElse(BigDecimal.ZERO)
|
||||
.setScale(3, RoundingMode.HALF_UP);
|
||||
} else {
|
||||
info.setRentPrice(BigDecimal.ZERO);
|
||||
}*/
|
||||
info.setRentPrice(rentPrice);
|
||||
return info;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
(bai.create_by REGEXP '^[0-9]+$' AND su.user_id = bai.create_by) -- 数字ID关联
|
||||
OR
|
||||
(NOT bai.create_by REGEXP '^[0-9]+$' AND su.nick_name = bai.create_by) -- 汉字昵称关联
|
||||
)
|
||||
) and su.del_flag='0'
|
||||
WHERE
|
||||
bai.id = #{id}
|
||||
LIMIT 1
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||
left join ma_type mt on sai.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
where sai.agreement_id = #{agreementId} and sai.end_time is null
|
||||
where sai.agreement_id = #{agreementId} and sai.end_time is null and sai.is_slt=1
|
||||
) res
|
||||
GROUP BY res.typeId,res.startTime,res.endTime
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -2585,4 +2585,98 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sai.type_id,
|
||||
sai.ma_id
|
||||
</select>
|
||||
|
||||
<select id="getLeaseInfo" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
SELECT
|
||||
bp.pro_name as proName,
|
||||
bp.pro_id as proId,
|
||||
bp.external_id as externalId,
|
||||
bp.imp_unit AS impUnit,
|
||||
bu.bzz_idcard AS idCard,
|
||||
df.project_dept AS departName,
|
||||
sd.dept_name AS impUnitName,
|
||||
bu.unit_name AS teamName,
|
||||
mt.unit_name AS unit,
|
||||
mt.unit_value AS unitValue,
|
||||
CASE mt.jiju_type
|
||||
WHEN 2 THEN
|
||||
'安全工器具'
|
||||
ELSE
|
||||
'施工机具'
|
||||
END jiJuType,
|
||||
CASE mt.manage_type
|
||||
WHEN 0 THEN
|
||||
'编码'
|
||||
ELSE
|
||||
'数量'
|
||||
END manageType,
|
||||
(DATEDIFF(
|
||||
COALESCE(sai.end_time, NOW()), -- 若end_time为null则用当前时间
|
||||
sai.start_time
|
||||
) + 1) * sai.num * sai.lease_price / 10000 AS rentPrice,
|
||||
CASE
|
||||
WHEN bu.type_id IN (32, 33) THEN '分包直领'
|
||||
ELSE bz.ssfbdw
|
||||
END AS subUnitName
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
LEFT JOIN bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
|
||||
LEFT JOIN `micro-tool`.bzgl_bz bz ON bp.external_id = bz.project_id AND bz.bzmc = bu.unit_name
|
||||
LEFT JOIN data_center.dx_fb_son df ON bp.external_id = df.id
|
||||
WHERE
|
||||
sai.is_slt = '0'
|
||||
<if test="impUnitName != null and impUnitName != ''">
|
||||
AND sd.dept_name = #{impUnitName}
|
||||
</if>
|
||||
<if test="proName != null and proName != ''">
|
||||
AND bp.pro_name = #{proName}
|
||||
</if>
|
||||
<if test="departName != null and departName != ''">
|
||||
AND bp.pro_center like concat('%',#{departName},'%')
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt2.type_name like concat('%',#{typeName},'%')
|
||||
</if>
|
||||
<if test="typeModelName != null and typeModelName != ''">
|
||||
AND mt.type_name like concat('%',#{typeModelName},'%')
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
AND bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="impUnit != null and impUnit != ''">
|
||||
AND bp.imp_unit = #{impUnit}
|
||||
</if>
|
||||
<if test="jiJuType != null and jiJuType != ''">
|
||||
AND mt.jiju_type = #{jiJuType}
|
||||
</if>
|
||||
<if test="subUnitName != null and subUnitName != ''">
|
||||
AND (
|
||||
(
|
||||
#{subUnitName} = '分包直领'
|
||||
AND bu.type_id IN (32, 33)
|
||||
)
|
||||
OR
|
||||
(
|
||||
#{subUnitName} != '分包直领'
|
||||
AND bz.ssfbdw LIKE CONCAT('%', #{subUnitName}, '%')
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="teamName != null and teamName != ''">
|
||||
AND bu.unit_name LIKE CONCAT('%', #{teamName}, '%')
|
||||
</if>
|
||||
GROUP BY
|
||||
sai.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue