1、增加登录系统日志
2、修改上传文件,名称判断错误问题
3、修改单据新增时,仓库判断问题
4个文件已添加
4个文件已修改
619 ■■■■■ 已修改文件
consum-base/src/main/java/com/consum/base/controller/FinSysTenantController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/controller/LWhFormTransferController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/controller/SLoginInfoController.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/service/LWhGoodsService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/service/SLoginInfoServiceImp.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/service/impl/LWhGoodsServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-model-pojo/src/main/java/com/consum/model/po/SLoginInfo.java 249 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-model-pojo/src/main/java/com/consum/model/po/SLoginInfo_mapper.java 299 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/controller/FinSysTenantController.java
@@ -426,7 +426,7 @@
    @PostMapping("import")
    public ResponseValue upload(@RequestParam Long pid, MultipartFile file) throws IOException {
        String originalFilename = file.getOriginalFilename();
        if (!"xls".endsWith(originalFilename)) {
        if (!originalFilename.endsWith("xls")) {
            return ResponseValue.error("文件格式有误!");
        }
        FinSysTenantUser sysInfo = this.getSysInfo();
consum-base/src/main/java/com/consum/base/controller/LWhFormTransferController.java
@@ -135,7 +135,7 @@
                baseWarehouseService.getBaseWareHouseList(Long.valueOf(agencyId), StatesType.NORMAL.getValue());
            Set<Long> wareHouseIds = baseWarehouseList.stream().map(BaseWarehouse::getId).collect(Collectors.toSet());
            // 通过调拨单中的型号id查询出该型号物品所在的仓库位置
            List<GoodsInfoDTO> goodsInfoDTOS = lWhGoodsService.queryGoodsInfo(baseModelIds, wareHouseIds);
            List<GoodsInfoDTO> goodsInfoDTOS = lWhGoodsService.queryGoodsInfo(baseModelIds, wareHouseIds,null);
            GoodsInfoDTO goodsInfoDTO = goodsInfoDTOS.stream().findFirst().orElse(null);
            if (ObjectUtils.isEmpty(goodsInfoDTO)) {
                return ResponseValue.error("该型号没有库存可使用");
@@ -302,7 +302,7 @@
        Set<Long> wareHouseIds = baseWarehouseList.stream().map(BaseWarehouse::getId).collect(Collectors.toSet());
        // 通过调拨单中的型号id查询出该型号物品所在的仓库位置
        List<GoodsInfoDTO> goodsInfoDTOS = lWhGoodsService.queryGoodsInfo(baseModelIds, wareHouseIds);
        List<GoodsInfoDTO> goodsInfoDTOS = lWhGoodsService.queryGoodsInfo(baseModelIds, wareHouseIds,1);
        GoodsInfoDTO goodsInfoDTO = goodsInfoDTOS.stream().findFirst().orElse(null);
        if (ObjectUtils.isEmpty(goodsInfoDTO)) {
            return ResponseValue.error("该型号没有库存可使用");
consum-base/src/main/java/com/consum/base/controller/SLoginInfoController.java
New file
@@ -0,0 +1,25 @@
package com.consum.base.controller;
import com.consum.base.service.SLoginInfoServiceImp;
import com.consum.model.po.SLoginInfo;
import com.walker.db.page.GenericPager;
import com.walker.web.ResponseValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/pc/p/login/info")
public class SLoginInfoController {
    @Autowired
    private SLoginInfoServiceImp sLoginInfoService;
    @GetMapping("/list")
    public ResponseValue list(String userName) {
        GenericPager<SLoginInfo> list = sLoginInfoService.list(userName);
        return ResponseValue.success(list);
    }
}
consum-base/src/main/java/com/consum/base/service/LWhGoodsService.java
@@ -55,5 +55,5 @@
     */
    GoodsModelCountDTO queryGoodsAmount(Long baseGoodsModelsId, Integer type);
    List<GoodsInfoDTO> queryGoodsInfo(Set<Long> baseModelIds, Set<Long> wareHouseIds);
    List<GoodsInfoDTO> queryGoodsInfo(Set<Long> baseModelIds, Set<Long> wareHouseIds, Integer buyType);
}
consum-base/src/main/java/com/consum/base/service/SLoginInfoServiceImp.java
New file
@@ -0,0 +1,30 @@
package com.consum.base.service;
import com.consum.model.po.SLoginInfo;
import com.consum.model.po.SLoginInfo_mapper;
import com.walker.db.Sorts;
import com.walker.db.page.GenericPager;
import com.walker.infrastructure.utils.StringUtils;
import com.walker.jdbc.service.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import static com.walker.db.Sorts.DESC;
@Service
public class SLoginInfoServiceImp extends BaseServiceImpl {
    public GenericPager<SLoginInfo> list(String userName) {
        String sql = "select * from s_login_info where 1=1 ";
        Map<String, Object> param = new HashMap<>();
        if (StringUtils.isNotEmpty(userName)) {
            sql += "and user_name like :userName";
            param.put("userName", "%" + userName + "%");
        }
        Sorts.Sort desc = DESC();
        desc.setField("login_time");
        return this.selectSplit(sql, param, SLoginInfo_mapper.ROW_MAPPER, desc);
    }
}
consum-base/src/main/java/com/consum/base/service/impl/LWhGoodsServiceImpl.java
@@ -354,16 +354,20 @@
    }
    @Override
    public List<GoodsInfoDTO> queryGoodsInfo(Set<Long> baseModelIds, Set<Long> wareHouseIds) {
    public List<GoodsInfoDTO> queryGoodsInfo(Set<Long> baseModelIds, Set<Long> wareHouseIds,Integer buyType) {
        List<GoodsInfoDTO> goodsInfoDTOS = Lists.newArrayList();
        StringBuilder sql = new StringBuilder(
            "SELECT distinct WAREHOUSE_ID,WAREHOUSE_NAME from L_WH_GOODS where base_goods_models_id in (:baseGoodsModelsIds) "
                + "and WAREHOUSE_TYPE =0 and BUY_TYPE =1 and states =1 and WAREHOUSE_ID in (:wareHouseIds)");
                + "and WAREHOUSE_TYPE =0 and states =1 and WAREHOUSE_ID in (:wareHouseIds) ");
        Map<String, Object> param = new HashMap<>();
        if (!CollectionUtils.isEmpty(baseModelIds)) {
            param.put("baseGoodsModelsIds", baseModelIds);
        }
        if (buyType != null) {
            sql.append("and BUY_TYPE =:buyType ");
            param.put("buyType", buyType);
        }
        param.put("wareHouseIds", wareHouseIds);
        List<Map<String, Object>> result = this.select(sql.toString(), param, new MapperUtil());
        result.forEach(item -> {
consum-model-pojo/src/main/java/com/consum/model/po/SLoginInfo.java
New file
@@ -0,0 +1,249 @@
package com.consum.model.po;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.walker.jdbc.BasePo;
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public class SLoginInfo extends BasePo<SLoginInfo> {
    // 序列化版本号
    private static final long serialVersionUID = 1L;
    // 主键
    private Long infoId = null;
    @JsonIgnore
    protected boolean isset_info_id = false;
    // 属性列表
    private String userName = null;
    @JsonIgnore
    protected boolean isset_user_name = false;
    private String ipaddr = null;
    @JsonIgnore
    protected boolean isset_ipaddr = false;
    private String loginLocation = null;
    @JsonIgnore
    protected boolean isset_login_location = false;
    private String browser = null;
    @JsonIgnore
    protected boolean isset_browser = false;
    private String os = null;
    @JsonIgnore
    protected boolean isset_os = false;
    private String status = null;
    @JsonIgnore
    protected boolean isset_status = false;
    private String msg = null;
    @JsonIgnore
    protected boolean isset_msg = false;
    private Long loginTime = null;
    @JsonIgnore
    protected boolean isset_login_time = false;
    /**
     * 默认构造函数
     */
    public SLoginInfo() {
    }
    /**
     * 根据主键构造对象
     */
    public SLoginInfo(Long info_id) {
        this.setInfoId(info_id);
    }
    /**
     * 设置主键值
     */
    @Override
    public void setPkValue(Object value) {
        this.setInfoId((Long)value);
    }
    public Long getInfoId() {
        return this.infoId;
    }
    public void setInfoId(Long infoId) {
        this.infoId = infoId;
        this.isset_info_id = true;
    }
    @JsonIgnore
    public boolean isEmptyInfoId() {
        return this.infoId == null;
    }
    public String getUserName() {
        return this.userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
        this.isset_user_name = true;
    }
    @JsonIgnore
    public boolean isEmptyUserName() {
        return this.userName == null || this.userName.length() == 0;
    }
    public String getIpaddr() {
        return this.ipaddr;
    }
    public void setIpaddr(String ipaddr) {
        this.ipaddr = ipaddr;
        this.isset_ipaddr = true;
    }
    @JsonIgnore
    public boolean isEmptyIpaddr() {
        return this.ipaddr == null || this.ipaddr.length() == 0;
    }
    public String getLoginLocation() {
        return this.loginLocation;
    }
    public void setLoginLocation(String loginLocation) {
        this.loginLocation = loginLocation;
        this.isset_login_location = true;
    }
    @JsonIgnore
    public boolean isEmptyLoginLocation() {
        return this.loginLocation == null || this.loginLocation.length() == 0;
    }
    public String getBrowser() {
        return this.browser;
    }
    public void setBrowser(String browser) {
        this.browser = browser;
        this.isset_browser = true;
    }
    @JsonIgnore
    public boolean isEmptyBrowser() {
        return this.browser == null || this.browser.length() == 0;
    }
    public String getOs() {
        return this.os;
    }
    public void setOs(String os) {
        this.os = os;
        this.isset_os = true;
    }
    @JsonIgnore
    public boolean isEmptyOs() {
        return this.os == null || this.os.length() == 0;
    }
    public String getStatus() {
        return this.status;
    }
    public void setStatus(String status) {
        this.status = status;
        this.isset_status = true;
    }
    @JsonIgnore
    public boolean isEmptyStatus() {
        return this.status == null || this.status.length() == 0;
    }
    public String getMsg() {
        return this.msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
        this.isset_msg = true;
    }
    @JsonIgnore
    public boolean isEmptyMsg() {
        return this.msg == null || this.msg.length() == 0;
    }
    public Long getLoginTime() {
        return this.loginTime;
    }
    public void setLoginTime(Long loginTime) {
        this.loginTime = loginTime;
        this.isset_login_time = true;
    }
    @JsonIgnore
    public boolean isEmptyLoginTime() {
        return this.loginTime == null;
    }
    /**
     * 重写 toString() 方法
     */
    @Override
    public String toString() {
        return new StringBuilder().append("info_id=").append(this.infoId).append("user_name=").append(this.userName)
                .append("ipaddr=").append(this.ipaddr).append("login_location=").append(this.loginLocation)
                .append("browser=").append(this.browser).append("os=").append(this.os).append("status=").append(this.status)
                .append("msg=").append(this.msg).append("login_time=").append(this.loginTime).toString();
    }
    /**
     * 克隆
     */
    public SLoginInfo $clone() {
        SLoginInfo s_login_info = new SLoginInfo();
        // 数据库名称
        //s_login_info.setDatabaseName_(this.getDatabaseName_());
        // 主键
        if (this.isset_info_id) {
            s_login_info.setInfoId(this.getInfoId());
        }
        // 普通属性
        if (this.isset_user_name) {
            s_login_info.setUserName(this.getUserName());
        }
        if (this.isset_ipaddr) {
            s_login_info.setIpaddr(this.getIpaddr());
        }
        if (this.isset_login_location) {
            s_login_info.setLoginLocation(this.getLoginLocation());
        }
        if (this.isset_browser) {
            s_login_info.setBrowser(this.getBrowser());
        }
        if (this.isset_os) {
            s_login_info.setOs(this.getOs());
        }
        if (this.isset_status) {
            s_login_info.setStatus(this.getStatus());
        }
        if (this.isset_msg) {
            s_login_info.setMsg(this.getMsg());
        }
        if (this.isset_login_time) {
            s_login_info.setLoginTime(this.getLoginTime());
        }
        return s_login_info;
    }
}
consum-model-pojo/src/main/java/com/consum/model/po/SLoginInfo_mapper.java
New file
@@ -0,0 +1,299 @@
package com.consum.model.po;
import com.walker.jdbc.BaseMapper;
import com.walker.jdbc.ResultSetUtils;
import com.walker.jdbc.SqlAndParameters;
import com.walker.jdbc.sqlgen.DeleteBuilder;
import com.walker.jdbc.sqlgen.InsertBuilder;
import com.walker.jdbc.sqlgen.SelectBuilder;
import com.walker.jdbc.sqlgen.UpdateBuilder;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;
public class SLoginInfo_mapper extends SLoginInfo implements BaseMapper<SLoginInfo> {
    // 序列化版本号
    private static final long serialVersionUID = 1L;
    public static final RowMapper<SLoginInfo> ROW_MAPPER = new SLoginInfoRowMapper();
    // 主键
    public static final String INFO_ID = "info_id";
    // 普通属性
    public static final String USER_NAME = "user_name";
    public static final String IPADDR = "ipaddr";
    public static final String LOGIN_LOCATION = "login_location";
    public static final String BROWSER = "browser";
    public static final String OS = "os";
    public static final String STATUS = "status";
    public static final String MSG = "msg";
    public static final String LOGIN_TIME = "login_time";
    /**
     * 默认构造函数
     */
    public SLoginInfo_mapper(SLoginInfo sLoginInfo) {
        if (sLoginInfo == null) {
            throw new IllegalArgumentException("po参数不允许为空!");
        }
        //主键
        if (sLoginInfo.isset_info_id) {
            this.setInfoId(sLoginInfo.getInfoId());
        }
        //普通属性
        if (sLoginInfo.isset_user_name) {
            this.setUserName(sLoginInfo.getUserName());
        }
        if (sLoginInfo.isset_ipaddr) {
            this.setIpaddr(sLoginInfo.getIpaddr());
        }
        if (sLoginInfo.isset_login_location) {
            this.setLoginLocation(sLoginInfo.getLoginLocation());
        }
        if (sLoginInfo.isset_browser) {
            this.setBrowser(sLoginInfo.getBrowser());
        }
        if (sLoginInfo.isset_os) {
            this.setOs(sLoginInfo.getOs());
        }
        if (sLoginInfo.isset_status) {
            this.setStatus(sLoginInfo.getStatus());
        }
        if (sLoginInfo.isset_msg) {
            this.setMsg(sLoginInfo.getMsg());
        }
        if (sLoginInfo.isset_login_time) {
            this.setLoginTime(sLoginInfo.getLoginTime());
        }
    }
    /**
     * 获取表名
     */
    @Override
    public String getTableName_() {
        String tableName = "s_login_info";
        return tableName;
    }
    /**
     * 获取主键名称
     */
    @Override
    public String getPkName_() {
        return INFO_ID;
    }
    /**
     * 获取主键值
     */
    @Override
    public Object getPkValue_() {
        return this.getInfoId();
    }
    /**
     * 获取插入语句和参数
     */
    @Override
    public SqlAndParameters<Map<String, Object>> getInsertSql_() {
        InsertBuilder ib = new InsertBuilder(this.getTableName_());
        ib.set(INFO_ID, this.getInfoId());
        ib.set(USER_NAME, this.getUserName(), this.isset_user_name);
        ib.set(IPADDR, this.getIpaddr(), this.isset_ipaddr);
        ib.set(LOGIN_LOCATION, this.getLoginLocation(), this.isset_login_location);
        ib.set(BROWSER, this.getBrowser(), this.isset_browser);
        ib.set(OS, this.getOs(), this.isset_os);
        ib.set(STATUS, this.getStatus(), this.isset_status);
        ib.set(MSG, this.getMsg(), this.isset_msg);
        ib.set(LOGIN_TIME, this.getLoginTime(), this.isset_login_time);
        return ib.genMapSql();
    }
    /**
     * 获取更新语句和参数
     */
    @Override
    public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
        UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
        ub.set(USER_NAME, this.getUserName(), this.isset_user_name);
        ub.set(IPADDR, this.getIpaddr(), this.isset_ipaddr);
        ub.set(LOGIN_LOCATION, this.getLoginLocation(), this.isset_login_location);
        ub.set(BROWSER, this.getBrowser(), this.isset_browser);
        ub.set(OS, this.getOs(), this.isset_os);
        ub.set(STATUS, this.getStatus(), this.isset_status);
        ub.set(MSG, this.getMsg(), this.isset_msg);
        ub.set(LOGIN_TIME, this.getLoginTime(), this.isset_login_time);
        ub.where(this.getPkName_(), this.getPkValue_());
        return ub.genMapSql();
    }
    /**
     * 获取更新语句和参数
     */
    @Override
    public SqlAndParameters<Map<String, Object>> getUpdateSql_(String where, Map<String, Object> parameters) {
        UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
        ub.set(USER_NAME, this.getUserName(), this.isset_user_name);
        ub.set(IPADDR, this.getIpaddr(), this.isset_ipaddr);
        ub.set(LOGIN_LOCATION, this.getLoginLocation(), this.isset_login_location);
        ub.set(BROWSER, this.getBrowser(), this.isset_browser);
        ub.set(OS, this.getOs(), this.isset_os);
        ub.set(STATUS, this.getStatus(), this.isset_status);
        ub.set(MSG, this.getMsg(), this.isset_msg);
        ub.set(LOGIN_TIME, this.getLoginTime(), this.isset_login_time);
        return ub.genMapSql(where, parameters);
    }
    /**
     * 获取更新语句和参数
     */
    @Override
    public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
        UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
        ub.set(USER_NAME, this.getUserName(), this.isset_user_name);
        ub.set(IPADDR, this.getIpaddr(), this.isset_ipaddr);
        ub.set(LOGIN_LOCATION, this.getLoginLocation(), this.isset_login_location);
        ub.set(BROWSER, this.getBrowser(), this.isset_browser);
        ub.set(OS, this.getOs(), this.isset_os);
        ub.set(STATUS, this.getStatus(), this.isset_status);
        ub.set(MSG, this.getMsg(), this.isset_msg);
        ub.set(LOGIN_TIME, this.getLoginTime(), this.isset_login_time);
        return ub.genArraySql(where, parameters);
    }
    /**
     * 获取删除语句和参数
     */
    @Override
    public SqlAndParameters<Map<String, Object>> getDeleteSql_() {
        DeleteBuilder db = new DeleteBuilder(this.getTableName_());
        db.where(this.getPkName_(), this.getPkValue_());
        return db.genMapSql();
    }
    /**
     * 获取删除语句和参数
     */
    @Override
    public SqlAndParameters<Map<String, Object>> getDeleteSql_(String where, Map<String, Object> parameters) {
        DeleteBuilder db = new DeleteBuilder(this.getTableName_());
        return db.genMapSql(where, parameters);
    }
    /**
     * 获取删除语句和参数
     */
    @Override
    public SqlAndParameters<Object[]> getDeleteSql_(String where, Object[] parameters) {
        DeleteBuilder db = new DeleteBuilder(this.getTableName_());
        return db.genArraySql(where, parameters);
    }
    /**
     * 获取单行查询语句和参数
     */
    @Override
    public SqlAndParameters<Map<String, Object>> getSingleSql_() {
        SelectBuilder sb = new SelectBuilder(this.getTableName_());
        sb.where(this.getPkName_(), this.getPkValue_());
        return sb.genMapSql();
    }
    /**
     * 获取查询语句和参数
     */
    @Override
    public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) {
        return new SqlAndParameters<>(
                "select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from "
                        + this.getTableName_() + " " + where, parameters);
    }
    /**
     * 获取查询语句和参数
     */
    @Override
    public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
        return new SqlAndParameters<>(
                "select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from "
                        + this.getTableName_() + " " + where, parameters);
    }
    /**
     * 将resultset的一行转化为po
     */
    @Override
    public SLoginInfo mapRow(ResultSet rs, int i) throws SQLException {
        return ROW_MAPPER.mapRow(rs, i);
    }
    /**
     * 克隆
     */
    public SLoginInfo toSLoginInfo() {
        return super.$clone();
    }
}
/**
 * s_login_info RowMapper
 *
 * @author genrator
 */
class SLoginInfoRowMapper implements RowMapper<SLoginInfo> {
    @Override
    public SLoginInfo mapRow(ResultSet rs, int i) throws SQLException {
        ResultSetUtils resultSetUtils = new ResultSetUtils();
        SLoginInfo s_login_info = new SLoginInfo();
        Integer columnIndex;
        //主键
        columnIndex = resultSetUtils.findColumn(rs, SLoginInfo_mapper.INFO_ID);
        if (columnIndex > 0) {
            s_login_info.setInfoId(rs.getLong(columnIndex));
        }
        //普通属性
        columnIndex = resultSetUtils.findColumn(rs, SLoginInfo_mapper.USER_NAME);
        if (columnIndex > 0) {
            s_login_info.setUserName(rs.getString(columnIndex));
        }
        columnIndex = resultSetUtils.findColumn(rs, SLoginInfo_mapper.IPADDR);
        if (columnIndex > 0) {
            s_login_info.setIpaddr(rs.getString(columnIndex));
        }
        columnIndex = resultSetUtils.findColumn(rs, SLoginInfo_mapper.LOGIN_LOCATION);
        if (columnIndex > 0) {
            s_login_info.setLoginLocation(rs.getString(columnIndex));
        }
        columnIndex = resultSetUtils.findColumn(rs, SLoginInfo_mapper.BROWSER);
        if (columnIndex > 0) {
            s_login_info.setBrowser(rs.getString(columnIndex));
        }
        columnIndex = resultSetUtils.findColumn(rs, SLoginInfo_mapper.OS);
        if (columnIndex > 0) {
            s_login_info.setOs(rs.getString(columnIndex));
        }
        columnIndex = resultSetUtils.findColumn(rs, SLoginInfo_mapper.STATUS);
        if (columnIndex > 0) {
            s_login_info.setStatus(rs.getString(columnIndex));
        }
        columnIndex = resultSetUtils.findColumn(rs, SLoginInfo_mapper.MSG);
        if (columnIndex > 0) {
            s_login_info.setMsg(rs.getString(columnIndex));
        }
        columnIndex = resultSetUtils.findColumn(rs, SLoginInfo_mapper.LOGIN_TIME);
        if (columnIndex > 0) {
            if (rs.getBigDecimal(columnIndex) == null) {
                s_login_info.setLoginTime(null);
            } else {
                s_login_info.setLoginTime(rs.getLong(columnIndex));
            }
        }
        return s_login_info;
    }
}