diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/AgreementInfoController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/AgreementInfoController.java new file mode 100644 index 00000000..6bc6191f --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/AgreementInfoController.java @@ -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 list = agreementInfoService.getAgreementInfoAll(bean); + return getDataTable(list); + } + + /** + * 往来单位 + */ + @ApiOperation(value = "往来单位") + @GetMapping("/getUnitList") + public AjaxResult getUnitList(){ + List list = agreementInfoService.getUnitList(); + return AjaxResult.success(list); + } + + /** + * 工程名称 + */ + @ApiOperation(value = "工程名称") + @GetMapping("/getProjectList") + public AjaxResult getProjectList(){ + List 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)); + } +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaintenanceGangController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaintenanceGangController.java new file mode 100644 index 00000000..b4fbbc63 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaintenanceGangController.java @@ -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 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)); + } +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/WarehouseKeeperController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/WarehouseKeeperController.java new file mode 100644 index 00000000..50cf4c67 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/WarehouseKeeperController.java @@ -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 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)); + } + +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/AgreementInfo.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/AgreementInfo.java new file mode 100644 index 00000000..4ba58287 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/AgreementInfo.java @@ -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; + +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaintenanceGang.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaintenanceGang.java new file mode 100644 index 00000000..4f637f8a --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaintenanceGang.java @@ -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; + +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/WarehouseKeeper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/WarehouseKeeper.java new file mode 100644 index 00000000..4b60b3b3 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/WarehouseKeeper.java @@ -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; + +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/AgreementInfoMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/AgreementInfoMapper.java new file mode 100644 index 00000000..d99f447c --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/AgreementInfoMapper.java @@ -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 getAgreementInfoAll(AgreementInfo bean); + + List getUnitList(); + + List getProjectList(); + + int add(AgreementInfo bean); + + int selectNumByMonth(Date nowDate); + + int update(AgreementInfo bean); + + int deleteByIds(String id); +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaintenanceGangMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaintenanceGangMapper.java new file mode 100644 index 00000000..7c31b17a --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaintenanceGangMapper.java @@ -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 getWarehouseKeeperInfoAll(MaintenanceGang bean); + + List getMaUserList(String userName); + + int add(List list); + + int deleteByIds(String typeId); + + int deleteByIdsAll(String[] typeIds); +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/WarehouseKeeperMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/WarehouseKeeperMapper.java new file mode 100644 index 00000000..dcdf4f8e --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/WarehouseKeeperMapper.java @@ -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 getWarehouseKeeperInfoAll(WarehouseKeeper bean); + + List getMaUserList(String userName); + + int add(List list); + + int deleteByIds(String typeId); + + int deleteByIdsAll(String[] typeIds); +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/AgreementInfoService.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/AgreementInfoService.java new file mode 100644 index 00000000..8dbcbfc5 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/AgreementInfoService.java @@ -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 getAgreementInfoAll(AgreementInfo bean); + + List getUnitList(); + + List getProjectList(); + + int add(AgreementInfo bean); + + int update(AgreementInfo bean); + + int deleteByIds(String id); +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/MaintenanceGangService.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/MaintenanceGangService.java new file mode 100644 index 00000000..f98041b4 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/MaintenanceGangService.java @@ -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 getWarehouseKeeperInfoAll(MaintenanceGang bean); + + List getMaUserList (String userName); + + int add(MaintenanceGang bean); + + int deleteByIds(String typeId,String type); +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/WarehouseKeeperService.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/WarehouseKeeperService.java new file mode 100644 index 00000000..110debdd --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/WarehouseKeeperService.java @@ -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 getWarehouseKeeperInfoAll(WarehouseKeeper bean); + + List getMaUserList (String userName); + + int add(WarehouseKeeper bean); + + int deleteByIds(String typeId,String type); +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/AgreementInfoServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/AgreementInfoServiceImpl.java new file mode 100644 index 00000000..cfe6263e --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/AgreementInfoServiceImpl.java @@ -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 getAgreementInfoAll(AgreementInfo bean) { + return agreementInfoMapper.getAgreementInfoAll(bean); + } + + @Override + public List getUnitList() { + return agreementInfoMapper.getUnitList(); + } + + @Override + public List 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; + } +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaintenanceGangServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaintenanceGangServiceImpl.java new file mode 100644 index 00000000..da927980 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaintenanceGangServiceImpl.java @@ -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 getWarehouseKeeperInfoAll(MaintenanceGang bean) { + return MaintenanceGangMapper.getWarehouseKeeperInfoAll(bean); + } + + @Override + public List getMaUserList(String userName) { + return MaintenanceGangMapper.getMaUserList(userName); + } + + @Override + public int add(MaintenanceGang bean) { + List 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 list = new ArrayList<>(); + String[] splitTypeIds = typeId.split("@"); + i = MaintenanceGangMapper.deleteByIdsAll(splitTypeIds); + } + } + } + + return i; + } + + +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/WarehouseKeeperServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/WarehouseKeeperServiceImpl.java new file mode 100644 index 00000000..b9ab4b21 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/WarehouseKeeperServiceImpl.java @@ -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 getWarehouseKeeperInfoAll(WarehouseKeeper bean) { + return warehouseKeeperMapper.getWarehouseKeeperInfoAll(bean); + } + + @Override + public List getMaUserList(String userName) { + return warehouseKeeperMapper.getMaUserList(userName); + } + + @Override + public int add(WarehouseKeeper bean) { + List 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 list = new ArrayList<>(); + String[] splitTypeIds = typeId.split("@"); + i = warehouseKeeperMapper.deleteByIdsAll(splitTypeIds); + } + } + } + + return i; + } + + +} diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/AgreementInfoMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/AgreementInfoMapper.xml new file mode 100644 index 00000000..05785c93 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/AgreementInfoMapper.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into bm_agreement_info + + agreement_code, + sign_time, + unit_id, + project_id, + create_by, + lease_day, + plan_start_time, + contract_code, + auth_person, + phone, + create_time, + update_by, + update_time, + remark, + company_id, + file_name, + file_url, + + + #{agreementCode}, + #{signTime}, + #{unitId}, + #{projectId}, + #{createBy}, + #{leaseDay}, + #{planStartTime}, + #{contractCode}, + #{authPerson}, + #{phone}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{companyId}, + #{fileName}, + #{fileUrl}, + + + + + + update bm_agreement_info + + sign_time = #{signTime}, + unit_id = #{unitId}, + project_id = #{projectId}, + create_by = #{createBy}, + lease_day = #{leaseDay}, + plan_start_time = #{planStartTime}, + contract_code = #{contractCode}, + auth_person = #{authPerson}, + phone = #{phone}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + company_id = #{companyId}, + file_name = #{fileName}, + file_url = #{fileUrl}, + + where agreement_id = #{agreementId} + + + + UPDATE bm_agreement_info SET status = '0' WHERE agreement_id = #{id} + + + + + + + + + + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaintenanceGangMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaintenanceGangMapper.xml new file mode 100644 index 00000000..7f5ad3b2 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaintenanceGangMapper.xml @@ -0,0 +1,52 @@ + + + + + insert into ma_type_repair(type_id, user_id,company_id ,time) values + + (#{item.typeIds},#{item.userId},#{item.companyId},NOW()) + + + + + DELETE FROM ma_type_repair WHERE `type_id` = #{typeId} + + + + delete from ma_type_repair where type_id in + + #{typeIds} + + + + + + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/WarehouseKeeperMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/WarehouseKeeperMapper.xml new file mode 100644 index 00000000..e5b7871c --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/WarehouseKeeperMapper.xml @@ -0,0 +1,52 @@ + + + + + insert into ma_type_keeper(type_id, user_id,company_id,time) values + + (#{item.typeIds},#{item.userId},#{item.companyId},NOW()) + + + + + DELETE FROM ma_type_keeper WHERE `type_id` = #{typeId} + + + + delete from ma_type_keeper where type_id in + + #{typeIds} + + + + + + + \ No newline at end of file