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);
} }
...@@ -28,55 +28,51 @@ ...@@ -28,55 +28,51 @@
<result column="commentary" property="commentary" /> <result column="commentary" property="commentary" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <resultMap id="HolidayInquiryDtoMap" type="cn.timer.api.dto.xcgl.HolidayInquiryDto" >
id, <result column="num" property="num" />
dktime, <result column="balance" property="balance" />
lon, </resultMap>
lat,
address, <select id="TimesBeingLateLeavingEarly" resultMap="HolidayInquiryDtoMap">
results, select COUNT(*) as num
user_id, from kqgl_asso_dkjl dkjl
type, where dkjl.qyid = #{qyid}
status, and dkjl.sort != 0
sort, and dkjl.user_id = #{userid}
card_type, <if test="mark == 1" >
mac, and dkjl.`status` in (3,10,13)
macname, </if>
qyid, <if test="mark == 2" >
attdate, and dkjl.`status` in (4,11,14)
attime, </if>
dkmxid, and SUBSTR(dkjl.attdate,1,5) = #{attdate}
bcid, </select>
remarks,
punchmode, <select id="MinutesLateLeaveEarly" resultMap="HolidayInquiryDtoMap">
punchequipment, select IFNULL(SUM(dkjl.results),0) as balance
commentary 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>
<sql id="Base_Column_List_Alias"> <select id="LateleaveEarly" resultMap="BaseResultMap">
id KqglAssoDkjl_id, select dkjl.*
dktime KqglAssoDkjl_dktime, from kqgl_asso_dkjl dkjl
lon KqglAssoDkjl_lon, where dkjl.qyid = #{qyid}
lat KqglAssoDkjl_lat, and dkjl.sort != 0
address KqglAssoDkjl_address, and dkjl.user_id = #{userid}
results KqglAssoDkjl_results, and dkjl.`status` in (3,4,10,11,13,14)
user_id KqglAssoDkjl_user_id, and SUBSTR(dkjl.attdate,1,5) = #{attdate}
type KqglAssoDkjl_type, </select>
status KqglAssoDkjl_status,
sort KqglAssoDkjl_sort,
card_type KqglAssoDkjl_card_type,
mac KqglAssoDkjl_mac,
macname KqglAssoDkjl_macname,
qyid KqglAssoDkjl_qyid,
attdate KqglAssoDkjl_attdate,
attime KqglAssoDkjl_attime,
dkmxid KqglAssoDkjl_dkmxid,
bcid KqglAssoDkjl_bcid,
remarks KqglAssoDkjl_remarks,
punchmode KqglAssoDkjl_punchmode,
punchequipment KqglAssoDkjl_punchequipment,
commentary KqglAssoDkjl_explain
</sql>
<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