| New file |
| | |
| | | package com.java110.dto.attendanceLog; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 考勤日志数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class AttendanceLogDto extends PageDto implements Serializable { |
| | | |
| | | private String departmentName; |
| | | private String departmentId; |
| | | private String staffName; |
| | | private String logId; |
| | | private String storeId; |
| | | private String staffId; |
| | | private String clockTime; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getDepartmentName() { |
| | | return departmentName; |
| | | } |
| | | public void setDepartmentName(String departmentName) { |
| | | this.departmentName = departmentName; |
| | | } |
| | | public String getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | public void setDepartmentId(String departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | public String getStaffName() { |
| | | return staffName; |
| | | } |
| | | public void setStaffName(String staffName) { |
| | | this.staffName = staffName; |
| | | } |
| | | public String getLogId() { |
| | | return logId; |
| | | } |
| | | public void setLogId(String logId) { |
| | | this.logId = logId; |
| | | } |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | public String getStaffId() { |
| | | return staffId; |
| | | } |
| | | public void setStaffId(String staffId) { |
| | | this.staffId = staffId; |
| | | } |
| | | public String getClockTime() { |
| | | return clockTime; |
| | | } |
| | | public void setClockTime(String clockTime) { |
| | | this.clockTime = clockTime; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.po.attendanceLog; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class AttendanceLogPo implements Serializable { |
| | | |
| | | private String departmentName; |
| | | private String departmentId; |
| | | private String staffName; |
| | | private String logId; |
| | | private String statusCd = "0"; |
| | | private String storeId; |
| | | private String staffId; |
| | | private String clockTime; |
| | | public String getDepartmentName() { |
| | | return departmentName; |
| | | } |
| | | public void setDepartmentName(String departmentName) { |
| | | this.departmentName = departmentName; |
| | | } |
| | | public String getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | public void setDepartmentId(String departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | public String getStaffName() { |
| | | return staffName; |
| | | } |
| | | public void setStaffName(String staffName) { |
| | | this.staffName = staffName; |
| | | } |
| | | public String getLogId() { |
| | | return logId; |
| | | } |
| | | public void setLogId(String logId) { |
| | | this.logId = logId; |
| | | } |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | public String getStaffId() { |
| | | return staffId; |
| | | } |
| | | public void setStaffId(String staffId) { |
| | | this.staffId = staffId; |
| | | } |
| | | public String getClockTime() { |
| | | return clockTime; |
| | | } |
| | | public void setClockTime(String clockTime) { |
| | | this.clockTime = clockTime; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?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="attendanceLogServiceDaoImpl"> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存考勤日志信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveAttendanceLogInfo" parameterType="Map"> |
| | | insert into attendance_log( |
| | | department_name,department_id,staff_name,log_id,store_id,staff_id,clock_time |
| | | ) values ( |
| | | #{departmentName},#{departmentId},#{staffName},#{logId},#{storeId},#{staffId},#{clockTime} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询考勤日志信息 add by wuxw 2018-07-03 --> |
| | | <select id="getAttendanceLogInfo" parameterType="Map" resultType="Map"> |
| | | select t.department_name,t.department_name departmentName,t.department_id,t.department_id departmentId,t.staff_name,t.staff_name staffName,t.log_id,t.log_id logId,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId,t.staff_id,t.staff_id staffId,t.clock_time,t.clock_time clockTime |
| | | from attendance_log t |
| | | where 1 =1 |
| | | <if test="departmentName !=null and departmentName != ''"> |
| | | and t.department_name= #{departmentName} |
| | | </if> |
| | | <if test="departmentId !=null and departmentId != ''"> |
| | | and t.department_id= #{departmentId} |
| | | </if> |
| | | <if test="staffName !=null and staffName != ''"> |
| | | and t.staff_name= #{staffName} |
| | | </if> |
| | | <if test="logId !=null and logId != ''"> |
| | | and t.log_id= #{logId} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="staffId !=null and staffId != ''"> |
| | | and t.staff_id= #{staffId} |
| | | </if> |
| | | <if test="clockTime !=null and clockTime != ''"> |
| | | and t.clock_time= #{clockTime} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改考勤日志信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateAttendanceLogInfo" parameterType="Map"> |
| | | update attendance_log t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="departmentName !=null and departmentName != ''"> |
| | | , t.department_name= #{departmentName} |
| | | </if> |
| | | <if test="departmentId !=null and departmentId != ''"> |
| | | , t.department_id= #{departmentId} |
| | | </if> |
| | | <if test="staffName !=null and staffName != ''"> |
| | | , t.staff_name= #{staffName} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | , t.store_id= #{storeId} |
| | | </if> |
| | | <if test="staffId !=null and staffId != ''"> |
| | | , t.staff_id= #{staffId} |
| | | </if> |
| | | <if test="clockTime !=null and clockTime != ''"> |
| | | , t.clock_time= #{clockTime} |
| | | </if> |
| | | where 1=1 <if test="logId !=null and logId != ''"> |
| | | and t.log_id= #{logId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询考勤日志数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryAttendanceLogsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from attendance_log t |
| | | where 1 =1 |
| | | <if test="departmentName !=null and departmentName != ''"> |
| | | and t.department_name= #{departmentName} |
| | | </if> |
| | | <if test="departmentId !=null and departmentId != ''"> |
| | | and t.department_id= #{departmentId} |
| | | </if> |
| | | <if test="staffName !=null and staffName != ''"> |
| | | and t.staff_name= #{staffName} |
| | | </if> |
| | | <if test="logId !=null and logId != ''"> |
| | | and t.log_id= #{logId} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="staffId !=null and staffId != ''"> |
| | | and t.staff_id= #{staffId} |
| | | </if> |
| | | <if test="clockTime !=null and clockTime != ''"> |
| | | and t.clock_time= #{clockTime} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "detailId", |
| | | "name": "attendanceClassesTaskDetail", |
| | | "desc": "考勤任务明细", |
| | | "id": "logId", |
| | | "name": "attendanceLog", |
| | | "desc": "考勤日志", |
| | | "shareParam": "storeId", |
| | | "shareColumn": "store_id", |
| | | "shareName": "common", |
| | | "tableName": "attendance_classes_task_detail", |
| | | "tableName": "attendance_log", |
| | | "param": { |
| | | "taskId": "task_id", |
| | | "detailId": "detail_id", |
| | | "specCd": "spec_cd", |
| | | "logId": "log_id", |
| | | "staffId": "staff_id", |
| | | "staffName": "staff_name", |
| | | "statusCd": "status_cd", |
| | | "value": "value", |
| | | "checkTime": "check_time", |
| | | "facePath": "face_path", |
| | | "state": "state", |
| | | "remark": "remark", |
| | | "departmentId": "department_id", |
| | | "departmentName": "department_name", |
| | | "clockTime": "clock_time", |
| | | "storeId": "store_id" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "taskId", |
| | | "msg": "任务不能为空" |
| | | "code": "staffId", |
| | | "msg": "员工不能为空" |
| | | }, |
| | | { |
| | | "code": "storeId", |
| New file |
| | |
| | | package com.java110.intf.common; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.attendanceLog.AttendanceLogDto; |
| | | import com.java110.po.attendanceLog.AttendanceLogPo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName IAttendanceLogInnerServiceSMO |
| | | * @Description 考勤日志接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "common-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/attendanceLogApi") |
| | | public interface IAttendanceLogInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveAttendanceLog", method = RequestMethod.POST) |
| | | public int saveAttendanceLog(@RequestBody AttendanceLogPo attendanceLogPo); |
| | | |
| | | @RequestMapping(value = "/updateAttendanceLog", method = RequestMethod.POST) |
| | | public int updateAttendanceLog(@RequestBody AttendanceLogPo attendanceLogPo); |
| | | |
| | | @RequestMapping(value = "/deleteAttendanceLog", method = RequestMethod.POST) |
| | | public int deleteAttendanceLog(@RequestBody AttendanceLogPo attendanceLogPo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param attendanceLogDto 数据对象分享 |
| | | * @return AttendanceLogDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryAttendanceLogs", method = RequestMethod.POST) |
| | | List<AttendanceLogDto> queryAttendanceLogs(@RequestBody AttendanceLogDto attendanceLogDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param attendanceLogDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryAttendanceLogsCount", method = RequestMethod.POST) |
| | | int queryAttendanceLogsCount(@RequestBody AttendanceLogDto attendanceLogDto); |
| | | } |
| | |
| | | import com.java110.common.bmo.attendanceClassesTaskDetail.IGetAttendanceClassesTaskDetailBMO; |
| | | import com.java110.common.bmo.attendanceClassesTaskDetail.ISaveAttendanceClassesTaskDetailBMO; |
| | | import com.java110.common.bmo.attendanceClassesTaskDetail.IUpdateAttendanceClassesTaskDetailBMO; |
| | | import com.java110.common.bmo.attendanceLog.IDeleteAttendanceLogBMO; |
| | | import com.java110.common.bmo.attendanceLog.IGetAttendanceLogBMO; |
| | | import com.java110.common.bmo.attendanceLog.ISaveAttendanceLogBMO; |
| | | import com.java110.common.bmo.attendanceLog.IUpdateAttendanceLogBMO; |
| | | import com.java110.dto.attendanceClassesTask.AttendanceClassesTaskDto; |
| | | import com.java110.dto.attendanceClassesTaskDetail.AttendanceClassesTaskDetailDto; |
| | | import com.java110.dto.attendanceLog.AttendanceLogDto; |
| | | import com.java110.po.attendanceClassesTask.AttendanceClassesTaskPo; |
| | | import com.java110.po.attendanceClassesTaskDetail.AttendanceClassesTaskDetailPo; |
| | | import com.java110.po.attendanceLog.AttendanceLogPo; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | |
| | | |
| | | @Autowired |
| | | private IGetAttendanceClassesTaskDetailBMO getAttendanceClassesTaskDetailBMOImpl; |
| | | |
| | | @Autowired |
| | | private ISaveAttendanceLogBMO saveAttendanceLogBMOImpl; |
| | | @Autowired |
| | | private IUpdateAttendanceLogBMO updateAttendanceLogBMOImpl; |
| | | @Autowired |
| | | private IDeleteAttendanceLogBMO deleteAttendanceLogBMOImpl; |
| | | |
| | | @Autowired |
| | | private IGetAttendanceLogBMO getAttendanceLogBMOImpl; |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | |
| | | |
| | | /** |
| | | * 添加设备接口类 |
| | | * @serviceCode /attendanceClass/getMonthAttendance |
| | | * @path /app/attendanceClass/getMonthAttendance |
| | | * |
| | | * @return 成功或者失败 |
| | | * @throws Exception |
| | | * @serviceCode /attendanceClass/getMonthAttendance |
| | | * @path /app/attendanceClass/getMonthAttendance |
| | | */ |
| | | @RequestMapping(path = "/getMonthAttendance", method = RequestMethod.GET) |
| | | public ResponseEntity<String> getMonthAttendance( |
| | |
| | | attendanceClassesTaskDto.setTaskYear(calendar.get(Calendar.YEAR) + ""); |
| | | attendanceClassesTaskDto.setTaskMonth((calendar.get(Calendar.MONTH) + 1) + ""); |
| | | } |
| | | return getAttendanceClassesTaskDetailBMOImpl.getMonthAttendance(attendanceClassesTaskDto); |
| | | return getAttendanceClassesTaskDetailBMOImpl.getMonthAttendance(attendanceClassesTaskDto); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /attendanceClass/saveAttendanceLog |
| | | * @path /app/attendanceClass/saveAttendanceLog |
| | | */ |
| | | @RequestMapping(value = "/saveAttendanceLog", method = RequestMethod.POST) |
| | | public ResponseEntity<String> saveAttendanceLog(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId"); |
| | | |
| | | |
| | | AttendanceLogPo attendanceLogPo = BeanConvertUtil.covertBean(reqJson, AttendanceLogPo.class); |
| | | return saveAttendanceLogBMOImpl.save(attendanceLogPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信修改消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /attendanceClass/updateAttendanceLog |
| | | * @path /app/attendanceClass/updateAttendanceLog |
| | | */ |
| | | @RequestMapping(value = "/updateAttendanceLog", method = RequestMethod.POST) |
| | | public ResponseEntity<String> updateAttendanceLog(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId"); |
| | | Assert.hasKeyAndValue(reqJson, "logId", "logId不能为空"); |
| | | |
| | | |
| | | AttendanceLogPo attendanceLogPo = BeanConvertUtil.covertBean(reqJson, AttendanceLogPo.class); |
| | | return updateAttendanceLogBMOImpl.update(attendanceLogPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /attendanceClass/deleteAttendanceLog |
| | | * @path /app/attendanceClass/deleteAttendanceLog |
| | | */ |
| | | @RequestMapping(value = "/deleteAttendanceLog", method = RequestMethod.POST) |
| | | public ResponseEntity<String> deleteAttendanceLog(@RequestBody JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "logId", "logId不能为空"); |
| | | |
| | | |
| | | AttendanceLogPo attendanceLogPo = BeanConvertUtil.covertBean(reqJson, AttendanceLogPo.class); |
| | | return deleteAttendanceLogBMOImpl.delete(attendanceLogPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param storeId 商户ID |
| | | * @return |
| | | * @serviceCode /attendanceClass/queryAttendanceLog |
| | | * @path /app/attendanceClass/queryAttendanceLog |
| | | */ |
| | | @RequestMapping(value = "/queryAttendanceLog", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryAttendanceLog(@RequestHeader(value = "store-id") String storeId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | AttendanceLogDto attendanceLogDto = new AttendanceLogDto(); |
| | | attendanceLogDto.setPage(page); |
| | | attendanceLogDto.setRow(row); |
| | | attendanceLogDto.setStoreId(storeId); |
| | | return getAttendanceLogBMOImpl.get(attendanceLogDto); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.attendanceLog; |
| | | import com.java110.po.attendanceLog.AttendanceLogPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteAttendanceLogBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改考勤日志 |
| | | * add by wuxw |
| | | * @param attendanceLogPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(AttendanceLogPo attendanceLogPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.attendanceLog; |
| | | import com.java110.dto.attendanceLog.AttendanceLogDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | public interface IGetAttendanceLogBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询考勤日志 |
| | | * add by wuxw |
| | | * @param attendanceLogDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(AttendanceLogDto attendanceLogDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.attendanceLog; |
| | | |
| | | import com.java110.po.attendanceLog.AttendanceLogPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | public interface ISaveAttendanceLogBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加考勤日志 |
| | | * add by wuxw |
| | | * @param attendanceLogPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(AttendanceLogPo attendanceLogPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.attendanceLog; |
| | | import com.java110.po.attendanceLog.AttendanceLogPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateAttendanceLogBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改考勤日志 |
| | | * add by wuxw |
| | | * @param attendanceLogPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(AttendanceLogPo attendanceLogPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.attendanceLog.impl; |
| | | |
| | | import com.java110.common.bmo.attendanceLog.IDeleteAttendanceLogBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.common.IAttendanceLogInnerServiceSMO; |
| | | import com.java110.po.attendanceLog.AttendanceLogPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteAttendanceLogBMOImpl") |
| | | public class DeleteAttendanceLogBMOImpl implements IDeleteAttendanceLogBMO { |
| | | |
| | | @Autowired |
| | | private IAttendanceLogInnerServiceSMO attendanceLogInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param attendanceLogPo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(AttendanceLogPo attendanceLogPo) { |
| | | |
| | | int flag = attendanceLogInnerServiceSMOImpl.deleteAttendanceLog(attendanceLogPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.attendanceLog.impl; |
| | | |
| | | import com.java110.common.bmo.attendanceLog.IGetAttendanceLogBMO; |
| | | import com.java110.dto.attendanceLog.AttendanceLogDto; |
| | | import com.java110.intf.common.IAttendanceLogInnerServiceSMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("getAttendanceLogBMOImpl") |
| | | public class GetAttendanceLogBMOImpl implements IGetAttendanceLogBMO { |
| | | |
| | | @Autowired |
| | | private IAttendanceLogInnerServiceSMO attendanceLogInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param attendanceLogDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(AttendanceLogDto attendanceLogDto) { |
| | | |
| | | |
| | | int count = attendanceLogInnerServiceSMOImpl.queryAttendanceLogsCount(attendanceLogDto); |
| | | |
| | | List<AttendanceLogDto> attendanceLogDtos = null; |
| | | if (count > 0) { |
| | | attendanceLogDtos = attendanceLogInnerServiceSMOImpl.queryAttendanceLogs(attendanceLogDto); |
| | | } else { |
| | | attendanceLogDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) attendanceLogDto.getRow()), count, attendanceLogDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.attendanceLog.impl; |
| | | |
| | | import com.java110.common.bmo.attendanceLog.ISaveAttendanceLogBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.common.IAttendanceLogInnerServiceSMO; |
| | | import com.java110.po.attendanceLog.AttendanceLogPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveAttendanceLogBMOImpl") |
| | | public class SaveAttendanceLogBMOImpl implements ISaveAttendanceLogBMO { |
| | | |
| | | @Autowired |
| | | private IAttendanceLogInnerServiceSMO attendanceLogInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param attendanceLogPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> save(AttendanceLogPo attendanceLogPo) { |
| | | |
| | | attendanceLogPo.setLogId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_logId)); |
| | | int flag = attendanceLogInnerServiceSMOImpl.saveAttendanceLog(attendanceLogPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.attendanceLog.impl; |
| | | |
| | | import com.java110.common.bmo.attendanceLog.IUpdateAttendanceLogBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.common.IAttendanceLogInnerServiceSMO; |
| | | import com.java110.po.attendanceLog.AttendanceLogPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateAttendanceLogBMOImpl") |
| | | public class UpdateAttendanceLogBMOImpl implements IUpdateAttendanceLogBMO { |
| | | |
| | | @Autowired |
| | | private IAttendanceLogInnerServiceSMO attendanceLogInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param attendanceLogPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(AttendanceLogPo attendanceLogPo) { |
| | | |
| | | int flag = attendanceLogInnerServiceSMOImpl.updateAttendanceLog(attendanceLogPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 考勤日志组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 考勤日志服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IAttendanceLogServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 考勤日志信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveAttendanceLogInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询考勤日志信息(instance过程) |
| | | * 根据bId 查询考勤日志信息 |
| | | * @param info bId 信息 |
| | | * @return 考勤日志信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getAttendanceLogInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改考勤日志信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateAttendanceLogInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询考勤日志总数 |
| | | * |
| | | * @param info 考勤日志信息 |
| | | * @return 考勤日志数量 |
| | | */ |
| | | int queryAttendanceLogsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.common.dao.IAttendanceLogServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 考勤日志服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("attendanceLogServiceDaoImpl") |
| | | //@Transactional |
| | | public class AttendanceLogServiceDaoImpl extends BaseServiceDao implements IAttendanceLogServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(AttendanceLogServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存考勤日志信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveAttendanceLogInfo(Map info) throws DAOException { |
| | | logger.debug("保存考勤日志信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("attendanceLogServiceDaoImpl.saveAttendanceLogInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存考勤日志信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询考勤日志信息(instance) |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getAttendanceLogInfo(Map info) throws DAOException { |
| | | logger.debug("查询考勤日志信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessAttendanceLogInfos = sqlSessionTemplate.selectList("attendanceLogServiceDaoImpl.getAttendanceLogInfo",info); |
| | | |
| | | return businessAttendanceLogInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改考勤日志信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateAttendanceLogInfo(Map info) throws DAOException { |
| | | logger.debug("修改考勤日志信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("attendanceLogServiceDaoImpl.updateAttendanceLogInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改考勤日志信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询考勤日志数量 |
| | | * @param info 考勤日志信息 |
| | | * @return 考勤日志数量 |
| | | */ |
| | | @Override |
| | | public int queryAttendanceLogsCount(Map info) { |
| | | logger.debug("查询考勤日志数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessAttendanceLogInfos = sqlSessionTemplate.selectList("attendanceLogServiceDaoImpl.queryAttendanceLogsCount", info); |
| | | if (businessAttendanceLogInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessAttendanceLogInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.smo.impl; |
| | | |
| | | |
| | | import com.java110.common.dao.IAttendanceLogServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.attendanceLog.AttendanceLogDto; |
| | | import com.java110.intf.common.IAttendanceLogInnerServiceSMO; |
| | | import com.java110.po.attendanceLog.AttendanceLogPo; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 考勤日志内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class AttendanceLogInnerServiceSMOImpl extends BaseServiceSMO implements IAttendanceLogInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IAttendanceLogServiceDao attendanceLogServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveAttendanceLog(@RequestBody AttendanceLogPo attendanceLogPo) { |
| | | int saveFlag = 1; |
| | | attendanceLogServiceDaoImpl.saveAttendanceLogInfo(BeanConvertUtil.beanCovertMap(attendanceLogPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateAttendanceLog(@RequestBody AttendanceLogPo attendanceLogPo) { |
| | | int saveFlag = 1; |
| | | attendanceLogServiceDaoImpl.updateAttendanceLogInfo(BeanConvertUtil.beanCovertMap(attendanceLogPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteAttendanceLog(@RequestBody AttendanceLogPo attendanceLogPo) { |
| | | int saveFlag = 1; |
| | | attendanceLogPo.setStatusCd("1"); |
| | | attendanceLogServiceDaoImpl.updateAttendanceLogInfo(BeanConvertUtil.beanCovertMap(attendanceLogPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<AttendanceLogDto> queryAttendanceLogs(@RequestBody AttendanceLogDto attendanceLogDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = attendanceLogDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | attendanceLogDto.setPage((page - 1) * attendanceLogDto.getRow()); |
| | | } |
| | | |
| | | List<AttendanceLogDto> attendanceLogs = BeanConvertUtil.covertBeanList(attendanceLogServiceDaoImpl.getAttendanceLogInfo(BeanConvertUtil.beanCovertMap(attendanceLogDto)), AttendanceLogDto.class); |
| | | |
| | | return attendanceLogs; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryAttendanceLogsCount(@RequestBody AttendanceLogDto attendanceLogDto) { |
| | | return attendanceLogServiceDaoImpl.queryAttendanceLogsCount(BeanConvertUtil.beanCovertMap(attendanceLogDto)); |
| | | } |
| | | |
| | | public IAttendanceLogServiceDao getAttendanceLogServiceDaoImpl() { |
| | | return attendanceLogServiceDaoImpl; |
| | | } |
| | | |
| | | public void setAttendanceLogServiceDaoImpl(IAttendanceLogServiceDao attendanceLogServiceDaoImpl) { |
| | | this.attendanceLogServiceDaoImpl = attendanceLogServiceDaoImpl; |
| | | } |
| | | } |