Commit a1f5fda5 by ilal Committed by chenzg

提交

parent cbf8c6ff
...@@ -717,6 +717,18 @@ public class ClockInTool { ...@@ -717,6 +717,18 @@ public class ClockInTool {
return res; return res;
} }
/**
* 时间戳转换时间
*/
public static String stampToDate5(String s){
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd HH:mm");
long lt = new Long(s);
Date date = new Date(lt);
res = simpleDateFormat.format(date);
return res;
}
public static String Str_Time_formatting(String str,String Format) { public static String Str_Time_formatting(String str,String Format) {
SimpleDateFormat sdf = new SimpleDateFormat(Format); SimpleDateFormat sdf = new SimpleDateFormat(Format);
......
...@@ -40,6 +40,7 @@ import cn.timer.api.bean.kqgl.PunchCardDetails; ...@@ -40,6 +40,7 @@ import cn.timer.api.bean.kqgl.PunchCardDetails;
import cn.timer.api.bean.kqgl.PunchRecord; import cn.timer.api.bean.kqgl.PunchRecord;
import cn.timer.api.bean.kqgl.Schedule; import cn.timer.api.bean.kqgl.Schedule;
import cn.timer.api.bean.kqgl.SpecialDate; import cn.timer.api.bean.kqgl.SpecialDate;
import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary; import cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary;
import cn.timer.api.bean.kqmk.KqglAssoRelationSummary; import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
import cn.timer.api.bean.sbgjj.SbgjjAssoDetailed; import cn.timer.api.bean.sbgjj.SbgjjAssoDetailed;
...@@ -71,6 +72,7 @@ import cn.timer.api.dao.kqgl.PunchCardDetailsMapper; ...@@ -71,6 +72,7 @@ import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
import cn.timer.api.dao.kqgl.PunchRecordMapper; import cn.timer.api.dao.kqgl.PunchRecordMapper;
import cn.timer.api.dao.kqgl.ScheduleMapper; import cn.timer.api.dao.kqgl.ScheduleMapper;
import cn.timer.api.dao.kqgl.SpecialDateMapper; import cn.timer.api.dao.kqgl.SpecialDateMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkjlMapper;
import cn.timer.api.dao.kqmk.KqglAssoMonthPunchSummaryMapper; import cn.timer.api.dao.kqmk.KqglAssoMonthPunchSummaryMapper;
import cn.timer.api.dao.kqmk.KqglAssoRelationSummaryMapper; import cn.timer.api.dao.kqmk.KqglAssoRelationSummaryMapper;
import cn.timer.api.dao.sbgjj.SbgjjAssoDetailedMapper; import cn.timer.api.dao.sbgjj.SbgjjAssoDetailedMapper;
...@@ -3368,6 +3370,9 @@ public class SalaryManagementController { ...@@ -3368,6 +3370,9 @@ public class SalaryManagementController {
@Autowired @Autowired
private KqglAssoRelationSummaryMapper kqglassorelationsummarymapper; private KqglAssoRelationSummaryMapper kqglassorelationsummarymapper;
@Autowired
private KqglAssoDkjlMapper kqglassodkjlmapper;
@PostMapping(value = "/pushpayslip") @PostMapping(value = "/pushpayslip")
@ApiOperation(value = "发送工资条", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "发送工资条", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> PushPayslip(@CurrentUser UserBean userBean,@RequestBody PushPayslipDto pays) { public Result<Object> PushPayslip(@CurrentUser UserBean userBean,@RequestBody PushPayslipDto pays) {
...@@ -3502,10 +3507,32 @@ public class SalaryManagementController { ...@@ -3502,10 +3507,32 @@ public class SalaryManagementController {
if(xzx.getOptionid() == 30) { if(xzx.getOptionid() == 30) {
spe.setItemname(xzx.getSalaryitem());// spe.setItemname(xzx.getSalaryitem());//
spe.setDeduction(xzb == null ? 0 : xzb.getXzxjg());//扣款金额 spe.setDeduction(xzb == null ? 0 : xzb.getXzxjg());//扣款金额
if(xzx.getGsid() == 1) {//次数 if(xzx.getGsid() == 1) {//次数
HolidayInquiryDto cdcs = kqglassodkjlmapper.TimesBeingLateLeavingEarly(userBean.getOrgCode(), pays.getUserid(), 1, pays.getXzyf().substring(2, 7));
HolidayInquiryDto ztcs = kqglassodkjlmapper.TimesBeingLateLeavingEarly(userBean.getOrgCode(), pays.getUserid(), 2, pays.getXzyf().substring(2, 7));
spe.setFieldone("迟到"+cdcs.getNum()+"次");//迟到
spe.setFieldtwo("早退"+ztcs.getNum()+"次");//早退
}else if(xzx.getGsid() == 2) {//分钟 }else if(xzx.getGsid() == 2) {//分钟
HolidayInquiryDto cdfz = kqglassodkjlmapper.MinutesLateLeaveEarly(userBean.getOrgCode(), pays.getUserid(), 1, pays.getXzyf().substring(2, 7));
HolidayInquiryDto ztfz = kqglassodkjlmapper.MinutesLateLeaveEarly(userBean.getOrgCode(), pays.getUserid(), 2, pays.getXzyf().substring(2, 7));
spe.setFieldone("迟到"+cdfz.getBalance()+"分钟");//迟到
spe.setFieldtwo("早退"+ztfz.getBalance()+"分钟");//早退
}
List<KqglAssoDkjl> cdzts = kqglassodkjlmapper.LateleaveEarly(userBean.getOrgCode(), pays.getUserid(), pays.getXzyf().substring(2, 7));
for(KqglAssoDkjl cz : cdzts) {
AppPaysSalaryTwoDto two = new AppPaysSalaryTwoDto();
if(cz.getType() == 1) {//上班
two.setTerm("迟到日期");
}else if(cz.getType() == 2) {//下班
two.setTerm("早退日期");
}
two.setSpecifictime(ClockInTool.stampToDate5(String.valueOf(cz.getDktime())));
two.setField(Double.valueOf(String.valueOf(cz.getResults())));
detailed.add(two);
} }
spe.setDetailed(detailed); spe.setDetailed(detailed);
......
...@@ -7,6 +7,7 @@ import org.springframework.stereotype.Repository; ...@@ -7,6 +7,7 @@ import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.kqmk.KqglAssoDkjl; import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import cn.timer.api.dto.xcgl.HolidayInquiryDto;
/** /**
* 打卡记录表 * 打卡记录表
...@@ -16,4 +17,10 @@ import cn.timer.api.bean.kqmk.KqglAssoDkjl; ...@@ -16,4 +17,10 @@ import cn.timer.api.bean.kqmk.KqglAssoDkjl;
@Repository @Repository
public interface KqglAssoDkjlMapper extends BaseMapper<KqglAssoDkjl> { public interface KqglAssoDkjlMapper extends BaseMapper<KqglAssoDkjl> {
List<KqglAssoDkjl> getDetailedRecordClock(Long start,Long end,Integer userId,String attdate,Integer qyid); List<KqglAssoDkjl> getDetailedRecordClock(Long start,Long end,Integer userId,String attdate,Integer qyid);
List<KqglAssoDkjl> LateleaveEarly(int qyid,int userid,String attdate);
HolidayInquiryDto MinutesLateLeaveEarly(int qyid,int userid,int mark,String attdate);
HolidayInquiryDto TimesBeingLateLeavingEarly(int qyid,int userid,int mark,String attdate);
} }
...@@ -27,56 +27,52 @@ ...@@ -27,56 +27,52 @@
<result column="punchequipment" property="punchequipment" /> <result column="punchequipment" property="punchequipment" />
<result column="commentary" property="commentary" /> <result column="commentary" property="commentary" />
</resultMap> </resultMap>
<sql id="Base_Column_List">
id,
dktime,
lon,
lat,
address,
results,
user_id,
type,
status,
sort,
card_type,
mac,
macname,
qyid,
attdate,
attime,
dkmxid,
bcid,
remarks,
punchmode,
punchequipment,
commentary
</sql>
<sql id="Base_Column_List_Alias"> <resultMap id="HolidayInquiryDtoMap" type="cn.timer.api.dto.xcgl.HolidayInquiryDto" >
id KqglAssoDkjl_id, <result column="num" property="num" />
dktime KqglAssoDkjl_dktime, <result column="balance" property="balance" />
lon KqglAssoDkjl_lon, </resultMap>
lat KqglAssoDkjl_lat,
address KqglAssoDkjl_address, <select id="TimesBeingLateLeavingEarly" resultMap="HolidayInquiryDtoMap">
results KqglAssoDkjl_results, select COUNT(*) as num
user_id KqglAssoDkjl_user_id, from kqgl_asso_dkjl dkjl
type KqglAssoDkjl_type, where dkjl.qyid = #{qyid}
status KqglAssoDkjl_status, and dkjl.sort != 0
sort KqglAssoDkjl_sort, and dkjl.user_id = #{userid}
card_type KqglAssoDkjl_card_type, <if test="mark == 1" >
mac KqglAssoDkjl_mac, and dkjl.`status` in (3,10,13)
macname KqglAssoDkjl_macname, </if>
qyid KqglAssoDkjl_qyid, <if test="mark == 2" >
attdate KqglAssoDkjl_attdate, and dkjl.`status` in (4,11,14)
attime KqglAssoDkjl_attime, </if>
dkmxid KqglAssoDkjl_dkmxid, and SUBSTR(dkjl.attdate,1,5) = #{attdate}
bcid KqglAssoDkjl_bcid, </select>
remarks KqglAssoDkjl_remarks,
punchmode KqglAssoDkjl_punchmode, <select id="MinutesLateLeaveEarly" resultMap="HolidayInquiryDtoMap">
punchequipment KqglAssoDkjl_punchequipment, select IFNULL(SUM(dkjl.results),0) as balance
commentary KqglAssoDkjl_explain from kqgl_asso_dkjl dkjl
</sql> where dkjl.qyid = #{qyid}
and dkjl.sort != 0
and dkjl.user_id = #{userid}
<if test="mark == 1" >
and dkjl.`status` in (3,10,13)
</if>
<if test="mark == 2" >
and dkjl.`status` in (4,11,14)
</if>
and SUBSTR(dkjl.attdate,1,5) = #{attdate}
</select>
<select id="LateleaveEarly" resultMap="BaseResultMap">
select dkjl.*
from kqgl_asso_dkjl dkjl
where dkjl.qyid = #{qyid}
and dkjl.sort != 0
and dkjl.user_id = #{userid}
and dkjl.`status` in (3,4,10,11,13,14)
and SUBSTR(dkjl.attdate,1,5) = #{attdate}
</select>
<select id="getDetailedRecordClock" resultMap="BaseResultMap"> <select id="getDetailedRecordClock" resultMap="BaseResultMap">
select * from kqgl_asso_dkjl dkjl select * from kqgl_asso_dkjl dkjl
...@@ -87,193 +83,5 @@ ...@@ -87,193 +83,5 @@
and dkjl.attdate = #{attdate} and dkjl.attdate = #{attdate}
and dkjl.qyid = #{qyid} and dkjl.qyid = #{qyid}
</select> </select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoDkjl">
INSERT INTO kqgl_asso_dkjl
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != dktime'>
dktime,
</if>
<if test ='null != lon'>
lon,
</if>
<if test ='null != lat'>
lat,
</if>
<if test ='null != address'>
address,
</if>
<if test ='null != results'>
results,
</if>
<if test ='null != userId'>
user_id,
</if>
<if test ='null != type'>
type,
</if>
<if test ='null != status'>
status,
</if>
<if test ='null != sort'>
sort,
</if>
<if test ='null != cardType'>
card_type,
</if>
<if test ='null != mac'>
mac,
</if>
<if test ='null != macname'>
macname,
</if>
<if test ='null != qyid'>
qyid,
</if>
<if test ='null != attdate'>
attdate,
</if>
<if test ='null != attime'>
attime,
</if>
<if test ='null != dkmxid'>
dkmxid,
</if>
<if test ='null != bcid'>
bcid,
</if>
<if test ='null != remarks'>
remarks,
</if>
<if test ='null != punchmode'>
punchmode,
</if>
<if test ='null != punchequipment'>
punchequipment,
</if>
<if test ='null != commentary'>
commentary
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != dktime'>
#{dktime},
</if>
<if test ='null != lon'>
#{lon},
</if>
<if test ='null != lat'>
#{lat},
</if>
<if test ='null != address'>
#{address},
</if>
<if test ='null != results'>
#{results},
</if>
<if test ='null != userId'>
#{userId},
</if>
<if test ='null != type'>
#{type},
</if>
<if test ='null != status'>
#{status},
</if>
<if test ='null != sort'>
#{sort},
</if>
<if test ='null != cardType'>
#{cardType},
</if>
<if test ='null != mac'>
#{mac},
</if>
<if test ='null != macname'>
#{macname},
</if>
<if test ='null != qyid'>
#{qyid},
</if>
<if test ='null != attdate'>
#{attdate},
</if>
<if test ='null != attime'>
#{attime},
</if>
<if test ='null != dkmxid'>
#{dkmxid},
</if>
<if test ='null != bcid'>
#{bcid},
</if>
<if test ='null != remarks'>
#{remarks},
</if>
<if test ='null != punchmode'>
#{punchmode},
</if>
<if test ='null != punchequipment'>
#{punchequipment},
</if>
<if test ='null != commentary'>
#{commentary}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_dkjl
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoDkjl">
UPDATE kqgl_asso_dkjl
<set>
<if test ='null != dktime'>dktime = #{dktime},</if>
<if test ='null != lon'>lon = #{lon},</if>
<if test ='null != lat'>lat = #{lat},</if>
<if test ='null != address'>address = #{address},</if>
<if test ='null != results'>results = #{results},</if>
<if test ='null != userId'>user_id = #{userId},</if>
<if test ='null != type'>type = #{type},</if>
<if test ='null != status'>status = #{status},</if>
<if test ='null != sort'>sort = #{sort},</if>
<if test ='null != cardType'>card_type = #{cardType},</if>
<if test ='null != mac'>mac = #{mac},</if>
<if test ='null != macname'>macname = #{macname},</if>
<if test ='null != qyid'>qyid = #{qyid},</if>
<if test ='null != attdate'>attdate = #{attdate},</if>
<if test ='null != attime'>attime = #{attime},</if>
<if test ='null != dkmxid'>dkmxid = #{dkmxid},</if>
<if test ='null != bcid'>bcid = #{bcid},</if>
<if test ='null != remarks'>remarks = #{remarks},</if>
<if test ='null != punchmode'>punchmode = #{punchmode},</if>
<if test ='null != punchequipment'>punchequipment = #{punchequipment},</if>
<if test ='null != commentary'>commentary = #{commentary}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_dkjl
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_dkjl
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_dkjl
</select>
-->
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment