Commit a5e2f023 authored by hongguangwu's avatar hongguangwu

优化RED_DATA

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