Commit a5e2f023 authored by hongguangwu's avatar hongguangwu

优化RED_DATA

parent 851d9160
......@@ -169,6 +169,14 @@ public class TIncome {
@Length(max = 6, message = "数据生成月份不能超过6个字符")
@ExcelProperty("数据生成月份")
private String dataCreateMonth;
/**
* 红冲:0否1是
*/
@ExcelAttribute(name = "红冲:0否1是", maxLength = 1)
@ExcelProperty("红冲:0否1是")
private String redData;
/**
* 推送状态:0未推送1已推送
*/
......
......@@ -178,4 +178,11 @@ public class TIncomeDetail {
@ExcelProperty("来源id,红冲使用")
private String sourceId;
/**
* 红冲:0否1是
*/
@ExcelAttribute(name = "红冲:0否1是", maxLength = 1)
@ExcelProperty("红冲:0否1是")
private String redData;
}
......@@ -24,6 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 收入明细表
*
......@@ -38,4 +40,7 @@ public interface TIncomeMapper extends BaseMapper<TIncome> {
* @return
*/
IPage<TIncome> getTIncomePage(Page<TIncome> page, @Param("tIncome") TIncome tIncome);
List<TIncome> getTIncomeList(@Param("tIncome") TIncome tIncome);
}
......@@ -262,11 +262,27 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
**/
@Override
public boolean saveDetail(TIncomeDetail tIncomeDetail) {
if (Common.isEmpty(tIncomeDetail.getEmpIdcard())
|| Common.isEmpty(tIncomeDetail.getDeptId())
|| Common.isEmpty(tIncomeDetail.getPayMonth())) {
return false;
}
tIncomeDetail.setCreateTime(new Date());
tIncomeDetail.setDataCreateMonth(DateUtil.addMonth(0));
tIncomeDetailService.save(tIncomeDetail);
// TODO-获取对应信息的统计表,根据项目配置,判断是否可以加一条统计:
TIncome income = new TIncome();
income.setEmpIdcard(tIncomeDetail.getEmpIdcard());
income.setDeptId(tIncomeDetail.getDeptId());
income.setPayMonth(tIncomeDetail.getPayMonth());
List<TIncome> incomeList = baseMapper.getTIncomeList(income);
if (incomeList == null || incomeList.isEmpty()) {
BeanUtil.copyProperties(tIncomeDetail, income);
income.setPushStatus(CommonConstants.ZERO_STRING);
}
return true;
}
}
......@@ -43,6 +43,7 @@
<result property="createTime" column="CREATE_TIME"/>
<result property="dataCreateMonth" column="DATA_CREATE_MONTH"/>
<result property="sourceId" column="SOURCE_ID"/>
<result property="redData" column="RED_DATA"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -63,7 +64,8 @@
a.PAY_MONTH,
a.CREATE_TIME,
a.DATA_CREATE_MONTH,
a.SOURCE_ID
a.SOURCE_ID,
a.RED_DATA
</sql>
<sql id="tIncomeDetail_where">
<if test="tIncomeDetail != null">
......@@ -124,6 +126,9 @@
<if test="tIncomeDetail.sourceId != null and tIncomeDetail.sourceId.trim() != ''">
AND a.SOURCE_ID = #{tIncomeDetail.sourceId}
</if>
<if test="tIncomeDetail.redData != null and tIncomeDetail.redData.trim() != ''">
AND a.RED_DATA = #{tIncomeDetail.redData}
</if>
</if>
</sql>
......
......@@ -43,6 +43,7 @@
<result property="createTime" column="CREATE_TIME"/>
<result property="dataCreateMonth" column="DATA_CREATE_MONTH"/>
<result property="pushStatus" column="PUSH_STATUS"/>
<result property="redData" column="RED_DATA"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -63,7 +64,8 @@
a.PAY_MONTH,
a.CREATE_TIME,
a.DATA_CREATE_MONTH,
a.PUSH_STATUS
a.PUSH_STATUS,
a.RED_DATA
</sql>
<sql id="tIncome_where">
<if test="tIncome != null">
......@@ -124,6 +126,9 @@
<if test="tIncome.pushStatus != null and tIncome.pushStatus.trim() != ''">
AND a.PUSH_STATUS = #{tIncome.pushStatus}
</if>
<if test="tIncome.redData != null and tIncome.redData.trim() != ''">
AND a.RED_DATA = #{tIncome.redData}
</if>
</if>
</sql>
<!--tIncome简单分页查询-->
......@@ -136,4 +141,15 @@
<include refid="tIncome_where"/>
</where>
</select>
<!-- 列表 -->
<select id="getTIncomeList" resultMap="tIncomeMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_income a
<where>
1=1
<include refid="tIncome_where"/>
</where>
</select>
</mapper>
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