供应计划,仓库映射接口开发
This commit is contained in:
@@ -114,6 +114,8 @@ public class SecurityConfig
|
||||
requests.antMatchers("/login",
|
||||
"/register",
|
||||
"/captchaImage",
|
||||
"/user/**",
|
||||
"/query/jh/**",
|
||||
"/AutoInventory/**",
|
||||
"/ws/**",
|
||||
"/information/device/**",
|
||||
|
||||
@@ -178,4 +178,28 @@ public class SysLoginService
|
||||
sysUser.setLoginDate(DateUtils.getNowDate());
|
||||
userService.updateUserProfile(sysUser);
|
||||
}
|
||||
|
||||
public LoginUser loginWithoutCaptcha(String username, String password) {
|
||||
loginPreCheck(username, password);
|
||||
|
||||
Authentication authentication;
|
||||
|
||||
try {
|
||||
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, password);
|
||||
|
||||
AuthenticationContextHolder.setContext(token);
|
||||
|
||||
authentication = authenticationManager.authenticate(token);
|
||||
}catch (Exception e){
|
||||
throw new ServiceException("登录失败");
|
||||
}finally {
|
||||
AuthenticationContextHolder.clearContext();
|
||||
}
|
||||
|
||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||
|
||||
recordLoginInfo(loginUser.getUserId());
|
||||
|
||||
return loginUser;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.zg.project.Information.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zg.project.Information.domain.SceneMapping;
|
||||
import com.zg.project.Information.service.ISceneMappingService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.zg.framework.aspectj.lang.annotation.Log;
|
||||
import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.common.utils.poi.ExcelUtil;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 场景编号Controller
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/information/scene")
|
||||
public class SceneMappingController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISceneMappingService sceneMappingService;
|
||||
|
||||
/**
|
||||
* 查询场景编号列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('information:scene:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SceneMapping sceneMapping)
|
||||
{
|
||||
startPage();
|
||||
List<SceneMapping> list = sceneMappingService.selectSceneMappingList(sceneMapping);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出场景编号列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('information:scene:export')")
|
||||
@Log(title = "场景编号", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SceneMapping sceneMapping)
|
||||
{
|
||||
List<SceneMapping> list = sceneMappingService.selectSceneMappingList(sceneMapping);
|
||||
ExcelUtil<SceneMapping> util = new ExcelUtil<SceneMapping>(SceneMapping.class);
|
||||
util.exportExcel(response, list, "场景编号数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取场景编号详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('information:scene:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sceneMappingService.selectSceneMappingById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增场景编号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('information:scene:add')")
|
||||
@Log(title = "场景编号", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SceneMapping sceneMapping)
|
||||
{
|
||||
return toAjax(sceneMappingService.insertSceneMapping(sceneMapping));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场景编号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('information:scene:edit')")
|
||||
@Log(title = "场景编号", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SceneMapping sceneMapping)
|
||||
{
|
||||
return toAjax(sceneMappingService.updateSceneMapping(sceneMapping));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场景编号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('information:scene:remove')")
|
||||
@Log(title = "场景编号", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sceneMappingService.deleteSceneMappingByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.zg.project.Information.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 场景编号对象 scene_mapping
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-24
|
||||
*/
|
||||
public class SceneMapping extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 自增主键 */
|
||||
private Long id;
|
||||
|
||||
/** 场景编号 */
|
||||
@Excel(name = "场景编号")
|
||||
private String sceneCode;
|
||||
|
||||
/** 场景名称 */
|
||||
@Excel(name = "场景名称")
|
||||
private String sceneName;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSceneCode(String sceneCode)
|
||||
{
|
||||
this.sceneCode = sceneCode;
|
||||
}
|
||||
|
||||
public String getSceneCode()
|
||||
{
|
||||
return sceneCode;
|
||||
}
|
||||
|
||||
public void setSceneName(String sceneName)
|
||||
{
|
||||
this.sceneName = sceneName;
|
||||
}
|
||||
|
||||
public String getSceneName()
|
||||
{
|
||||
return sceneName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("sceneCode", getSceneCode())
|
||||
.append("sceneName", getSceneName())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
132
src/main/java/com/zg/project/Information/domain/StockInType.java
Normal file
132
src/main/java/com/zg/project/Information/domain/StockInType.java
Normal file
@@ -0,0 +1,132 @@
|
||||
package com.zg.project.Information.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 入库类型对象 stock_in_type
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-24
|
||||
*/
|
||||
public class StockInType extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 入库类型编码 */
|
||||
@Excel(name = "入库类型编码")
|
||||
private String typeCode;
|
||||
|
||||
/** 入库类型名称 */
|
||||
@Excel(name = "入库类型名称")
|
||||
private String typeName;
|
||||
|
||||
/** 状态(1=启用,0=禁用) */
|
||||
@Excel(name = "状态", readConverterExp = "1==启用,0=禁用")
|
||||
private Long status;
|
||||
|
||||
/** 排序值 */
|
||||
@Excel(name = "排序值")
|
||||
private Long sort;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setTypeCode(String typeCode)
|
||||
{
|
||||
this.typeCode = typeCode;
|
||||
}
|
||||
|
||||
public String getTypeCode()
|
||||
{
|
||||
return typeCode;
|
||||
}
|
||||
|
||||
public void setTypeName(String typeName)
|
||||
{
|
||||
this.typeName = typeName;
|
||||
}
|
||||
|
||||
public String getTypeName()
|
||||
{
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setSort(Long sort)
|
||||
{
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Long getSort()
|
||||
{
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("typeCode", getTypeCode())
|
||||
.append("typeName", getTypeName())
|
||||
.append("status", getStatus())
|
||||
.append("sort", getSort())
|
||||
.append("remark", getRemark())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
package com.zg.project.Information.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 仓库信息对象 warehouse_info
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-24
|
||||
*/
|
||||
public class WarehouseInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 仓库编码 */
|
||||
@Excel(name = "仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 仓库地址 */
|
||||
@Excel(name = "仓库地址")
|
||||
private String address;
|
||||
|
||||
/** 状态(1=启用,0=禁用) */
|
||||
@Excel(name = "状态", readConverterExp = "1==启用,0=禁用")
|
||||
private Long status;
|
||||
|
||||
/** 排序值 */
|
||||
@Excel(name = "排序值")
|
||||
private Long sort;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date createdAt;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date updatedAt;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setWarehouseCode(String warehouseCode)
|
||||
{
|
||||
this.warehouseCode = warehouseCode;
|
||||
}
|
||||
|
||||
public String getWarehouseCode()
|
||||
{
|
||||
return warehouseCode;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName)
|
||||
{
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getWarehouseName()
|
||||
{
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setAddress(String address)
|
||||
{
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress()
|
||||
{
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setSort(Long sort)
|
||||
{
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Long getSort()
|
||||
{
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Date createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Date updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("warehouseCode", getWarehouseCode())
|
||||
.append("warehouseName", getWarehouseName())
|
||||
.append("address", getAddress())
|
||||
.append("status", getStatus())
|
||||
.append("sort", getSort())
|
||||
.append("remark", getRemark())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zg.project.Information.mapper;
|
||||
|
||||
import com.zg.project.Information.domain.SceneMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 场景编号Mapper接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-24
|
||||
*/
|
||||
public interface SceneMappingMapper
|
||||
{
|
||||
/**
|
||||
* 查询场景编号
|
||||
*
|
||||
* @param id 场景编号主键
|
||||
* @return 场景编号
|
||||
*/
|
||||
public SceneMapping selectSceneMappingById(Long id);
|
||||
|
||||
/**
|
||||
* 查询场景编号列表
|
||||
*
|
||||
* @param sceneMapping 场景编号
|
||||
* @return 场景编号集合
|
||||
*/
|
||||
public List<SceneMapping> selectSceneMappingList(SceneMapping sceneMapping);
|
||||
|
||||
/**
|
||||
* 新增场景编号
|
||||
*
|
||||
* @param sceneMapping 场景编号
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSceneMapping(SceneMapping sceneMapping);
|
||||
|
||||
/**
|
||||
* 修改场景编号
|
||||
*
|
||||
* @param sceneMapping 场景编号
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSceneMapping(SceneMapping sceneMapping);
|
||||
|
||||
/**
|
||||
* 删除场景编号
|
||||
*
|
||||
* @param id 场景编号主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSceneMappingById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除场景编号
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSceneMappingByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zg.project.Information.service;
|
||||
|
||||
import com.zg.project.Information.domain.SceneMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 场景编号Service接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-24
|
||||
*/
|
||||
public interface ISceneMappingService
|
||||
{
|
||||
/**
|
||||
* 查询场景编号
|
||||
*
|
||||
* @param id 场景编号主键
|
||||
* @return 场景编号
|
||||
*/
|
||||
public SceneMapping selectSceneMappingById(Long id);
|
||||
|
||||
/**
|
||||
* 查询场景编号列表
|
||||
*
|
||||
* @param sceneMapping 场景编号
|
||||
* @return 场景编号集合
|
||||
*/
|
||||
public List<SceneMapping> selectSceneMappingList(SceneMapping sceneMapping);
|
||||
|
||||
/**
|
||||
* 新增场景编号
|
||||
*
|
||||
* @param sceneMapping 场景编号
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSceneMapping(SceneMapping sceneMapping);
|
||||
|
||||
/**
|
||||
* 修改场景编号
|
||||
*
|
||||
* @param sceneMapping 场景编号
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSceneMapping(SceneMapping sceneMapping);
|
||||
|
||||
/**
|
||||
* 批量删除场景编号
|
||||
*
|
||||
* @param ids 需要删除的场景编号主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSceneMappingByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除场景编号信息
|
||||
*
|
||||
* @param id 场景编号主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSceneMappingById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.zg.project.Information.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zg.project.Information.domain.SceneMapping;
|
||||
import com.zg.project.Information.mapper.SceneMappingMapper;
|
||||
import com.zg.project.Information.service.ISceneMappingService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 场景编号Service业务层处理
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-24
|
||||
*/
|
||||
@Service
|
||||
public class SceneMappingServiceImpl implements ISceneMappingService
|
||||
{
|
||||
@Autowired
|
||||
private SceneMappingMapper sceneMappingMapper;
|
||||
|
||||
/**
|
||||
* 查询场景编号
|
||||
*
|
||||
* @param id 场景编号主键
|
||||
* @return 场景编号
|
||||
*/
|
||||
@Override
|
||||
public SceneMapping selectSceneMappingById(Long id)
|
||||
{
|
||||
return sceneMappingMapper.selectSceneMappingById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场景编号列表
|
||||
*
|
||||
* @param sceneMapping 场景编号
|
||||
* @return 场景编号
|
||||
*/
|
||||
@Override
|
||||
public List<SceneMapping> selectSceneMappingList(SceneMapping sceneMapping)
|
||||
{
|
||||
return sceneMappingMapper.selectSceneMappingList(sceneMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增场景编号
|
||||
*
|
||||
* @param sceneMapping 场景编号
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSceneMapping(SceneMapping sceneMapping)
|
||||
{
|
||||
return sceneMappingMapper.insertSceneMapping(sceneMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场景编号
|
||||
*
|
||||
* @param sceneMapping 场景编号
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSceneMapping(SceneMapping sceneMapping)
|
||||
{
|
||||
return sceneMappingMapper.updateSceneMapping(sceneMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除场景编号
|
||||
*
|
||||
* @param ids 需要删除的场景编号主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSceneMappingByIds(Long[] ids)
|
||||
{
|
||||
return sceneMappingMapper.deleteSceneMappingByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场景编号信息
|
||||
*
|
||||
* @param id 场景编号主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSceneMappingById(Long id)
|
||||
{
|
||||
return sceneMappingMapper.deleteSceneMappingById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.zg.project.wisdom.login;
|
||||
|
||||
import com.zg.common.constant.Constants;
|
||||
import com.zg.framework.security.LoginBody;
|
||||
import com.zg.framework.security.LoginUser;
|
||||
import com.zg.framework.security.service.SysLoginService;
|
||||
import com.zg.framework.security.service.TokenService;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class LoginController {
|
||||
|
||||
@Autowired
|
||||
private SysLoginService loginService;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
/**
|
||||
* 登录方法
|
||||
*
|
||||
* @param loginBody 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody) {
|
||||
String username = loginBody.getUsername();
|
||||
String password = loginBody.getPassword();
|
||||
|
||||
LoginUser loginUser = loginService.loginWithoutCaptcha(username, password);
|
||||
|
||||
String token = tokenService.createToken(loginUser);
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("token", token);
|
||||
data.put("user", loginUser.getUser());
|
||||
|
||||
return AjaxResult.success(data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.zg.project.wisdom.plan.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zg.framework.aspectj.lang.annotation.Log;
|
||||
import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.zg.project.wisdom.plan.domain.GysJh;
|
||||
import com.zg.project.wisdom.plan.service.IGysJhService;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.common.utils.poi.ExcelUtil;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 供应计划Controller
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/plan/jh")
|
||||
public class GysJhController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IGysJhService gysJhService;
|
||||
|
||||
/**
|
||||
* 查询供应计划列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('query:jh:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(GysJh gysJh) {
|
||||
|
||||
startPage();
|
||||
List<GysJh> list = gysJhService.selectGysJhList(gysJh);
|
||||
return getDataTable(list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出供应计划列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('query:jh:export')")
|
||||
@Log(title = "供应计划", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GysJh gysJh) {
|
||||
|
||||
List<GysJh> list = gysJhService.selectGysJhList(gysJh);
|
||||
ExcelUtil<GysJh> util = new ExcelUtil<GysJh>(GysJh.class);
|
||||
util.exportExcel(response, list, "供应计划数据");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应计划详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('query:jh:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
|
||||
return success(gysJhService.selectGysJhById(id));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应计划
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('query:jh:add')")
|
||||
@Log(title = "供应计划", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody GysJh gysJh) {
|
||||
|
||||
return toAjax(gysJhService.insertGysJh(gysJh));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 供应计划导入
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('query:jh:import')")
|
||||
@Log(title = "供应计划", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/import")
|
||||
public AjaxResult importData(@RequestParam("file") MultipartFile file, boolean updateSupport) throws IOException {
|
||||
|
||||
ExcelUtil<GysJh> util = new ExcelUtil<>(GysJh.class);
|
||||
List<GysJh> list = util.importExcel(file.getInputStream());
|
||||
String operator = getUsername();
|
||||
String message = gysJhService.importGysJh(list, updateSupport, "zhangsan");
|
||||
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应计划
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('query:jh:edit')")
|
||||
@Log(title = "供应计划", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
public AjaxResult edit(@RequestBody GysJh gysJh) {
|
||||
|
||||
return toAjax(gysJhService.updateGysJh(gysJh));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应计划
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('query:jh:remove')")
|
||||
@Log(title = "供应计划", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
|
||||
return toAjax(gysJhService.deleteGysJhByIds(ids));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
295
src/main/java/com/zg/project/wisdom/plan/domain/GysJh.java
Normal file
295
src/main/java/com/zg/project/wisdom/plan/domain/GysJh.java
Normal file
@@ -0,0 +1,295 @@
|
||||
package com.zg.project.wisdom.plan.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 供应计划对象 gys_jh
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-12
|
||||
*/
|
||||
public class GysJh extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 县局 */
|
||||
@Excel(name = "县局")
|
||||
private String xj;
|
||||
|
||||
/** 项目号 */
|
||||
@Excel(name = "项目号")
|
||||
private String xmNo;
|
||||
|
||||
/** 项目描述 */
|
||||
@Excel(name = "项目描述")
|
||||
private String xmMs;
|
||||
|
||||
/** 物料号 */
|
||||
@Excel(name = "物料号")
|
||||
private String wlNo;
|
||||
|
||||
/** 物料描述 */
|
||||
@Excel(name = "物料描述")
|
||||
private String wlMs;
|
||||
|
||||
/** 供应商编码 */
|
||||
@Excel(name = "供应商编码")
|
||||
private String gysNo;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商名称")
|
||||
private String gysMc;
|
||||
|
||||
/** 计划交货金额 */
|
||||
@Excel(name = "计划交货金额")
|
||||
private BigDecimal jhAmt;
|
||||
|
||||
/** 合同单价 */
|
||||
@Excel(name = "合同单价")
|
||||
private BigDecimal htDj;
|
||||
|
||||
/** SAP订单编号 */
|
||||
@Excel(name = "SAP订单编号")
|
||||
private String sapNo;
|
||||
|
||||
/** 行号 */
|
||||
@Excel(name = "行号")
|
||||
private String xh;
|
||||
|
||||
/** 计划交货数量 */
|
||||
@Excel(name = "计划交货数量")
|
||||
private Long jhQty;
|
||||
|
||||
/** 合同数量 */
|
||||
@Excel(name = "合同数量")
|
||||
private Long htQty;
|
||||
|
||||
/** 计量单位 */
|
||||
@Excel(name = "计量单位")
|
||||
private String dw;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0:未到货,1:已入库")
|
||||
private String status;
|
||||
|
||||
/** 是否删除(0正常 1删除) */
|
||||
@Excel(name = "是否删除", readConverterExp = "0=正常,1=删除")
|
||||
private String isDelete;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setXj(String xj)
|
||||
{
|
||||
this.xj = xj;
|
||||
}
|
||||
|
||||
public String getXj()
|
||||
{
|
||||
return xj;
|
||||
}
|
||||
|
||||
public void setXmNo(String xmNo)
|
||||
{
|
||||
this.xmNo = xmNo;
|
||||
}
|
||||
|
||||
public String getXmNo()
|
||||
{
|
||||
return xmNo;
|
||||
}
|
||||
|
||||
public void setXmMs(String xmMs)
|
||||
{
|
||||
this.xmMs = xmMs;
|
||||
}
|
||||
|
||||
public String getXmMs()
|
||||
{
|
||||
return xmMs;
|
||||
}
|
||||
|
||||
public void setWlNo(String wlNo)
|
||||
{
|
||||
this.wlNo = wlNo;
|
||||
}
|
||||
|
||||
public String getWlNo()
|
||||
{
|
||||
return wlNo;
|
||||
}
|
||||
|
||||
public void setWlMs(String wlMs)
|
||||
{
|
||||
this.wlMs = wlMs;
|
||||
}
|
||||
|
||||
public String getWlMs()
|
||||
{
|
||||
return wlMs;
|
||||
}
|
||||
|
||||
public void setGysNo(String gysNo)
|
||||
{
|
||||
this.gysNo = gysNo;
|
||||
}
|
||||
|
||||
public String getGysNo()
|
||||
{
|
||||
return gysNo;
|
||||
}
|
||||
|
||||
public void setGysMc(String gysMc)
|
||||
{
|
||||
this.gysMc = gysMc;
|
||||
}
|
||||
|
||||
public String getGysMc()
|
||||
{
|
||||
return gysMc;
|
||||
}
|
||||
|
||||
public void setJhAmt(BigDecimal jhAmt)
|
||||
{
|
||||
this.jhAmt = jhAmt;
|
||||
}
|
||||
|
||||
public BigDecimal getJhAmt()
|
||||
{
|
||||
return jhAmt;
|
||||
}
|
||||
|
||||
public void setHtDj(BigDecimal htDj)
|
||||
{
|
||||
this.htDj = htDj;
|
||||
}
|
||||
|
||||
public BigDecimal getHtDj()
|
||||
{
|
||||
return htDj;
|
||||
}
|
||||
|
||||
public void setSapNo(String sapNo)
|
||||
{
|
||||
this.sapNo = sapNo;
|
||||
}
|
||||
|
||||
public String getSapNo()
|
||||
{
|
||||
return sapNo;
|
||||
}
|
||||
|
||||
public void setXh(String xh)
|
||||
{
|
||||
this.xh = xh;
|
||||
}
|
||||
|
||||
public String getXh()
|
||||
{
|
||||
return xh;
|
||||
}
|
||||
|
||||
public void setJhQty(Long jhQty)
|
||||
{
|
||||
this.jhQty = jhQty;
|
||||
}
|
||||
|
||||
public Long getJhQty()
|
||||
{
|
||||
return jhQty;
|
||||
}
|
||||
|
||||
public void setHtQty(Long htQty)
|
||||
{
|
||||
this.htQty = htQty;
|
||||
}
|
||||
|
||||
public Long getHtQty()
|
||||
{
|
||||
return htQty;
|
||||
}
|
||||
|
||||
public void setDw(String dw)
|
||||
{
|
||||
this.dw = dw;
|
||||
}
|
||||
|
||||
public String getDw()
|
||||
{
|
||||
return dw;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("xj", getXj())
|
||||
.append("xmNo", getXmNo())
|
||||
.append("xmMs", getXmMs())
|
||||
.append("wlNo", getWlNo())
|
||||
.append("wlMs", getWlMs())
|
||||
.append("gysNo", getGysNo())
|
||||
.append("gysMc", getGysMc())
|
||||
.append("jhAmt", getJhAmt())
|
||||
.append("htDj", getHtDj())
|
||||
.append("sapNo", getSapNo())
|
||||
.append("xh", getXh())
|
||||
.append("jhQty", getJhQty())
|
||||
.append("htQty", getHtQty())
|
||||
.append("dw", getDw())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("status", getStatus())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.zg.project.wisdom.plan.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zg.project.wisdom.plan.domain.GysJh;
|
||||
|
||||
/**
|
||||
* 供应计划Mapper接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-12
|
||||
*/
|
||||
public interface GysJhMapper
|
||||
{
|
||||
/**
|
||||
* 查询供应计划
|
||||
*
|
||||
* @param id 供应计划主键
|
||||
* @return 供应计划
|
||||
*/
|
||||
public GysJh selectGysJhById(Long id);
|
||||
|
||||
/**
|
||||
* 查询供应计划列表
|
||||
*
|
||||
* @param gysJh 供应计划
|
||||
* @return 供应计划集合
|
||||
*/
|
||||
public List<GysJh> selectGysJhList(GysJh gysJh);
|
||||
|
||||
/**
|
||||
* 新增供应计划
|
||||
*
|
||||
* @param gysJh 供应计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGysJh(GysJh gysJh);
|
||||
|
||||
/**
|
||||
* 修改供应计划
|
||||
*
|
||||
* @param gysJh 供应计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGysJh(GysJh gysJh);
|
||||
|
||||
/**
|
||||
* 删除供应计划
|
||||
*
|
||||
* @param id 供应计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGysJhById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除供应计划
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGysJhByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据订单号查询是否已存在
|
||||
* @param sapNo
|
||||
* @param xh
|
||||
* @return
|
||||
*/
|
||||
GysJh selectExistByKey(String sapNo, String xh);
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.zg.project.wisdom.plan.service;
|
||||
|
||||
import java.rmi.ServerException;
|
||||
import java.util.List;
|
||||
import com.zg.project.wisdom.plan.domain.GysJh;
|
||||
|
||||
/**
|
||||
* 供应计划Service接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-12
|
||||
*/
|
||||
public interface IGysJhService
|
||||
{
|
||||
/**
|
||||
* 查询供应计划
|
||||
*
|
||||
* @param id 供应计划主键
|
||||
* @return 供应计划
|
||||
*/
|
||||
public GysJh selectGysJhById(Long id);
|
||||
|
||||
/**
|
||||
* 查询供应计划列表
|
||||
*
|
||||
* @param gysJh 供应计划
|
||||
* @return 供应计划集合
|
||||
*/
|
||||
public List<GysJh> selectGysJhList(GysJh gysJh);
|
||||
|
||||
/**
|
||||
* 新增供应计划
|
||||
*
|
||||
* @param gysJh 供应计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGysJh(GysJh gysJh);
|
||||
|
||||
/**
|
||||
* 修改供应计划
|
||||
*
|
||||
* @param gysJh 供应计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGysJh(GysJh gysJh);
|
||||
|
||||
/**
|
||||
* 批量删除供应计划
|
||||
*
|
||||
* @param ids 需要删除的供应计划主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGysJhByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除供应计划信息
|
||||
*
|
||||
* @param id 供应计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGysJhById(Long id);
|
||||
|
||||
/**
|
||||
* 供应计划导入
|
||||
* @param list
|
||||
* @param updateSupport
|
||||
* @param operator
|
||||
* @return
|
||||
*/
|
||||
String importGysJh(List<GysJh> list, boolean updateSupport, String operator) throws ServerException;
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.zg.project.wisdom.plan.service.impl;
|
||||
|
||||
import java.rmi.ServerException;
|
||||
import java.util.List;
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zg.project.wisdom.plan.mapper.GysJhMapper;
|
||||
import com.zg.project.wisdom.plan.domain.GysJh;
|
||||
import com.zg.project.wisdom.plan.service.IGysJhService;
|
||||
|
||||
/**
|
||||
* 供应计划Service业务层处理
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-12
|
||||
*/
|
||||
@Service
|
||||
public class GysJhServiceImpl implements IGysJhService
|
||||
{
|
||||
@Autowired
|
||||
private GysJhMapper gysJhMapper;
|
||||
|
||||
/**
|
||||
* 查询供应计划
|
||||
*
|
||||
* @param id 供应计划主键
|
||||
* @return 供应计划
|
||||
*/
|
||||
@Override
|
||||
public GysJh selectGysJhById(Long id)
|
||||
{
|
||||
return gysJhMapper.selectGysJhById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应计划列表
|
||||
*
|
||||
* @param gysJh 供应计划
|
||||
* @return 供应计划
|
||||
*/
|
||||
@Override
|
||||
public List<GysJh> selectGysJhList(GysJh gysJh)
|
||||
{
|
||||
return gysJhMapper.selectGysJhList(gysJh);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应计划
|
||||
*
|
||||
* @param gysJh 供应计划
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertGysJh(GysJh gysJh)
|
||||
{
|
||||
if (gysJh.getStatus() == null) {
|
||||
gysJh.setStatus("0");
|
||||
}
|
||||
|
||||
gysJh.setCreateTime(DateUtils.getNowDate());
|
||||
// String operator = getUsername();
|
||||
gysJh.setCreateBy("张三");
|
||||
return gysJhMapper.insertGysJh(gysJh);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应计划
|
||||
*
|
||||
* @param gysJh 供应计划
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateGysJh(GysJh gysJh)
|
||||
{
|
||||
gysJh.setUpdateTime(DateUtils.getNowDate());
|
||||
// String operator = getUsername();
|
||||
gysJh.setUpdateBy("张三");
|
||||
return gysJhMapper.updateGysJh(gysJh);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除供应计划
|
||||
*
|
||||
* @param ids 需要删除的供应计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGysJhByIds(Long[] ids)
|
||||
{
|
||||
return gysJhMapper.deleteGysJhByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应计划信息
|
||||
*
|
||||
* @param id 供应计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGysJhById(Long id)
|
||||
{
|
||||
return gysJhMapper.deleteGysJhById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importGysJh(List<GysJh> list, boolean updateSupport, String operator) throws ServerException {
|
||||
|
||||
if (list == null || list.isEmpty()){
|
||||
throw new ServerException("导入数据不能为空");
|
||||
}
|
||||
int insertCount = 0 , updateCount = 0;
|
||||
for (GysJh jh : list) {
|
||||
if (jh.getStatus() == null) {
|
||||
jh.setStatus("0");
|
||||
}
|
||||
|
||||
GysJh exist = gysJhMapper.selectExistByKey(jh.getSapNo(), jh.getXh());
|
||||
|
||||
if (exist == null){
|
||||
jh.setCreateBy(operator);
|
||||
jh.setCreateTime(DateUtils.getNowDate());
|
||||
gysJhMapper.insertGysJh(jh);
|
||||
insertCount++;
|
||||
}else if (updateSupport){
|
||||
jh.setId(exist.getId());
|
||||
jh.setUpdateBy(operator);
|
||||
jh.setUpdateTime(DateUtils.getNowDate());
|
||||
gysJhMapper.updateGysJh(jh);
|
||||
updateCount++;
|
||||
}
|
||||
}
|
||||
return String.format("导入成功:新增 %d 条,更新 %d 条。", insertCount, updateCount);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://192.168.1.20:3306/pdxt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://localhost:3306/pdxt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://192.168.1.20:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/pdxt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: shzg
|
||||
# 从库数据源
|
||||
|
||||
@@ -16,7 +16,7 @@ zg:
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8084
|
||||
port: 8086
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@@ -68,8 +68,8 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.1.20
|
||||
# host: localhost
|
||||
# host: 192.168.1.20
|
||||
host: localhost
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
|
||||
@@ -1,24 +1,20 @@
|
||||
Application Version: ${zg.version}
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// _ooOoo_ //
|
||||
// o8888888o //
|
||||
// 88" . "88 //
|
||||
// (| ^_^ |) //
|
||||
// O\ = /O //
|
||||
// ____/`---'\____ //
|
||||
// .' \\| |// `. //
|
||||
// / \\||| : |||// \ //
|
||||
// / _||||| -:- |||||- \ //
|
||||
// | | \\\ - /// | | //
|
||||
// | \_| ''\---/'' | | //
|
||||
// \ .-\__ `-` ___/-. / //
|
||||
// ___`. .' /--.--\ `. . ___ //
|
||||
// ."" '< `.___\_<|>_/___.' >'"". //
|
||||
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
|
||||
// \ \ `-. \_ __\ /__ _/ .-` / / //
|
||||
// ========`-.____`-.___\_____/___.-`____.-'======== //
|
||||
// `=---=' //
|
||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
||||
// 上海洲固先登营 一路长虹无阻 //
|
||||
// //
|
||||
// ███████╗██╗ ██╗ █████╗ ██████╗ ███████╗███████╗ //
|
||||
// ██╔════╝██║ ██║██╔══██╗██╔══██╗██╔════╝██╔════╝ //
|
||||
// ███████╗███████║███████║██████╔╝█████╗ █████╗ //
|
||||
// ╚════██║██╔══██║██╔══██║██╔═══╝ ██╔══╝ ██╔══╝ //
|
||||
// ███████║██║ ██║██║ ██║██║ ███████╗███████╗ //
|
||||
// ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝ //
|
||||
// //
|
||||
// ███████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██╗ //
|
||||
// ██╔════╝██╔═══██╗██║ ██║██╔═══██╗██╔════╝ ██║ //
|
||||
// ███████╗██║ ██║██║ ██║██║ ██║██║ ███╗██║ //
|
||||
// ╚════██║██║ ██║╚██╗ ██╔╝██║ ██║██║ ██║██║ //
|
||||
// ███████║╚██████╔╝ ╚████╔╝ ╚██████╔╝╚██████╔╝███████╗ //
|
||||
// ╚══════╝ ╚═════╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚══════╝ //
|
||||
// //
|
||||
// —— 上海洲固 · 专注智慧物联,筑牢实体管理 —— //
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,61 @@
|
||||
<?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="com.zg.project.Information.mapper.SceneMappingMapper">
|
||||
|
||||
<resultMap type="SceneMapping" id="SceneMappingResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sceneCode" column="scene_code" />
|
||||
<result property="sceneName" column="scene_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSceneMappingVo">
|
||||
select id, scene_code, scene_name from scene_mapping
|
||||
</sql>
|
||||
|
||||
<select id="selectSceneMappingList" parameterType="SceneMapping" resultMap="SceneMappingResult">
|
||||
<include refid="selectSceneMappingVo"/>
|
||||
<where>
|
||||
<if test="sceneCode != null and sceneCode != ''"> and scene_code = #{sceneCode}</if>
|
||||
<if test="sceneName != null and sceneName != ''"> and scene_name like concat('%', #{sceneName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSceneMappingById" parameterType="Long" resultMap="SceneMappingResult">
|
||||
<include refid="selectSceneMappingVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSceneMapping" parameterType="SceneMapping" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into scene_mapping
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sceneCode != null and sceneCode != ''">scene_code,</if>
|
||||
<if test="sceneName != null and sceneName != ''">scene_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sceneCode != null and sceneCode != ''">#{sceneCode},</if>
|
||||
<if test="sceneName != null and sceneName != ''">#{sceneName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSceneMapping" parameterType="SceneMapping">
|
||||
update scene_mapping
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sceneCode != null and sceneCode != ''">scene_code = #{sceneCode},</if>
|
||||
<if test="sceneName != null and sceneName != ''">scene_name = #{sceneName},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSceneMappingById" parameterType="Long">
|
||||
delete from scene_mapping where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSceneMappingByIds" parameterType="String">
|
||||
delete from scene_mapping where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
166
src/main/resources/mybatis/query/GysJhMapper.xml
Normal file
166
src/main/resources/mybatis/query/GysJhMapper.xml
Normal file
@@ -0,0 +1,166 @@
|
||||
<?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="com.zg.project.wisdom.plan.mapper.GysJhMapper">
|
||||
|
||||
<resultMap type="GysJh" id="GysJhResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="xj" column="xj" />
|
||||
<result property="xmNo" column="xm_no" />
|
||||
<result property="xmMs" column="xm_ms" />
|
||||
<result property="wlNo" column="wl_no" />
|
||||
<result property="wlMs" column="wl_ms" />
|
||||
<result property="gysNo" column="gys_no" />
|
||||
<result property="gysMc" column="gys_mc" />
|
||||
<result property="jhAmt" column="jh_amt" />
|
||||
<result property="htDj" column="ht_dj" />
|
||||
<result property="sapNo" column="sap_no" />
|
||||
<result property="xh" column="xh" />
|
||||
<result property="jhQty" column="jh_qty" />
|
||||
<result property="htQty" column="ht_qty" />
|
||||
<result property="dw" column="dw" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGysJhVo">
|
||||
select id, xj, xm_no, xm_ms, wl_no, wl_ms, gys_no, gys_mc, jh_amt, ht_dj, sap_no, xh, jh_qty, ht_qty, dw, remark, create_by, create_time, update_by, update_time, is_delete from gys_jh
|
||||
</sql>
|
||||
|
||||
<select id="selectGysJhList" parameterType="GysJh" resultMap="GysJhResult">
|
||||
<include refid="selectGysJhVo"/>
|
||||
<where>
|
||||
<if test="xj != null and xj != ''"> and xj = #{xj}</if>
|
||||
<if test="xmNo != null and xmNo != ''"> and xm_no = #{xmNo}</if>
|
||||
<if test="xmMs != null and xmMs != ''"> and xm_ms = #{xmMs}</if>
|
||||
<if test="wlNo != null and wlNo != ''"> and wl_no = #{wlNo}</if>
|
||||
<if test="wlMs != null and wlMs != ''"> and wl_ms = #{wlMs}</if>
|
||||
<if test="gysNo != null and gysNo != ''"> and gys_no = #{gysNo}</if>
|
||||
<if test="gysMc != null and gysMc != ''"> and gys_mc = #{gysMc}</if>
|
||||
<if test="jhAmt != null "> and jh_amt = #{jhAmt}</if>
|
||||
<if test="htDj != null "> and ht_dj = #{htDj}</if>
|
||||
<if test="sapNo != null and sapNo != ''"> and sap_no = #{sapNo}</if>
|
||||
<if test="xh != null and xh != ''"> and xh = #{xh}</if>
|
||||
<if test="jhQty != null "> and jh_qty = #{jhQty}</if>
|
||||
<if test="htQty != null "> and ht_qty = #{htQty}</if>
|
||||
<if test="dw != null and dw != ''"> and dw = #{dw}</if>
|
||||
<choose>
|
||||
<when test="isDelete != null and isDelete != ''">
|
||||
and is_delete = #{isDelete}
|
||||
</when>
|
||||
<otherwise>
|
||||
and is_delete = '0'
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
|
||||
<!-- 排序逻辑 -->
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN update_time IS NOT NULL THEN update_time
|
||||
ELSE create_time
|
||||
END DESC
|
||||
</select>
|
||||
|
||||
<select id="selectGysJhById" parameterType="Long" resultMap="GysJhResult">
|
||||
<include refid="selectGysJhVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectExistByKey" resultType="com.zg.project.wisdom.plan.domain.GysJh">
|
||||
select * from gys_jh where sap_no = #{sapNo} and xh = #{xh}
|
||||
</select>
|
||||
|
||||
<insert id="insertGysJh" parameterType="GysJh" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into gys_jh
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="xj != null">xj,</if>
|
||||
<if test="xmNo != null">xm_no,</if>
|
||||
<if test="xmMs != null">xm_ms,</if>
|
||||
<if test="wlNo != null">wl_no,</if>
|
||||
<if test="wlMs != null">wl_ms,</if>
|
||||
<if test="gysNo != null">gys_no,</if>
|
||||
<if test="gysMc != null">gys_mc,</if>
|
||||
<if test="jhAmt != null">jh_amt,</if>
|
||||
<if test="htDj != null">ht_dj,</if>
|
||||
<if test="sapNo != null">sap_no,</if>
|
||||
<if test="xh != null">xh,</if>
|
||||
<if test="jhQty != null">jh_qty,</if>
|
||||
<if test="htQty != null">ht_qty,</if>
|
||||
<if test="dw != null">dw,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="xj != null">#{xj},</if>
|
||||
<if test="xmNo != null">#{xmNo},</if>
|
||||
<if test="xmMs != null">#{xmMs},</if>
|
||||
<if test="wlNo != null">#{wlNo},</if>
|
||||
<if test="wlMs != null">#{wlMs},</if>
|
||||
<if test="gysNo != null">#{gysNo},</if>
|
||||
<if test="gysMc != null">#{gysMc},</if>
|
||||
<if test="jhAmt != null">#{jhAmt},</if>
|
||||
<if test="htDj != null">#{htDj},</if>
|
||||
<if test="sapNo != null">#{sapNo},</if>
|
||||
<if test="xh != null">#{xh},</if>
|
||||
<if test="jhQty != null">#{jhQty},</if>
|
||||
<if test="htQty != null">#{htQty},</if>
|
||||
<if test="dw != null">#{dw},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateGysJh" parameterType="GysJh">
|
||||
update gys_jh
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="xj != null">xj = #{xj},</if>
|
||||
<if test="xmNo != null">xm_no = #{xmNo},</if>
|
||||
<if test="xmMs != null">xm_ms = #{xmMs},</if>
|
||||
<if test="wlNo != null">wl_no = #{wlNo},</if>
|
||||
<if test="wlMs != null">wl_ms = #{wlMs},</if>
|
||||
<if test="gysNo != null">gys_no = #{gysNo},</if>
|
||||
<if test="gysMc != null">gys_mc = #{gysMc},</if>
|
||||
<if test="jhAmt != null">jh_amt = #{jhAmt},</if>
|
||||
<if test="htDj != null">ht_dj = #{htDj},</if>
|
||||
<if test="sapNo != null">sap_no = #{sapNo},</if>
|
||||
<if test="xh != null">xh = #{xh},</if>
|
||||
<if test="jhQty != null">jh_qty = #{jhQty},</if>
|
||||
<if test="htQty != null">ht_qty = #{htQty},</if>
|
||||
<if test="dw != null">dw = #{dw},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGysJhById" parameterType="Long">
|
||||
delete from gys_jh where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGysJhByIds" parameterType="String">
|
||||
update gys_jh
|
||||
set is_delete = '1'
|
||||
where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user