This commit is contained in:
parent
c57ca0f43c
commit
db51ea4fad
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.kjsData.attendance.dao;
|
||||
|
||||
import com.hzya.frame.kjsData.attendance.entity.AttendanceEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (attendance: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-19 13:26:00
|
||||
*/
|
||||
public interface IAttendanceDao extends IBaseDao<AttendanceEntity, String> {
|
||||
|
||||
Integer createLists(List<AttendanceEntity> entities);
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.hzya.frame.kjsData.attendance.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.kjsData.attendance.entity.AttendanceEntity;
|
||||
import com.hzya.frame.kjsData.attendance.dao.IAttendanceDao;
|
||||
import com.hzya.frame.wms_21.basemdm.entity.CustomerEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Attendance)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-19 13:26:00
|
||||
*/
|
||||
@Repository("AttendanceDaoImpl")
|
||||
public class AttendanceDaoImpl extends MybatisGenericDao<AttendanceEntity, String> implements IAttendanceDao{
|
||||
@DS("KJS_DATA")
|
||||
@Override
|
||||
public Integer createLists(List<AttendanceEntity> entities) {
|
||||
return super.insert("com.hzya.frame.kjsData.attendance.dao.impl.AttendanceEntityDaoImpl.AttendanceEntityInsertBatch",entities);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,173 @@
|
|||
package com.hzya.frame.kjsData.attendance.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* (Attendance)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-19 13:26:00
|
||||
*/
|
||||
public class AttendanceEntity extends BaseEntity {
|
||||
|
||||
private String userid;
|
||||
|
||||
private String username;
|
||||
|
||||
private String userdept;
|
||||
|
||||
private String userjob;
|
||||
|
||||
private String useraddress;
|
||||
|
||||
private String userlatitude;
|
||||
|
||||
private String userlongitude;
|
||||
|
||||
private String checktype;
|
||||
|
||||
private String sourcetype;
|
||||
|
||||
private String basechecktime;
|
||||
|
||||
private String gmtmodified;
|
||||
|
||||
private String userchecktime;
|
||||
|
||||
private String locationresult;
|
||||
|
||||
private String timeresult;
|
||||
|
||||
private String workdate;
|
||||
|
||||
private String outsideremark;
|
||||
|
||||
public String getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(String userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getUserdept() {
|
||||
return userdept;
|
||||
}
|
||||
|
||||
public void setUserdept(String userdept) {
|
||||
this.userdept = userdept;
|
||||
}
|
||||
|
||||
public String getUserjob() {
|
||||
return userjob;
|
||||
}
|
||||
|
||||
public void setUserjob(String userjob) {
|
||||
this.userjob = userjob;
|
||||
}
|
||||
|
||||
public String getUseraddress() {
|
||||
return useraddress;
|
||||
}
|
||||
|
||||
public void setUseraddress(String useraddress) {
|
||||
this.useraddress = useraddress;
|
||||
}
|
||||
|
||||
public String getUserlatitude() {
|
||||
return userlatitude;
|
||||
}
|
||||
|
||||
public void setUserlatitude(String userlatitude) {
|
||||
this.userlatitude = userlatitude;
|
||||
}
|
||||
|
||||
public String getUserlongitude() {
|
||||
return userlongitude;
|
||||
}
|
||||
|
||||
public void setUserlongitude(String userlongitude) {
|
||||
this.userlongitude = userlongitude;
|
||||
}
|
||||
|
||||
public String getChecktype() {
|
||||
return checktype;
|
||||
}
|
||||
|
||||
public void setChecktype(String checktype) {
|
||||
this.checktype = checktype;
|
||||
}
|
||||
|
||||
public String getSourcetype() {
|
||||
return sourcetype;
|
||||
}
|
||||
|
||||
public void setSourcetype(String sourcetype) {
|
||||
this.sourcetype = sourcetype;
|
||||
}
|
||||
|
||||
public String getBasechecktime() {
|
||||
return basechecktime;
|
||||
}
|
||||
|
||||
public void setBasechecktime(String basechecktime) {
|
||||
this.basechecktime = basechecktime;
|
||||
}
|
||||
|
||||
public String getGmtmodified() {
|
||||
return gmtmodified;
|
||||
}
|
||||
|
||||
public void setGmtmodified(String gmtmodified) {
|
||||
this.gmtmodified = gmtmodified;
|
||||
}
|
||||
|
||||
public String getUserchecktime() {
|
||||
return userchecktime;
|
||||
}
|
||||
|
||||
public void setUserchecktime(String userchecktime) {
|
||||
this.userchecktime = userchecktime;
|
||||
}
|
||||
|
||||
public String getLocationresult() {
|
||||
return locationresult;
|
||||
}
|
||||
|
||||
public void setLocationresult(String locationresult) {
|
||||
this.locationresult = locationresult;
|
||||
}
|
||||
|
||||
public String getTimeresult() {
|
||||
return timeresult;
|
||||
}
|
||||
|
||||
public void setTimeresult(String timeresult) {
|
||||
this.timeresult = timeresult;
|
||||
}
|
||||
|
||||
public String getWorkdate() {
|
||||
return workdate;
|
||||
}
|
||||
|
||||
public void setWorkdate(String workdate) {
|
||||
this.workdate = workdate;
|
||||
}
|
||||
|
||||
public String getOutsideremark() {
|
||||
return outsideremark;
|
||||
}
|
||||
|
||||
public void setOutsideremark(String outsideremark) {
|
||||
this.outsideremark = outsideremark;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?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.hzya.frame.kjsData.attendance.dao.impl.AttendanceEntityDaoImpl">
|
||||
|
||||
<!-- 批量新增 -->
|
||||
<insert id="AttendanceEntityInsertBatch">
|
||||
insert into attendance(userId, userName, userDept, userJob, userAddress, userLatitude, userLongitude, checkType, sourceType, baseCheckTime, gmtModified, userCheckTime, locationResult, timeResult, workDate, outsideRemark)
|
||||
values
|
||||
<foreach collection="list" item="entity" separator=",">
|
||||
(#{entity.userid},#{entity.username},#{entity.userdept},#{entity.userjob},#{entity.useraddress},#{entity.userlatitude},#{entity.userlongitude},#{entity.checktype},#{entity.sourcetype},
|
||||
#{entity.basechecktime}, #{entity.gmtmodified}, #{entity.userchecktime},
|
||||
#{entity.locationresult},#{entity.timeresult},#{entity.workdate},#{entity.outsideremark})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.kjsData.attendance.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.kjsData.attendance.entity.AttendanceEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* (Attendance)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-19 13:26:00
|
||||
*/
|
||||
public interface IAttendanceService{
|
||||
|
||||
JsonResultEntity createRecord(JSONObject requestData);
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.hzya.frame.kjsData.attendance.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.hzya.frame.kjsData.attendance.entity.AttendanceEntity;
|
||||
import com.hzya.frame.kjsData.attendance.dao.IAttendanceDao;
|
||||
import com.hzya.frame.kjsData.attendance.service.IAttendanceService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import com.hzya.frame.wms_21.basemdm.service.impl.BaseMdmServiceImpl;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (Attendance)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-19 13:26:00
|
||||
*/
|
||||
@Service("attendanceService")
|
||||
public class AttendanceServiceImpl implements IAttendanceService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AttendanceServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private IAttendanceDao attendanceDao;
|
||||
|
||||
@Override
|
||||
public JsonResultEntity createRecord(JSONObject requestData){
|
||||
List<AttendanceEntity> list = new ArrayList<>();
|
||||
JSONArray jsonArray = requestData.getJSONArray("jsonStr");
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
AttendanceEntity entity = JSONObject.parseObject(jsonObject.toString(), new TypeReference<AttendanceEntity>() {});
|
||||
list.add(entity);
|
||||
}
|
||||
attendanceDao.createLists(list);
|
||||
return new JsonResultEntity("插入成功:"+ JSON.toJSONString(list),true);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue