Commit 4ea2b219 authored by 罗贤顺's avatar 罗贤顺

修复问题

parent 928de753
......@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
......@@ -20,7 +22,7 @@ public interface TProcessesBlastdesignHoleMapper extends BaseMapper<TProcessesBl
Page<TProcessesBlastdesignHoleVo> getPage(Page<TProcessesBlastdesignHole> page, @Param("ew") QueryWrapper<TProcessesBlastdesignHole> queryWrapper);
TProcessesBlastdesignHoleVo getByQuery(@Param("ew") QueryWrapper<TProcessesBlastdesignHole> queryWrapper);
List<TProcessesBlastdesignHoleVo> getByQuery(@Param("ew") QueryWrapper<TProcessesBlastdesignHole> queryWrapper);
Double getSumByCondition(@Param("condition") String condition, @Param("ew") QueryWrapper<TProcessesBlastdesignHole> queryWrapper);
......
package cn.wise.sc.acquisition.business.model.query;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
......@@ -38,7 +42,16 @@ public class TProcessesAuxiliaryQuery {
*/
@ApiModelProperty("EquipmentName")
private String EquipmentName;
/**
* 品名:柴油或汽油
*/
@ApiModelProperty("Name;")
private String Name;
/**
* 数量
*/
@ApiModelProperty("Amount")
private Float Amount;
/**
* 项目经理
*/
......@@ -93,21 +106,19 @@ public class TProcessesAuxiliaryQuery {
@ApiModelProperty("Bz")
private String Bz;
@ApiModelProperty("ConsumeDate")
@DateTimeFormat(pattern = "yyyy-mm-hh")
private LocalDateTime ConsumeDate;
/**
* 日期标记,如:2021年01月
*/
@ApiModelProperty("Tag")
private String Tag;
/**
* 是否从出库单传过来的,若是,则计算成本的时候,不在把它包含在内
*/
@ApiModelProperty("Flag;")
private Boolean Flag;
// /**
// * 司机
// */
// @ApiModelProperty("Driver")
// private String Driver;
// /**
// * 作业日期
// */
// @ApiModelProperty("作业日期")
// private String Zyrq;
}
package cn.wise.sc.acquisition.business.service.impl;
import cn.hutool.core.date.DateTime;
import cn.wise.sc.acquisition.business.constant.Rcode;
import cn.wise.sc.acquisition.business.entity.TProcessesAuxiliary;
import cn.wise.sc.acquisition.business.entity.TProcessesDigging;
......@@ -22,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
......@@ -137,6 +139,7 @@ public class TProcessesAuxiliaryServiceImpl extends ServiceImpl<TProcessesAuxili
if (query.getLjyl() != 0 && query.getDyljcl() == 0) {
return R.failed("辅助工序中->当月累计油量Ljyl 不为0时,当月累计产量Dyljcl不能为0,分母不能为0");
}
query.setFlag(false);
//条件封装
TProcessesAuxiliary tProcessesAuxiliary = new TProcessesAuxiliary();
BeanUtils.copyProperties(query, tProcessesAuxiliary);
......
......@@ -22,12 +22,15 @@ import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
......@@ -261,8 +264,8 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses
queryWrapper.eq(new StringBuilder(ProjectEnum.TableAlias.A.getLabel()).append(ProjectEnum.TProcessesBlastdesignHole.STEP_NAME.getLabel()).toString(), query.getStepName());
queryWrapper.eq(new StringBuilder(ProjectEnum.TableAlias.A.getLabel()).append(ProjectEnum.TProcessesBlastdesignHole.STOPE_NAME.getLabel()).toString(), query.getStopeName());
queryWrapper.eq(new StringBuilder(ProjectEnum.TableAlias.A.getLabel()).append(ProjectEnum.TProcessesBlastdesignHole.Blast_Area_Name.getLabel()).toString(), query.getBlastAreaName());
TProcessesBlastdesignHoleVo holeVo = baseMapper.getByQuery(queryWrapper);
if (holeVo != null) {
List<TProcessesBlastdesignHoleVo> holeVo = baseMapper.getByQuery(queryWrapper);
if (CollectionUtils.isNotEmpty(holeVo)) {
return R.failed("炮孔设计中->泡孔设计中爆区已存在,StopeName,StepName,BlastAreaName");
}
//条件封装
......@@ -335,7 +338,12 @@ public class TProcessesBlastdesignHoleServiceImpl extends ServiceImpl<TProcesses
uid.append(ProjectEnum.TableAlias.A.getLabel()).append(ProjectEnum.TProcessesBlastdesignHole.UID.getLabel());
queryWrapper.eq(uid.toString(), query.getUid());
//查询并且返回
return R.ok(baseMapper.getByQuery(queryWrapper));
List<TProcessesBlastdesignHoleVo> data = baseMapper.getByQuery(queryWrapper);
if (null != data && data.size() != 1) {
log.error("炮孔设计中->根据uid获取数据出现多条数据:{}", JSON.toJSONString(data));
return R.failed("炮孔设计中->根据uid获取数据出现多条数据");
}
return R.ok(data.get(0));
}
......
server:
port: 8080
#-Dspring.config.location=D:\idea_workspases\tianjin-acquisition\acquisition-business\src\main\resources\application.yml
spring:
application: data-acquisition
profiles:
active: pord
datasource:
url: jdbc:sqlserver://192.168.10.16:1433;DatabaseName=CementMine
username: sa
password: fupingc@556
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
hikari:
minimum-idle: 3
maximum-pool-size: 10
max-lifetime: 30000 #不能小于30秒,否则默认回到1800秒
connection-test-query: SELECT 1
redis:
port: 6379
host: localhost
# password: Wise_@123456
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
# 设置swagger用户名密码
swagger:
basic:
enable: false
username: admin
password: admin
mybatis-plus:
# 启动时是否检查MyBatis XML文件是否存在
check-config-location: true
type-aliases-package: cn.wise.sc.acquisition.business.entity.**
mapper-locations: classpath:/cn/wise/sc/acquisition/business/mapper/xml/*Mapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.wise.sc.acquisition.business.mapper.TEquipmentCheckContentMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.wise.sc.acquisition.business.mapper.TEquipmentCheckDetailMapper">
<select id="getDetailList" resultType="cn.wise.sc.acquisition.business.model.vo.TEquipmentCheckMainVo">
select tecm.*
from T_Equipment_Check_Main tecm
<include refid="where"/>
order by tecm.Djrq desc
</select>
<sql id="where">
<where>
<if test="params.selectMonth != null and params.selectMonth != ''">
and tecm.Tag = #{params.selectMonth}
</if>
<if test="params.EquipmentName != null and params.EquipmentName != ''">
and tecm.EquipmentName like concat('%', #{params.EquipmentName}, '%')
</if>
</where>
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.wise.sc.acquisition.business.mapper.TMaterialInventoryMapper">
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment