瀏覽代碼

[task-2098]排班功能开发 / 【后端】排班配置接口开发

Li Yuan 1 年之前
父節點
當前提交
593b45a39a
共有 15 個文件被更改,包括 878 次插入0 次删除
  1. 82 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/api/IScheduleConfigService.java
  2. 64 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/domain/ScheduleConfig.java
  3. 16 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/dao/ScheduleConfigDao.java
  4. 16 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/dao/ScheduleConfigQueryDao.java
  5. 26 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/dao/impl/ScheduleConfigDaoImpl.java
  6. 27 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/dao/impl/ScheduleConfigQueryDaoImpl.java
  7. 35 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/entity/ScheduleConfigPo.java
  8. 177 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/entity/ScheduleConfigTbl.java
  9. 123 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/provider/ScheduleConfigProvider.java
  10. 18 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/repository/ScheduleConfigRepository.java
  11. 56 0
      ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/repository/impl/ScheduleConfigRepositoryImpl.java
  12. 98 0
      ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/employee/persistence/mapping/ScheduleConfig.map.xml
  13. 25 0
      ibps-provider-root/modules/provider-business/src/test/java/com/lc/ibps/components/EmployeeBaseTest.java
  14. 60 0
      ibps-provider-root/modules/provider-business/src/test/java/com/lc/ibps/components/employee/domain/ScheduleConfigTest.java
  15. 55 0
      ibps-provider-root/modules/provider-business/src/test/java/com/lc/ibps/components/employee/persistence/dao/ScheduleConfigDaoTest.java

+ 82 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/api/IScheduleConfigService.java

@@ -0,0 +1,82 @@
+package com.lc.ibps.components.employee.api;
+
+import java.util.List;
+
+import org.hibernate.validator.constraints.NotBlank;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.lc.ibps.cloud.entity.APIPageList;
+import com.lc.ibps.cloud.entity.APIRequest;
+import com.lc.ibps.cloud.entity.APIResult;
+import javax.validation.Valid;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+
+
+
+/**
+ * 排班配置表 接口
+ *
+ *<pre> 
+ * 构建组:ibps-provider-scheduleConfig-api
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:10
+ *</pre>
+ */
+@Validated
+@RequestMapping(value = "/employee/scheduleConfig")
+@RestController
+public interface IScheduleConfigService {
+
+	/**
+	 * 
+	 * 【排班配置表】列表(分页条件查询)数据
+	 *
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/query", method = RequestMethod.POST)
+	public APIResult<APIPageList<ScheduleConfigPo>> query(
+			@RequestBody(required = true) APIRequest request);
+	
+	/**
+	 * 
+	 * 根据id查询【排班配置表】
+	 *
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/get", method = { RequestMethod.GET })
+	public APIResult<ScheduleConfigPo> get(
+//			@NotBlank(message = "{com.lc.ibps.components.provider.ScheduleConfigProvider.id}") 
+			@RequestParam(name = "id", required = true) String id);
+	
+	/**
+	 * 
+	 * 批量删除【排班配置表】记录
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@RequestMapping(value = "/remove", method = { RequestMethod.POST })
+	public APIResult<Void> remove(
+//			@NotEmpty(message = "{com.lc.ibps.components.provider.ScheduleConfigProvider.ids}")
+			@RequestParam(name = "ids", required = true) String[] ids);
+	
+	/**
+	 * 
+	 * 保存【排班配置表】记录
+	 *
+	 * @param scheduleConfigPo
+	 * @return
+	 */
+	@RequestMapping(value = "/save", method = { RequestMethod.POST })
+	public APIResult<Void> save(
+ 			@RequestBody(required = true) @Valid ScheduleConfigPo scheduleConfigPo);
+}

+ 64 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/domain/ScheduleConfig.java

@@ -0,0 +1,64 @@
+package com.lc.ibps.components.employee.domain;
+
+
+import javax.annotation.Resource;
+
+import org.springframework.context.annotation.Scope;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.stereotype.Service;
+
+import com.lc.ibps.base.core.util.BeanUtils;
+import com.lc.ibps.base.core.util.AppUtil;
+import com.lc.ibps.base.framework.domain.AbstractDomain;
+import com.lc.ibps.base.framework.persistence.dao.IDao;
+import com.lc.ibps.base.framework.persistence.dao.IQueryDao;
+import com.lc.ibps.components.employee.persistence.dao.ScheduleConfigDao;
+import com.lc.ibps.components.employee.persistence.dao.ScheduleConfigQueryDao;
+import com.lc.ibps.components.employee.repository.ScheduleConfigRepository;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+
+/**
+ * 排班配置表 领域对象实体
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:10
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@Service
+@Transactional
+@Scope("prototype")
+public class ScheduleConfig extends AbstractDomain<String, ScheduleConfigPo>{
+	
+	@Resource
+	private ScheduleConfigDao scheduleConfigDao;
+	@Resource
+	private ScheduleConfigQueryDao scheduleConfigQueryDao;
+	@Resource
+	private ScheduleConfigRepository scheduleConfigRepository;
+
+
+	protected void init(){
+		//
+	}
+	
+	@Override
+	protected IQueryDao<String, ScheduleConfigPo> getInternalQueryDao() {
+		return scheduleConfigQueryDao;
+	}
+	
+	@Override
+	protected IDao<String, ScheduleConfigPo> getInternalDao() {
+		return scheduleConfigDao;
+	}
+	
+	@Override
+	public String getInternalCacheName() {
+		return "scheduleConfig";
+	}
+	
+	
+	
+}

+ 16 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/dao/ScheduleConfigDao.java

@@ -0,0 +1,16 @@
+package com.lc.ibps.components.employee.persistence.dao;
+
+import com.lc.ibps.base.framework.persistence.dao.IDao;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+
+/**
+ * 排班配置表 Dao接口
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:08
+ *</pre>
+ */
+public interface ScheduleConfigDao extends IDao<String, ScheduleConfigPo> {
+}

+ 16 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/dao/ScheduleConfigQueryDao.java

@@ -0,0 +1,16 @@
+package com.lc.ibps.components.employee.persistence.dao;
+
+import com.lc.ibps.base.framework.persistence.dao.IQueryDao;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+
+/**
+ * 排班配置表 查询Dao接口
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:08
+ *</pre>
+ */
+public interface ScheduleConfigQueryDao extends IQueryDao<String, ScheduleConfigPo> {
+}

+ 26 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/dao/impl/ScheduleConfigDaoImpl.java

@@ -0,0 +1,26 @@
+package com.lc.ibps.components.employee.persistence.dao.impl;
+
+import org.springframework.stereotype.Repository;
+
+import com.lc.ibps.base.db.ddd.dao.MyBatisDaoImpl;
+import com.lc.ibps.components.employee.persistence.dao.ScheduleConfigDao;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+
+/**
+ * 排班配置表 Dao接口的实现类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:08
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@Repository
+public class ScheduleConfigDaoImpl extends MyBatisDaoImpl<String, ScheduleConfigPo> implements ScheduleConfigDao{
+
+    @Override
+    public String getNamespace() {
+        return ScheduleConfigPo.class.getName();
+    }
+}

+ 27 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/dao/impl/ScheduleConfigQueryDaoImpl.java

@@ -0,0 +1,27 @@
+package com.lc.ibps.components.employee.persistence.dao.impl;
+
+
+import org.springframework.stereotype.Repository;
+
+import com.lc.ibps.base.db.ddd.dao.MyBatisQueryDaoImpl;
+import com.lc.ibps.components.employee.persistence.dao.ScheduleConfigQueryDao;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+
+/**
+ *排班配置表 查询Dao的实现类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:07
+ *</pre>
+ */
+ @SuppressWarnings("serial")
+@Repository
+public class ScheduleConfigQueryDaoImpl extends MyBatisQueryDaoImpl<String, ScheduleConfigPo> implements ScheduleConfigQueryDao{
+
+    @Override
+    public String getNamespace() {
+        return ScheduleConfigPo.class.getName();
+    }
+}

