工机具管理-库管员配置;维修班配置
This commit is contained in:
parent
002be31083
commit
8fe72fc067
|
|
@ -0,0 +1,82 @@
|
|||
package com.bonus.sgzb.base.controller;
|
||||
|
||||
import com.bonus.sgzb.base.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.base.service.AgreementInfoService;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Api(tags = " 协议管理")
|
||||
@RestController
|
||||
@RequestMapping("/agreementInfo")
|
||||
public class AgreementInfoController extends BaseController {
|
||||
@Autowired
|
||||
private AgreementInfoService agreementInfoService;
|
||||
|
||||
/**
|
||||
* 获取协议管理列表
|
||||
*/
|
||||
@ApiOperation(value = "获取协议管理列表")
|
||||
@GetMapping("/getAgreementInfoAll")
|
||||
public TableDataInfo getAgreementInfoAll(AgreementInfo bean)
|
||||
{
|
||||
startPage();
|
||||
List<AgreementInfo> list = agreementInfoService.getAgreementInfoAll(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 往来单位
|
||||
*/
|
||||
@ApiOperation(value = "往来单位")
|
||||
@GetMapping("/getUnitList")
|
||||
public AjaxResult getUnitList(){
|
||||
List<AgreementInfo> list = agreementInfoService.getUnitList();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@ApiOperation(value = "工程名称")
|
||||
@GetMapping("/getProjectList")
|
||||
public AjaxResult getProjectList(){
|
||||
List<AgreementInfo> list = agreementInfoService.getProjectList();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("协议管理-保存")
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated @RequestBody AgreementInfo bean)
|
||||
{
|
||||
return toAjax(agreementInfoService.add(bean));
|
||||
}
|
||||
|
||||
@ApiOperation("协议管理-修改")
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@Validated @RequestBody AgreementInfo bean)
|
||||
{
|
||||
return toAjax(agreementInfoService.update(bean));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除库管员配置
|
||||
*/
|
||||
@ApiOperation(value = "协议管理-删除")
|
||||
@PostMapping("/remove")
|
||||
public AjaxResult deleteByIds(String id)
|
||||
{
|
||||
return toAjax(agreementInfoService.deleteByIds(id));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.bonus.sgzb.base.controller;
|
||||
|
||||
import com.bonus.sgzb.base.domain.MaintenanceGang;
|
||||
import com.bonus.sgzb.base.service.MaintenanceGangService;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Api(tags = " 维修班配置")
|
||||
@RestController
|
||||
@RequestMapping("/maintenanceGang")
|
||||
public class MaintenanceGangController extends BaseController {
|
||||
@Autowired
|
||||
private MaintenanceGangService warehouseKeeperService;
|
||||
|
||||
/**
|
||||
* 获取维修班配置列表
|
||||
*/
|
||||
@ApiOperation(value = "获取维修班配置列表")
|
||||
@GetMapping("/warehouseKeeperInfoAll")
|
||||
public TableDataInfo getWarehouseKeeperInfoAll(MaintenanceGang bean)
|
||||
{
|
||||
startPage();
|
||||
List<MaintenanceGang> list = warehouseKeeperService.getWarehouseKeeperInfoAll(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 维修班配置-根据人员名称查询左侧列表
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "维修班配置-根据人员名称查询左侧列表")
|
||||
@GetMapping("/getMaUserList")
|
||||
public AjaxResult getMaUserList(String userName){
|
||||
return AjaxResult.success(warehouseKeeperService.getMaUserList(userName));
|
||||
}
|
||||
@ApiOperation("维修班配置-保存")
|
||||
@Log(title = "维修班配置-保存", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addList")
|
||||
public AjaxResult add(@Validated @RequestBody MaintenanceGang bean)
|
||||
{
|
||||
return toAjax(warehouseKeeperService.add(bean));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库管员配置
|
||||
*/
|
||||
@ApiOperation(value = "维修班配置-删除")
|
||||
@PostMapping("/remove")
|
||||
public AjaxResult remove(String typeId,String type)
|
||||
{
|
||||
return toAjax(warehouseKeeperService.deleteByIds(typeId,type));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.bonus.sgzb.base.controller;
|
||||
|
||||
import com.bonus.sgzb.base.domain.WarehouseKeeper;
|
||||
import com.bonus.sgzb.base.service.WarehouseKeeperService;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Api(tags = "库管员配置")
|
||||
@RestController
|
||||
@RequestMapping("/maWarehouseKeeper")
|
||||
public class WarehouseKeeperController extends BaseController {
|
||||
@Autowired
|
||||
private WarehouseKeeperService warehouseKeeperService;
|
||||
|
||||
/**
|
||||
* 获取库管员配置列表
|
||||
*/
|
||||
@ApiOperation(value = "获取库管员配置列表")
|
||||
@GetMapping("/warehouseKeeperInfoAll")
|
||||
public TableDataInfo getWarehouseKeeperInfoAll(WarehouseKeeper bean)
|
||||
{
|
||||
startPage();
|
||||
List<WarehouseKeeper> list = warehouseKeeperService.getWarehouseKeeperInfoAll(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 库管员配置-根据人员名称查询左侧列表
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "库管员配置-根据人员名称查询左侧列表")
|
||||
@GetMapping("/getMaUserList")
|
||||
public AjaxResult getMaUserList(String userName){
|
||||
return AjaxResult.success(warehouseKeeperService.getMaUserList(userName));
|
||||
}
|
||||
@ApiOperation("库管员配置-保存")
|
||||
@Log(title = "库管员配置-保存", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addList")
|
||||
public AjaxResult add(@Validated @RequestBody WarehouseKeeper bean)
|
||||
{
|
||||
return toAjax(warehouseKeeperService.add(bean));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库管员配置
|
||||
*/
|
||||
@ApiOperation(value = "库管员配置-删除")
|
||||
@PostMapping("/remove")
|
||||
public AjaxResult remove(String typeId,String type)
|
||||
{
|
||||
return toAjax(warehouseKeeperService.deleteByIds(typeId,type));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package com.bonus.sgzb.base.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class AgreementInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 协议ID */
|
||||
@ApiModelProperty(value = "协议ID")
|
||||
private Long agreementId;
|
||||
|
||||
/** 协议编号 */
|
||||
@Excel(name = "协议编号")
|
||||
@ApiModelProperty(value = "协议编号")
|
||||
private String agreementCode;
|
||||
|
||||
/** 签订日期 */
|
||||
@Excel(name = "签订日期")
|
||||
@ApiModelProperty(value = "签订日期")
|
||||
private String signTime;
|
||||
|
||||
/** 往来单位id */
|
||||
@Excel(name = "往来单位id")
|
||||
@ApiModelProperty(value = "往来单位id")
|
||||
private Long unitId;
|
||||
|
||||
/** 往来单位 */
|
||||
@Excel(name = "往来单位")
|
||||
@ApiModelProperty(value = "往来单位")
|
||||
private String unitName;
|
||||
|
||||
/** 工程标段ID */
|
||||
@Excel(name = "工程标段ID")
|
||||
@ApiModelProperty(value = "工程标段ID")
|
||||
private Long projectId;
|
||||
|
||||
/** 工程标段 */
|
||||
@Excel(name = "工程标段")
|
||||
@ApiModelProperty(value = "工程标段")
|
||||
private String projectName;
|
||||
|
||||
/** 租赁天数 */
|
||||
@Excel(name = "租赁天数")
|
||||
@ApiModelProperty(value = "租赁天数")
|
||||
private Long leaseDay;
|
||||
|
||||
/** 计划开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "计划开始时间")
|
||||
private Date planStartTime;
|
||||
|
||||
/** 合同 */
|
||||
@Excel(name = "合同")
|
||||
@ApiModelProperty(value = "合同")
|
||||
private String contractCode;
|
||||
|
||||
/** 授权人 */
|
||||
@Excel(name = "授权人")
|
||||
@ApiModelProperty(value = "授权人")
|
||||
private String authPerson;
|
||||
|
||||
/** 联系方式 */
|
||||
@Excel(name = "联系方式")
|
||||
@ApiModelProperty(value = "联系方式")
|
||||
private String phone;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@Excel(name = "数据所属组织")
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Long companyId;
|
||||
|
||||
@Excel(name = "文件名称")
|
||||
@ApiModelProperty(value = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
@Excel(name = "文件路径")
|
||||
@ApiModelProperty(value = "文件路径")
|
||||
private String fileUrl;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.bonus.sgzb.base.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class MaintenanceGang extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "种类id")
|
||||
private Long kindId;
|
||||
@ApiModelProperty(value = "种类名称")
|
||||
private String kindName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "类型id")
|
||||
private Long typeId;
|
||||
@ApiModelProperty(value = "类型ids")
|
||||
private String typeIds;
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
@ApiModelProperty(value = "规格型号id")
|
||||
private Long modelId;
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String modelName;
|
||||
|
||||
@ApiModelProperty(value = "库管员")
|
||||
private String warehouseKeeper;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Long companyId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.bonus.sgzb.base.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class WarehouseKeeper extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "种类id")
|
||||
private Long kindId;
|
||||
@ApiModelProperty(value = "种类名称")
|
||||
private String kindName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "类型id")
|
||||
private Long typeId;
|
||||
@ApiModelProperty(value = "类型ids")
|
||||
private String typeIds;
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
@ApiModelProperty(value = "规格型号id")
|
||||
private Long modelId;
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String modelName;
|
||||
|
||||
@ApiModelProperty(value = "库管员")
|
||||
private String warehouseKeeper;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Long companyId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.bonus.sgzb.base.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.base.domain.MaintenanceGang;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Mapper
|
||||
public interface AgreementInfoMapper {
|
||||
|
||||
List<AgreementInfo> getAgreementInfoAll(AgreementInfo bean);
|
||||
|
||||
List<AgreementInfo> getUnitList();
|
||||
|
||||
List<AgreementInfo> getProjectList();
|
||||
|
||||
int add(AgreementInfo bean);
|
||||
|
||||
int selectNumByMonth(Date nowDate);
|
||||
|
||||
int update(AgreementInfo bean);
|
||||
|
||||
int deleteByIds(String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.sgzb.base.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.domain.MaintenanceGang;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaintenanceGangMapper {
|
||||
List<MaintenanceGang> getWarehouseKeeperInfoAll(MaintenanceGang bean);
|
||||
|
||||
List<MaintenanceGang> getMaUserList(String userName);
|
||||
|
||||
int add(List<MaintenanceGang> list);
|
||||
|
||||
int deleteByIds(String typeId);
|
||||
|
||||
int deleteByIdsAll(String[] typeIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.sgzb.base.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.domain.WarehouseKeeper;
|
||||
import com.bonus.sgzb.base.vo.DeptUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Mapper
|
||||
public interface WarehouseKeeperMapper {
|
||||
List<WarehouseKeeper> getWarehouseKeeperInfoAll(WarehouseKeeper bean);
|
||||
|
||||
List<WarehouseKeeper> getMaUserList(String userName);
|
||||
|
||||
int add(List<WarehouseKeeper> list);
|
||||
|
||||
int deleteByIds(String typeId);
|
||||
|
||||
int deleteByIdsAll(String[] typeIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.bonus.sgzb.base.service;
|
||||
|
||||
import com.bonus.sgzb.base.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.base.domain.MaintenanceGang;
|
||||
import com.bonus.sgzb.base.domain.WarehouseKeeper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
public interface AgreementInfoService {
|
||||
|
||||
List<AgreementInfo> getAgreementInfoAll(AgreementInfo bean);
|
||||
|
||||
List<AgreementInfo> getUnitList();
|
||||
|
||||
List<AgreementInfo> getProjectList();
|
||||
|
||||
int add(AgreementInfo bean);
|
||||
|
||||
int update(AgreementInfo bean);
|
||||
|
||||
int deleteByIds(String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.sgzb.base.service;
|
||||
|
||||
import com.bonus.sgzb.base.domain.MaintenanceGang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
public interface MaintenanceGangService {
|
||||
List<MaintenanceGang> getWarehouseKeeperInfoAll(MaintenanceGang bean);
|
||||
|
||||
List<MaintenanceGang> getMaUserList (String userName);
|
||||
|
||||
int add(MaintenanceGang bean);
|
||||
|
||||
int deleteByIds(String typeId,String type);
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.sgzb.base.service;
|
||||
|
||||
import com.bonus.sgzb.base.domain.WarehouseKeeper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
public interface WarehouseKeeperService {
|
||||
List<WarehouseKeeper> getWarehouseKeeperInfoAll(WarehouseKeeper bean);
|
||||
|
||||
List<WarehouseKeeper> getMaUserList (String userName);
|
||||
|
||||
int add(WarehouseKeeper bean);
|
||||
|
||||
int deleteByIds(String typeId,String type);
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.bonus.sgzb.base.service.impl;
|
||||
|
||||
import com.bonus.sgzb.base.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.base.domain.MaintenanceGang;
|
||||
import com.bonus.sgzb.base.mapper.AgreementInfoMapper;
|
||||
import com.bonus.sgzb.base.mapper.MaintenanceGangMapper;
|
||||
import com.bonus.sgzb.base.service.AgreementInfoService;
|
||||
import com.bonus.sgzb.base.service.MaintenanceGangService;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Service
|
||||
public class AgreementInfoServiceImpl implements AgreementInfoService {
|
||||
|
||||
@Autowired
|
||||
private AgreementInfoMapper agreementInfoMapper;
|
||||
|
||||
@Override
|
||||
public List<AgreementInfo> getAgreementInfoAll(AgreementInfo bean) {
|
||||
return agreementInfoMapper.getAgreementInfoAll(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AgreementInfo> getUnitList() {
|
||||
return agreementInfoMapper.getUnitList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AgreementInfo> getProjectList() {
|
||||
return agreementInfoMapper.getProjectList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int add(AgreementInfo bean) {
|
||||
String agreementCode = purchaseCodeRule();
|
||||
bean.setAgreementCode(agreementCode);
|
||||
return agreementInfoMapper.add(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(AgreementInfo bean) {
|
||||
return agreementInfoMapper.update(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(String id) {
|
||||
return agreementInfoMapper.deleteByIds(id);
|
||||
}
|
||||
|
||||
|
||||
private String purchaseCodeRule() {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int num = agreementInfoMapper.selectNumByMonth(nowDate) + 1;
|
||||
String code = "XY" + format + "-000" + num;
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.bonus.sgzb.base.service.impl;
|
||||
|
||||
import com.bonus.sgzb.base.domain.MaintenanceGang;
|
||||
import com.bonus.sgzb.base.mapper.MaintenanceGangMapper;
|
||||
import com.bonus.sgzb.base.service.MaintenanceGangService;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Service
|
||||
public class MaintenanceGangServiceImpl implements MaintenanceGangService {
|
||||
|
||||
@Autowired
|
||||
private MaintenanceGangMapper MaintenanceGangMapper;
|
||||
|
||||
@Override
|
||||
public List<MaintenanceGang> getWarehouseKeeperInfoAll(MaintenanceGang bean) {
|
||||
return MaintenanceGangMapper.getWarehouseKeeperInfoAll(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MaintenanceGang> getMaUserList(String userName) {
|
||||
return MaintenanceGangMapper.getMaUserList(userName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int add(MaintenanceGang bean) {
|
||||
List<MaintenanceGang> list = new ArrayList<>();
|
||||
String typeIds = bean.getTypeIds();
|
||||
if(StringHelper.isNotEmpty(typeIds)){
|
||||
String[] splitTypeIds = typeIds.split("@");
|
||||
//先删除,在去添加
|
||||
MaintenanceGangMapper.deleteByIdsAll(splitTypeIds);
|
||||
for (String typeId : splitTypeIds) {
|
||||
MaintenanceGang beans = new MaintenanceGang();
|
||||
beans.setTypeIds(typeId);
|
||||
beans.setUserId(bean.getUserId());
|
||||
beans.setCompanyId(bean.getCompanyId());
|
||||
list.add(beans);
|
||||
}
|
||||
}
|
||||
int i =0;
|
||||
if(list.size()>0){
|
||||
i= MaintenanceGangMapper.add(list);
|
||||
}else{
|
||||
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(String typeId,String type) {
|
||||
int i = 0;
|
||||
if(StringHelper.isNotEmpty(type)){
|
||||
if("1".equals(type)){
|
||||
i = MaintenanceGangMapper.deleteByIds(typeId);
|
||||
}else{
|
||||
if(StringHelper.isNotEmpty(typeId)){
|
||||
List<MaintenanceGang> list = new ArrayList<>();
|
||||
String[] splitTypeIds = typeId.split("@");
|
||||
i = MaintenanceGangMapper.deleteByIdsAll(splitTypeIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.bonus.sgzb.base.service.impl;
|
||||
|
||||
import com.bonus.sgzb.base.domain.WarehouseKeeper;
|
||||
import com.bonus.sgzb.base.mapper.BmProjectInfoMapper;
|
||||
import com.bonus.sgzb.base.mapper.WarehouseKeeperMapper;
|
||||
import com.bonus.sgzb.base.service.WarehouseKeeperService;
|
||||
import com.bonus.sgzb.base.vo.DeptUser;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Service
|
||||
public class WarehouseKeeperServiceImpl implements WarehouseKeeperService {
|
||||
|
||||
@Autowired
|
||||
private WarehouseKeeperMapper warehouseKeeperMapper;
|
||||
|
||||
@Override
|
||||
public List<WarehouseKeeper> getWarehouseKeeperInfoAll(WarehouseKeeper bean) {
|
||||
return warehouseKeeperMapper.getWarehouseKeeperInfoAll(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarehouseKeeper> getMaUserList(String userName) {
|
||||
return warehouseKeeperMapper.getMaUserList(userName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int add(WarehouseKeeper bean) {
|
||||
List<WarehouseKeeper> list = new ArrayList<>();
|
||||
String typeIds = bean.getTypeIds();
|
||||
if(StringHelper.isNotEmpty(typeIds)){
|
||||
String[] splitTypeIds = typeIds.split("@");
|
||||
//先删除,在去添加
|
||||
warehouseKeeperMapper.deleteByIdsAll(splitTypeIds);
|
||||
for (String typeId : splitTypeIds) {
|
||||
WarehouseKeeper beans = new WarehouseKeeper();
|
||||
beans.setTypeIds(typeId);
|
||||
beans.setUserId(bean.getUserId());
|
||||
beans.setCompanyId(bean.getCompanyId());
|
||||
list.add(beans);
|
||||
}
|
||||
}
|
||||
int i =0;
|
||||
if(list.size()>0){
|
||||
i= warehouseKeeperMapper.add(list);
|
||||
}else{
|
||||
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(String typeId,String type) {
|
||||
int i = 0;
|
||||
if(StringHelper.isNotEmpty(type)){
|
||||
if("1".equals(type)){
|
||||
i = warehouseKeeperMapper.deleteByIds(typeId);
|
||||
}else{
|
||||
if(StringHelper.isNotEmpty(typeId)){
|
||||
List<WarehouseKeeper> list = new ArrayList<>();
|
||||
String[] splitTypeIds = typeId.split("@");
|
||||
i = warehouseKeeperMapper.deleteByIdsAll(splitTypeIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
<?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.bonus.sgzb.base.mapper.AgreementInfoMapper">
|
||||
|
||||
<resultMap type="com.bonus.sgzb.base.domain.AgreementInfo" id="BmAgreementInfoResult">
|
||||
<result property="agreementId" column="agreement_id"/>
|
||||
<result property="agreementCode" column="agreement_code"/>
|
||||
<result property="signTime" column="sign_time"/>
|
||||
<result property="unitId" column="unit_id"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="leaseDay" column="lease_day"/>
|
||||
<result property="planStartTime" column="plan_start_time"/>
|
||||
<result property="contractCode" column="contract_code"/>
|
||||
<result property="authPerson" column="auth_person"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="companyId" column="company_id"/>
|
||||
<result property="fileName" column="file_name"/>
|
||||
<result property="fileUrl" column="file_url"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="add">
|
||||
insert into bm_agreement_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="agreementCode != null">agreement_code,</if>
|
||||
<if test="signTime != null and signTime != ''">sign_time,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="leaseDay != null">lease_day,</if>
|
||||
<if test="planStartTime != null">plan_start_time,</if>
|
||||
<if test="contractCode != null">contract_code,</if>
|
||||
<if test="authPerson != null">auth_person,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
<if test="fileUrl != null">file_url,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="agreementCode != null">#{agreementCode},</if>
|
||||
<if test="signTime != null and signTime != ''">#{signTime},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="leaseDay != null">#{leaseDay},</if>
|
||||
<if test="planStartTime != null">#{planStartTime},</if>
|
||||
<if test="contractCode != null">#{contractCode},</if>
|
||||
<if test="authPerson != null">#{authPerson},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="fileName != null">#{fileName},</if>
|
||||
<if test="fileUrl != null">#{fileUrl},</if>
|
||||
</trim>
|
||||
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update bm_agreement_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="signTime != null and signTime != ''">sign_time = #{signTime},</if>
|
||||
<if test="unitId != null">unit_id = #{unitId},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="leaseDay != null">lease_day = #{leaseDay},</if>
|
||||
<if test="planStartTime != null">plan_start_time = #{planStartTime},</if>
|
||||
<if test="contractCode != null">contract_code = #{contractCode},</if>
|
||||
<if test="authPerson != null">auth_person = #{authPerson},</if>
|
||||
<if test="phone != null">phone = #{phone},</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="remark != null">remark = #{remark},</if>
|
||||
<if test="companyId != null">company_id = #{companyId},</if>
|
||||
<if test="fileName != null">file_name = #{fileName},</if>
|
||||
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||
</trim>
|
||||
where agreement_id = #{agreementId}
|
||||
</update>
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE bm_agreement_info SET status = '0' WHERE agreement_id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getAgreementInfoAll" resultType="com.bonus.sgzb.base.domain.AgreementInfo">
|
||||
SELECT bai.agreement_id, bai.agreement_code , contract_code,file_url ,file_name,sign_time,
|
||||
bui.unit_id,bui.unit_name , bp.lot_id as projectId , bp.lot_name as projectName,
|
||||
plan_start_time,lease_day,auth_person,phone,bai.remark
|
||||
FROM bm_agreement_info bai
|
||||
LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id
|
||||
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
|
||||
|
||||
<where>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and bai.contract_code like concat('%', #{keyWord}, '%')
|
||||
</if>
|
||||
|
||||
<if test="agreementCode != null and agreementCode != ''">
|
||||
and bai.agreement_code like concat('%', #{agreementCode}, '%')
|
||||
</if>
|
||||
<if test="unitId != null and unitId != ''">
|
||||
and bui.unit_id = #{unitId}
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and bp.lot_id = #{projectId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getUnitList" resultType="com.bonus.sgzb.base.domain.AgreementInfo">
|
||||
SELECT unit_id , unit_name FROM bm_unit_info
|
||||
WHERE del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="getProjectList" resultType="com.bonus.sgzb.base.domain.AgreementInfo">
|
||||
SELECT lot_id as projectId,lot_name as projectName FROM `bm_project_lot`
|
||||
WHERE del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectNumByMonth" resultType="java.lang.Integer">
|
||||
select count(*) from bm_agreement_info where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m')
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?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.bonus.sgzb.base.mapper.MaintenanceGangMapper">
|
||||
<insert id="add">
|
||||
insert into ma_type_repair(type_id, user_id,company_id ,time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.typeIds},#{item.userId},#{item.companyId},NOW())
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
DELETE FROM ma_type_repair WHERE `type_id` = #{typeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIdsAll">
|
||||
delete from ma_type_repair where type_id in
|
||||
<foreach item="typeIds" collection="array" open="(" separator="," close=")">
|
||||
#{typeIds}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getWarehouseKeeperInfoAll" resultType="com.bonus.sgzb.base.domain.MaintenanceGang">
|
||||
SELECT mt.type_id as modelId ,mt.type_name as modelName,
|
||||
mt2.type_id, mt2.type_name ,
|
||||
mt3.type_id as typeId,mt3.type_name as typeName,
|
||||
mt3.type_id as kindId,mt4.type_name as kindName,
|
||||
su.user_id as userId, su.user_name as userName
|
||||
FROM ma_type mt
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id AND mt2.`level` = '3'
|
||||
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id AND mt3.`level` = '2'
|
||||
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.`level` = '1'
|
||||
LEFT JOIN ma_type_repair mtk ON mtk.type_id = mt.type_id
|
||||
LEFT JOIN sys_user su ON su.user_id = mtk.user_id
|
||||
WHERE mt.`level` = '4' AND mt.`del_flag` = '0'
|
||||
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt3.type_name like concat('%', #{typeName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getMaUserList" resultType="com.bonus.sgzb.base.domain.MaintenanceGang">
|
||||
SELECT su.user_id as userId, su.user_name as userName FROM `sys_user` su
|
||||
LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id
|
||||
LEFT JOIN sys_role sr ON sr.role_id = sur.role_id
|
||||
WHERE sr.role_id = '102' AND su.del_flag = '0'
|
||||
<if test="userName != null and userName != ''">
|
||||
AND su.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?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.bonus.sgzb.base.mapper.WarehouseKeeperMapper">
|
||||
<insert id="add">
|
||||
insert into ma_type_keeper(type_id, user_id,company_id,time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.typeIds},#{item.userId},#{item.companyId},NOW())
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
DELETE FROM ma_type_keeper WHERE `type_id` = #{typeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIdsAll">
|
||||
delete from ma_type_keeper where type_id in
|
||||
<foreach item="typeIds" collection="array" open="(" separator="," close=")">
|
||||
#{typeIds}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getWarehouseKeeperInfoAll" resultType="com.bonus.sgzb.base.domain.WarehouseKeeper">
|
||||
SELECT mt.type_id as modelId ,mt.type_name as modelName,
|
||||
mt2.type_id, mt2.type_name ,
|
||||
mt3.type_id as typeId,mt3.type_name as typeName,
|
||||
mt3.type_id as kindId,mt4.type_name as kindName,
|
||||
su.user_id as userId, su.user_name as userName
|
||||
FROM ma_type mt
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id AND mt2.`level` = '3'
|
||||
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id AND mt3.`level` = '2'
|
||||
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.`level` = '1'
|
||||
LEFT JOIN ma_type_keeper mtk ON mtk.type_id = mt.type_id
|
||||
LEFT JOIN sys_user su ON su.user_id = mtk.user_id
|
||||
WHERE mt.`level` = '4' AND mt.`del_flag` = '0'
|
||||
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt3.type_name like concat('%', #{typeName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getMaUserList" resultType="com.bonus.sgzb.base.domain.WarehouseKeeper">
|
||||
SELECT su.user_id as userId, su.user_name as userName FROM `sys_user` su
|
||||
LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id
|
||||
LEFT JOIN sys_role sr ON sr.role_id = sur.role_id
|
||||
WHERE sr.role_id = '101' AND su.del_flag = '0'
|
||||
<if test="userName != null and userName != ''">
|
||||
AND su.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue