first commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package io.v.nutz.reimbursement.services;
|
||||
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.service.ViService;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/3 10:16
|
||||
* @description
|
||||
*/
|
||||
public interface ReimbursementService extends ViService<Reimbursement> {
|
||||
|
||||
NutMap findOne(String id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package io.v.nutz.reimbursement.services.impl;
|
||||
|
||||
import io.v.nutz.modules.services.AuditService;
|
||||
import io.v.nutz.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.reimbursement.services.ReimbursementService;
|
||||
import io.v.nutz.service.impl.ViServiceImpl;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/3 10:17
|
||||
* @description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ReimbursementServiceImpl extends ViServiceImpl<Reimbursement> implements ReimbursementService {
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
public ReimbursementServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap findOne(String id) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
be.loginname be_loginname,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
type.`name` typeName,
|
||||
type.`code` typeCode,
|
||||
sign.`data` jbrSignData
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_signature sign ON sign.id = rei.signId
|
||||
LEFT JOIN condolence_type type ON type.id=rei.type
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("rei.id", "=", id);
|
||||
sql.setCondition(cnd);
|
||||
NutMap record = listMap(sql).get(0);
|
||||
|
||||
if (Strings.isNotBlank(record.getString("accountingAuditId"))) {
|
||||
record.setv("accounting", auditService.fetch(record.getString("accountingAuditId")));
|
||||
}
|
||||
|
||||
|
||||
return record;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user