+ 35 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/entity/ScheduleConfigPo.java

@@ -0,0 +1,35 @@
+package com.lc.ibps.components.employee.persistence.entity;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import com.lc.ibps.base.core.util.JacksonUtil;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 排班配置表 实体对象
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:07
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@ApiModel(value = "排班配置表对象")
+public class ScheduleConfigPo extends ScheduleConfigTbl{
+
+	public static ScheduleConfigPo fromJsonString(String data){
+		if(JacksonUtil.isNotJsonObject(data)){
+			return null;
+		}
+		return JacksonUtil.getDTO(data, ScheduleConfigPo.class);
+	}
+	
+	public static List<ScheduleConfigPo> fromJsonArrayString(String listData){
+		if(JacksonUtil.isNotJsonArray(listData)){
+			return Collections.emptyList();
+		}
+		return JacksonUtil.getDTOList(listData, ScheduleConfigPo.class);
+	}
+}

+ 177 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/persistence/entity/ScheduleConfigTbl.java

@@ -0,0 +1,177 @@
+package com.lc.ibps.components.employee.persistence.entity;
+
+import java.util.Date;
+
+import com.lc.ibps.base.framework.persistence.entity.AbstractPo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 排班配置表 表对象
+ * 
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:07
+ *</pre>
+ */
+@SuppressWarnings("serial")
+@ApiModel(value = "排班配置表对象")
+public class ScheduleConfigTbl extends AbstractPo<String>{
+	@ApiModelProperty(value = "主键")
+	protected String  id; 		/*主键*/
+	@ApiModelProperty(value = "租户ID")
+	protected String  tenantId; 		/*租户ID*/
+	@ApiModelProperty(value = "IP地址")
+	protected String  ip; 		/*IP地址*/
+	@ApiModelProperty(value = "地点")
+	protected String  diDian; 		/*地点*/
+	@ApiModelProperty(value = "排班类型")
+	protected String  scheduleType; 		/*排班类型*/
+	@ApiModelProperty(value = "排班规则")
+	protected String  scheduleRule; 		/*排班规则*/
+	@ApiModelProperty(value = "排班班次")
+	protected String  scheduleShift; 		/*排班班次*/
+	@ApiModelProperty(value = "排班人员")
+	protected String  scheduleStaff; 		/*排班人员*/
+	@ApiModelProperty(value = "调班审批人")
+	protected String  approver; 		/*调班审批人*/
+	@ApiModelProperty(value = "是否生效")
+	protected String  isEffective; 		/*是否生效*/
+	@ApiModelProperty(value = "是否审批")
+	protected String  isApprpval; 		/*是否审批*/
+
+	public void setId(String id) 
+	{
+		this.id = id;
+	}
+	/**
+	 * 返回 主键
+	 * @return
+	 */
+	public String getId() 
+	{
+		return this.id;
+	}
+	public void setTenantId(String tenantId) 
+	{
+		this.tenantId = tenantId;
+	}
+	/**
+	 * 返回 租户ID
+	 * @return
+	 */
+	public String getTenantId() 
+	{
+		return this.tenantId;
+	}
+	public void setIp(String ip) 
+	{
+		this.ip = ip;
+	}
+	/**
+	 * 返回 IP地址
+	 * @return
+	 */
+	public String getIp() 
+	{
+		return this.ip;
+	}
+	public void setDiDian(String diDian) 
+	{
+		this.diDian = diDian;
+	}
+	/**
+	 * 返回 地点
+	 * @return
+	 */
+	public String getDiDian() 
+	{
+		return this.diDian;
+	}
+	public void setScheduleType(String scheduleType) 
+	{
+		this.scheduleType = scheduleType;
+	}
+	/**
+	 * 返回 排班类型
+	 * @return
+	 */
+	public String getScheduleType() 
+	{
+		return this.scheduleType;
+	}
+	public void setScheduleRule(String scheduleRule) 
+	{
+		this.scheduleRule = scheduleRule;
+	}
+	/**
+	 * 返回 排班规则
+	 * @return
+	 */
+	public String getScheduleRule() 
+	{
+		return this.scheduleRule;
+	}
+	public void setScheduleShift(String scheduleShift) 
+	{
+		this.scheduleShift = scheduleShift;
+	}
+	/**
+	 * 返回 排班班次
+	 * @return
+	 */
+	public String getScheduleShift() 
+	{
+		return this.scheduleShift;
+	}
+	public void setScheduleStaff(String scheduleStaff) 
+	{
+		this.scheduleStaff = scheduleStaff;
+	}
+	/**
+	 * 返回 排班人员
+	 * @return
+	 */
+	public String getScheduleStaff() 
+	{
+		return this.scheduleStaff;
+	}
+	public void setApprover(String approver) 
+	{
+		this.approver = approver;
+	}
+	/**
+	 * 返回 调班审批人
+	 * @return
+	 */
+	public String getApprover() 
+	{
+		return this.approver;
+	}
+	public void setIsEffective(String isEffective) 
+	{
+		this.isEffective = isEffective;
+	}
+	/**
+	 * 返回 是否生效
+	 * @return
+	 */
+	public String getIsEffective() 
+	{
+		return this.isEffective;
+	}
+	public void setIsApprpval(String isApprpval) 
+	{
+		this.isApprpval = isApprpval;
+	}
+	/**
+	 * 返回 是否审批
+	 * @return
+	 */
+	public String getIsApprpval() 
+	{
+		return this.isApprpval;
+	}
+	
+}

+ 123 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/provider/ScheduleConfigProvider.java

@@ -0,0 +1,123 @@
+package com.lc.ibps.components.employee.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import com.lc.ibps.api.base.constants.StateEnum;
+import com.lc.ibps.api.base.query.QueryFilter;
+import com.lc.ibps.base.core.constants.StringPool;
+import com.lc.ibps.base.core.util.BeanUtils;
+import com.lc.ibps.cloud.entity.APIPageList;
+import com.lc.ibps.cloud.entity.APIRequest;
+import com.lc.ibps.cloud.entity.APIResult;
+import com.lc.ibps.cloud.provider.GenericProvider;
+import com.lc.ibps.components.employee.api.IScheduleConfigService;
+import com.lc.ibps.components.employee.domain.ScheduleConfig;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+import com.lc.ibps.components.employee.repository.ScheduleConfigRepository;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.Extension;
+import io.swagger.annotations.ExtensionProperty;
+
+/**
+ * 排班配置表 服务类
+ * <pre>
+ * 构建组:ibps-provider-scheduleConfig
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:11
+ *</pre>
+ */
+@Api(tags = "排班配置表管理", value = "排班配置表数据")
+@Service
+public class ScheduleConfigProvider extends GenericProvider implements IScheduleConfigService{
+
+	@Resource
+	private ScheduleConfigRepository scheduleConfigRepository;
+
+	@ApiOperation(value = "排班配置表列表(分页条件查询)数据", notes = "排班配置表列表(分页条件查询)数据")
+	@Override
+	public APIResult<APIPageList<ScheduleConfigPo>> query(
+			@ApiParam(name = "request", value = "传入查询请求json字符串", required = true) 
+			@RequestBody(required = true) APIRequest request) {
+		APIResult<APIPageList<ScheduleConfigPo>> result = new APIResult<>();
+		try {
+			QueryFilter queryFilter = getQueryFilter(request);
+			List<ScheduleConfigPo> data = scheduleConfigRepository.query(queryFilter);
+			APIPageList<ScheduleConfigPo> apiPageData = getAPIPageList(data);
+			result.setData(apiPageData);
+		} catch (Exception e) {
+			// TODO ERROR => other error message
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+
+	@ApiOperation(value = "根据id查询排班配置表", notes = "根据id查询排班配置表")
+	@Override
+	public APIResult<ScheduleConfigPo> get(
+			@ApiParam(name = "id", value = "查询id", required = true) 
+			@RequestParam(name = "id", required = true) String id) {
+		APIResult<ScheduleConfigPo> result = new APIResult<>();
+		try {
+			ScheduleConfigPo scheduleConfigPo = scheduleConfigRepository.get(id);
+			result.setData(scheduleConfigPo);
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+	
+	@ApiOperation(value = "保存", notes = "保存排班配置表信息", 
+			extensions = {
+					@Extension(properties = {
+							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
+					})
+			})
+	@Override
+	public APIResult<Void> save(
+			@ApiParam(name = "scheduleConfigPo", value = "排班配置表对象", required = true)  
+			@RequestBody(required = true) ScheduleConfigPo scheduleConfigPo) {
+		APIResult<Void> result = new APIResult<Void>();
+		try {
+			logger.info(" com.lc.ibps.components.provider.ScheduleConfigProvider.save()--->scheduleConfigPo: {}", scheduleConfigPo.toString());
+			ScheduleConfig domain = scheduleConfigRepository.newInstance(scheduleConfigPo);
+			domain.save();
+			result.setMessage("保存排班配置表成功");
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+
+	@ApiOperation(value = "删除", notes = "删除排班配置表", 
+			extensions = {
+					@Extension(properties = {
+							@ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
+					})
+			})
+	@Override
+	public APIResult<Void> remove(
+			@ApiParam(name = "ids", value = "排班配置表ID数组", required = true)  
+			@RequestParam(name = "ids", required = true) String[] ids) {
+		APIResult<Void> result = new APIResult<Void>();
+		try {
+			ScheduleConfig domain = scheduleConfigRepository.newInstance();
+			domain.deleteByIds(ids);
+			result.setMessage("删除排班配置表成功");
+		} catch (Exception e) {
+			setExceptionResult(result, StateEnum.ERROR.getCode(), StateEnum.ERROR.getText(), e);
+		}
+		return result;
+	}
+	
+}

+ 18 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/repository/ScheduleConfigRepository.java

@@ -0,0 +1,18 @@
+package com.lc.ibps.components.employee.repository;
+
+import com.lc.ibps.base.framework.repository.IRepository;
+import com.lc.ibps.components.employee.domain.ScheduleConfig;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+
+/**
+ * 排班配置表 仓库接口
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:09
+ *</pre>
+ */
+public interface ScheduleConfigRepository extends IRepository<String, ScheduleConfigPo,ScheduleConfig>{
+
+}

+ 56 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/employee/repository/impl/ScheduleConfigRepositoryImpl.java

@@ -0,0 +1,56 @@
+package com.lc.ibps.components.employee.repository.impl;
+
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Repository;
+
+import com.lc.ibps.base.core.util.AppUtil;
+import com.lc.ibps.base.framework.persistence.dao.IQueryDao;
+import com.lc.ibps.base.framework.repository.AbstractRepository;
+import com.lc.ibps.components.employee.domain.ScheduleConfig;
+import com.lc.ibps.components.employee.repository.ScheduleConfigRepository;
+import com.lc.ibps.components.employee.persistence.dao.ScheduleConfigQueryDao;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+
+/**
+ * 排班配置表 仓库的实现类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:09
+ *</pre>
+ */
+@Repository
+public class ScheduleConfigRepositoryImpl extends AbstractRepository<String, ScheduleConfigPo,ScheduleConfig> implements ScheduleConfigRepository{
+	  
+	@Resource
+	private  ScheduleConfigQueryDao scheduleConfigQueryDao;
+
+	public ScheduleConfig newInstance() {
+		ScheduleConfigPo po = new ScheduleConfigPo();
+		ScheduleConfig scheduleConfig = AppUtil.getBean(ScheduleConfig.class);
+		scheduleConfig.setData(po);
+		return scheduleConfig;
+	}
+
+	public ScheduleConfig newInstance(ScheduleConfigPo po) {
+		ScheduleConfig scheduleConfig = AppUtil.getBean(ScheduleConfig.class);
+		scheduleConfig.setData(po);
+		return scheduleConfig;
+	} 
+	
+	@Override
+	protected IQueryDao<String, ScheduleConfigPo> getQueryDao() {
+		return scheduleConfigQueryDao;
+	}
+	
+	@Override
+	public String getInternalCacheName() {
+		return "scheduleConfig";
+	}
+	
+
+	
+}

+ 98 - 0
ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/employee/persistence/mapping/ScheduleConfig.map.xml

@@ -0,0 +1,98 @@
+<?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.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo">
+	<!--<cache type="net.oschina.j2cache.mybatis.J2CacheAdapter"/>-->
+	<resultMap id="ScheduleConfigPo" type="com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo">
+		<id property="id" column="ID_" jdbcType="VARCHAR"/>
+		<result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR"/>
+		<result property="ip" column="IP_" jdbcType="VARCHAR"/>
+		<result property="createBy" column="CREATE_BY_" jdbcType="VARCHAR"/>
+		<result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP"/>
+		<result property="updateBy" column="UPDATE_BY_" jdbcType="VARCHAR"/>
+		<result property="updateTime" column="UPDATE_TIME_" jdbcType="TIMESTAMP"/>
+		<result property="diDian" column="DI_DIAN_" jdbcType="VARCHAR"/>
+		<result property="scheduleType" column="SCHEDULE_TYPE_" jdbcType="BLOB"/>
+		<result property="scheduleRule" column="SCHEDULE_RULE_" jdbcType="BLOB"/>
+		<result property="scheduleShift" column="SCHEDULE_SHIFT_" jdbcType="BLOB"/>
+		<result property="scheduleStaff" column="SCHEDULE_STAFF_" jdbcType="BLOB"/>
+		<result property="approver" column="APPROVER_" jdbcType="VARCHAR"/>
+		<result property="isEffective" column="IS_EFFECTIVE_" jdbcType="VARCHAR"/>
+		<result property="isApprpval" column="IS_APPRPVAL_" jdbcType="VARCHAR"/>
+	</resultMap>
+	
+	<sql id="columns">
+		ID_,TENANT_ID_,IP_,CREATE_BY_,CREATE_TIME_,UPDATE_BY_,UPDATE_TIME_,DI_DIAN_,SCHEDULE_TYPE_,SCHEDULE_RULE_,SCHEDULE_SHIFT_,SCHEDULE_STAFF_,APPROVER_,IS_EFFECTIVE_,IS_APPRPVAL_
+	</sql>
+	
+	<insert id="create" parameterType="com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo">
+		INSERT INTO T_SCHEDULE_CONFIG
+		(<include refid="columns"/>)
+		VALUES 
+		(#{id,jdbcType=VARCHAR}, #{tenantId,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{diDian,jdbcType=VARCHAR}, #{scheduleType,jdbcType=BLOB}, #{scheduleRule,jdbcType=BLOB}, #{scheduleShift,jdbcType=BLOB}, #{scheduleStaff,jdbcType=BLOB}, #{approver,jdbcType=VARCHAR}, #{isEffective,jdbcType=VARCHAR}, #{isApprpval,jdbcType=VARCHAR})
+	</insert>
+	
+	<select id="get" parameterType="java.lang.String" resultMap="ScheduleConfigPo">
+		SELECT <include refid="columns"/> FROM T_SCHEDULE_CONFIG 
+		WHERE 
+		ID_=#{id}
+	</select>
+	
+	
+	<sql id="querySql" >
+		SELECT <include refid="columns"/> FROM T_SCHEDULE_CONFIG
+		<where>
+			<if test="@o.Ognl@isNotEmpty(whereSql)">
+				${whereSql}
+			</if>
+		</where>
+		<if test="@o.Ognl@isNotEmpty(orderBySql)">
+			ORDER BY ${orderBySql}
+		</if>
+		<if test="@o.Ognl@isEmpty(orderBySql)">
+			ORDER BY ID_ DESC
+		</if>
+	</sql>
+	
+	<select id="query" parameterType="java.util.Map" resultMap="ScheduleConfigPo">
+		<include refid="querySql"/>
+	</select>
+	
+	<select id="queryIds" parameterType="java.util.Map" resultMap="ScheduleConfigPo">
+		SELECT ID_ FROM (<include refid="querySql"/>) T
+	</select>
+	
+	<select id="findByIds" resultMap="ScheduleConfigPo">
+		SELECT <include refid="columns"/> FROM T_SCHEDULE_CONFIG
+			WHERE ID_ in 
+			<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">  
+				#{id}  
+			</foreach>  		
+			ORDER BY ID_ DESC			
+	</select>	
+	
+	<update id="update" parameterType="com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo">
+		UPDATE T_SCHEDULE_CONFIG SET
+		TENANT_ID_=#{tenantId,jdbcType=VARCHAR},
+		IP_=#{ip,jdbcType=VARCHAR},
+		UPDATE_BY_=#{updateBy,jdbcType=VARCHAR},
+		UPDATE_TIME_=#{updateTime,jdbcType=TIMESTAMP},
+		DI_DIAN_=#{diDian,jdbcType=VARCHAR},
+		SCHEDULE_TYPE_=#{scheduleType,jdbcType=BLOB},
+		SCHEDULE_RULE_=#{scheduleRule,jdbcType=BLOB},
+		SCHEDULE_SHIFT_=#{scheduleShift,jdbcType=BLOB},
+		SCHEDULE_STAFF_=#{scheduleStaff,jdbcType=BLOB},
+		APPROVER_=#{approver,jdbcType=VARCHAR},
+		IS_EFFECTIVE_=#{isEffective,jdbcType=VARCHAR},
+		IS_APPRPVAL_=#{isApprpval,jdbcType=VARCHAR}
+		WHERE
+		ID_=#{id}
+	</update>
+	
+	<delete id="remove" parameterType="java.lang.String">
+		DELETE FROM T_SCHEDULE_CONFIG 
+		WHERE
+		ID_=#{id}
+	</delete>
+	
+	
+</mapper>

+ 25 - 0
ibps-provider-root/modules/provider-business/src/test/java/com/lc/ibps/components/EmployeeBaseTest.java

@@ -0,0 +1,25 @@
+package com.lc.ibps.components;
+
+import javax.annotation.Resource;
+
+import org.springframework.test.context.ContextConfiguration;
+
+import com.lc.ibps.base.framework.test.BaseTestCase;
+import com.lc.ibps.api.base.id.IdGenerator;
+
+/**
+ * 测试基类。</br>
+ * 模块其下的测试类均继承该子类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:08
+ *</pre>
+ */
+@ContextConfiguration({"classpath:conf/components-test.xml"})
+public class EmployeeBaseTest extends BaseTestCase{
+	
+	@Resource
+    protected IdGenerator idGenerator;
+}

+ 60 - 0
ibps-provider-root/modules/provider-business/src/test/java/com/lc/ibps/components/employee/domain/ScheduleConfigTest.java

@@ -0,0 +1,60 @@
+package com.lc.ibps.components.employee.domain;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.test.annotation.Rollback;
+
+import com.lc.ibps.components.employee.domain.ScheduleConfig;
+import com.lc.ibps.components.employee.repository.ScheduleConfigRepository;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+import com.lc.ibps.components.EmployeeBaseTest;
+
+/**
+ * 排班配置表 领域对象实体单元测试类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:09
+ *</pre>
+ */
+public class ScheduleConfigTest extends EmployeeBaseTest{
+	 
+	@Resource
+	private ScheduleConfigRepository scheduleConfigRepository;
+	
+	@Test
+	@Rollback(true)
+	public void create(){				
+		ScheduleConfig scheduleConfig = scheduleConfigRepository.newInstance();
+		
+		ScheduleConfigPo scheduleConfigPo=new ScheduleConfigPo();
+		scheduleConfigPo.setId(idGenerator.getId());
+		
+		scheduleConfig.setData(scheduleConfigPo);
+		
+		List<String> ids = new ArrayList<String>();
+		
+		scheduleConfig.create();	
+		ids.add(scheduleConfig.getId());
+						
+		ScheduleConfig scheduleConfig2 = scheduleConfigRepository.newInstance();
+		scheduleConfigPo.setId(idGenerator.getId());
+		scheduleConfig2.setData(scheduleConfigPo);
+		
+		scheduleConfig2.create();
+		ids.add(scheduleConfig2.getId());
+		
+		List<ScheduleConfigPo> scheduleConfigPoList = scheduleConfigRepository.findByIds(ids);
+		Assert.assertTrue(scheduleConfigPoList.size()>=2);
+		
+		List<ScheduleConfigPo>scheduleConfig1 = scheduleConfigRepository.findAll();
+		Assert.assertTrue(scheduleConfig1.size()>=2);
+
+	}
+}

+ 55 - 0
ibps-provider-root/modules/provider-business/src/test/java/com/lc/ibps/components/employee/persistence/dao/ScheduleConfigDaoTest.java

@@ -0,0 +1,55 @@
+package com.lc.ibps.components.employee.persistence.dao;
+
+import javax.annotation.Resource;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.test.annotation.Rollback;
+
+import com.lc.ibps.components.employee.persistence.dao.ScheduleConfigDao;
+import com.lc.ibps.components.employee.persistence.dao.ScheduleConfigQueryDao;
+import com.lc.ibps.components.employee.persistence.entity.ScheduleConfigPo;
+import com.lc.ibps.components.EmployeeBaseTest;
+
+/**
+ * 排班配置表 dao单元测试类
+ *
+ *<pre> 
+ * 开发公司:深圳市金源信通科技有限公司
+ * 开发人员:codegen
+ * 创建时间:2024-08-13 11:04:07
+ *</pre>
+ */
+public class ScheduleConfigDaoTest extends EmployeeBaseTest{
+
+	@Resource
+	private ScheduleConfigDao scheduleConfigDao;
+	
+	@Resource
+	private ScheduleConfigQueryDao scheduleConfigQueryDao;
+		
+	@Test
+	@Rollback(true)
+	public void testCrud(){
+		ScheduleConfigPo scheduleConfigPo=new ScheduleConfigPo();
+		scheduleConfigPo.setId(idGenerator.getId());
+		
+		//创建一实体
+		scheduleConfigDao.create(scheduleConfigPo);
+        Assert.assertNotNull(scheduleConfigPo.getId());
+        logger.debug("scheduleConfigPo1:"+ scheduleConfigPo.getId());
+		//获取一实体
+		ScheduleConfigPo scheduleConfigPo2=scheduleConfigQueryDao.get(scheduleConfigPo.getId());
+		Assert.assertNotNull(scheduleConfigPo2);
+		logger.debug("scheduleConfigPo2:" + scheduleConfigPo2.toString());
+		//更新一实体
+		scheduleConfigDao.update(scheduleConfigPo2);
+		
+		ScheduleConfigPo scheduleConfigPo3=scheduleConfigQueryDao.get(scheduleConfigPo.getId());
+		Assert.assertNotNull(scheduleConfigPo3);
+		logger.debug("scheduleConfigPo3:"+scheduleConfigPo3.toString());
+		//删除一实体
+		//scheduleConfigDao.remove(scheduleConfigPo.getId());
+	}
+	
+}