This commit is contained in:
@jyuhsin
2025-08-30 15:45:15 +08:00
parent dab28bcf15
commit 57b0cc2244
26 changed files with 3366 additions and 1773 deletions
@@ -1,6 +1,7 @@
package io.v.nutz.sys.controllers.platform.sys.club.manage;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
@@ -12,10 +13,7 @@ import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.constant.club.ClubRegistAuditState;
import io.v.nutz.sys.models.Sys_club;
import io.v.nutz.sys.models.Sys_club_user;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.models.*;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
@@ -227,6 +225,24 @@ public class ClubInfoManageController {
XWPFTemplate.compile(officeTemplateUtil.getPath("clubUserApply"), Configure.builder().build()).render(map).writeAndClose(response.getOutputStream());
}
@At
@ViReturn
@RequiresPermissions("sys.club.clubInfoManage")
public Object onBelongUnion(String id, String belongUnionId) {
Sys_club club = dao.fetch(Sys_club.class, id);
if(club == null) {
return Result.error("协会信息为空");
}
if(StrUtil.isBlank(belongUnionId)) {
return Result.error("挂靠分工会信息为空");
}
Sys_union union = dao.fetch(Sys_union.class, belongUnionId);
club.setBelongUnionId(belongUnionId);
club.setBelongUnionName(union.getUnionname());
dao.update(club);
return null;
}
private String getRoleId(int sf) {
if(sf == 1) {
return Roles.club01;
@@ -183,4 +183,14 @@ public class Sys_club {
@Comment("归属分工会名称(如果是基层单位申请的协会)")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String unionName;
@Column
@Comment("挂靠分工会")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String belongUnionId;
@Column
@Comment("挂靠分工会名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String belongUnionName;
}
@@ -0,0 +1,63 @@
package io.v.nutz.zhgh.zc.controller;
import cn.hutool.core.date.DateUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.zc.model.ZcPdPlan;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
/**
* @ClassName ZcDjPlanController
* @Description TODO
* @Author zhf
* @Date 2024/2/27 14:13
*/
@IocBean
@Ok("json:full")
@At("/platform/zcgl/zcdj/plan")
public class ZcPdPlanController {
@Inject("ZcPdPlan")
private ViService<ZcPdPlan> viService;
@At("")
@Ok("beetl:/platform/zcgl/zcPdPlan.html")
@RequiresPermissions("zc.pdPlan")
public void index() {
}
@At
@ViReturn
public Object pageData(PageForm page, String year) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
cnd.asc("startDate");
return viService.list(page, cnd);
}
@At
@ViReturn
public Object doSubmit(ZcPdPlan zcPdPlan) {
zcPdPlan.setCreateDate(DateUtil.now());
viService.insertOrUpdate(zcPdPlan);
return null;
}
@At
@ViReturn
public Object doDelete(String id) {
viService.delete(id);
return null;
}
}
@@ -10,21 +10,25 @@ import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.zhgh.zc.model.Zgfw_Zcxx;
import io.v.nutz.zhgh.zc.model.zcDepreciationRecord;
import io.v.nutz.zhgh.zc.model.zgfwZclb;
import io.v.nutz.zhgh.zc.service.ZgfwZcxxService;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
@@ -36,11 +40,8 @@ import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.time.LocalDate;
import java.time.Period;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
@@ -141,23 +142,39 @@ public class ZgfwAddZcxxController {
@At("/doSubmit")
@Ok("json")
@ViReturn
@Aop(TransAop.READ_COMMITTED)
public Object doSubmit(Zgfw_Zcxx zcxx) {
try {
LocalDate rkLocalDate = zcxx.getDepreciationDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
Period period = Period.between(LocalDate.now(), rkLocalDate);
int year = Calendar.getInstance().get(Calendar.YEAR);
if (StrUtil.isBlank(zcxx.getZcbh())) {
Sql sql = Sqls.create("""
SELECT count(1) FROM `zgfw_zcxx` where LEFT(zcbh,4) = @year and LENGTH(zcbh) = 8
""").setParam("year", year);
int count = zgfwZcxxService.count(sql);
String bh = String.format("%04d", count + 1);
zcxx.setZcbh(year + bh);
}
zgfwZcxxService.insert(zcxx);
if (period.getYears() * 12 + period.getMonths() >= 0) {
// LocalDate rkLocalDate = zcxx.getDepreciationDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// Period period = Period.between(LocalDate.now(), rkLocalDate);
if (StrUtil.isBlank(zcxx.getZcbh())) {
zcxx.setZcbh(getZcbh(zcxx));
}
zgfwZcxxService.insert(zcxx);
/* if (period.getYears() * 12 + period.getMonths() >= 0) {
zcDepreciationRecord record = new zcDepreciationRecord();
record.setZcid(zcxx.getZcid());
record.setOperationTime(DateUtil.now());
record.setDepreciationDate(zcxx.getDepreciationDate());
record.setSurplus(Math.max(period.getYears() * 12 + period.getMonths(), 0));
zgfwZcxxService.insert(record);
}*/
return null;
}
@At
@Ok("json")
@ViReturn
public Object doEdit(Zgfw_Zcxx zcxx, HttpSession session) {
// LocalDate rkLocalDate = zcxx.getDepreciationDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// Period period = Period.between(LocalDate.now(), rkLocalDate);
// Zgfw_Zcxx fetch = zgfwZcxxService.fetch(Cnd.where("zcid", "=", zcxx.getZcid()));
/* if (period.getYears() * 12 + period.getMonths() >= 0) {
if (fetch.getDepreciationDate() == null || !fetch.getDepreciationDate().equals(zcxx.getDepreciationDate())) {
zgfwZcxxService.dao().clear(zcDepreciationRecord.class, Cnd.where("zcid", "=", zcxx.getZcid()));
zcDepreciationRecord record = new zcDepreciationRecord();
record.setZcid(zcxx.getZcid());
record.setOperationTime(DateUtil.now());
@@ -165,46 +182,14 @@ public class ZgfwAddZcxxController {
record.setSurplus(Math.max(period.getYears() * 12 + period.getMonths(), 0));
zgfwZcxxService.insert(record);
}
return Result.success().addMsg("添加成功");
} catch (Exception e) {
return Result.error();
}
*/
zgfwZcxxService.updateIgnoreNull(zcxx);
session.removeAttribute("id");
return Result.success().addMsg("修改成功");
}
@At
@Ok("json")
public Object doEdit(Zgfw_Zcxx zcxx, HttpSession session) {
try {
LocalDate rkLocalDate = zcxx.getDepreciationDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
Period period = Period.between(LocalDate.now(), rkLocalDate);
Zgfw_Zcxx fetch = zgfwZcxxService.fetch(Cnd.where("zcid", "=", zcxx.getZcid()));
if (period.getYears() * 12 + period.getMonths() >= 0) {
if (fetch.getDepreciationDate() == null || !fetch.getDepreciationDate().equals(zcxx.getDepreciationDate())) {
zgfwZcxxService.dao().clear(zcDepreciationRecord.class, Cnd.where("zcid", "=", zcxx.getZcid()));
zcDepreciationRecord record = new zcDepreciationRecord();
record.setZcid(zcxx.getZcid());
record.setOperationTime(DateUtil.now());
record.setDepreciationDate(zcxx.getDepreciationDate());
record.setSurplus(Math.max(period.getYears() * 12 + period.getMonths(), 0));
zgfwZcxxService.insert(record);
}
}
zgfwZcxxService.updateIgnoreNull(zcxx);
session.removeAttribute("id");
return Result.success().addMsg("修改成功");
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
/**
* 下载模板
*
* @param response
*/
@At("/downLoadTemp")
@Ok("void")
public void downLoadTemp(HttpServletResponse response) {
@@ -212,30 +197,102 @@ public class ZgfwAddZcxxController {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
List<Zgfw_Zcxx> list = new ArrayList<>();
list.add(Zgfw_Zcxx.getDefault());
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, Zgfw_Zcxx.class, list);
ViTool.excelResponse(response, "固定资产模板.xlsx");
workbook.write(response.getOutputStream());
} catch (IOException e) {
e.printStackTrace();
}
}
@At
@Ok("json")
@ViReturn
public Object doExcelSubmit(@Param(value = "data", required = false) Zgfw_Zcxx[] zxccList) {
@Aop(TransAop.READ_COMMITTED)
public Object doExcelSubmit(String data) {
int i = 1;
List<String> insertid = new ArrayList<>();
try {
List<Zgfw_Zcxx> zgfw_zcxxes = Json.fromJsonAsList(Zgfw_Zcxx.class, data);
for (Zgfw_Zcxx zgfw_zcxx : zgfw_zcxxes) {
zgfw_zcxx.setZcghlx(zgfw_zcxx.getZcghlx().equalsIgnoreCase("校工会") ? "2" : "1");
String zcid = zgfwZcxxService.insert(zgfw_zcxx).getZcid();
insertid.add(zcid);
i++;
}
return Result.success();
} catch (Exception e) {
e.printStackTrace();
for (String id : insertid) {
zgfwZcxxService.clear(Cnd.where("zcid", "=", id));
}
return Result.error().addMsg("导入失败,请检查第" + i + "行的数据!");
}
}
zgfwZcxxService.doAddByExcelImport(zxccList);
/**
* @param zcxx
* @return java.lang.String
* @author zhf
* @description GH为工会的首字母大写方式
* 00为校工会
* 01为航空学院工会(其他院级工会编号见附表)
* Z为专用设备首字母大写方式
* T为通用设备首字母大写方式
* J为家具设备首字母大写方式
* 202203为设备编号年月
* 001为设备的数字编号
*/
public String getZcbh(Zgfw_Zcxx zcxx) {
String one = "GH";
String two = "";
String three = "";
String four = "";
String five = "";
String zcghlx = zcxx.getZcghlx();
if (zcghlx.equals("1")) {
if (Lang.isNotEmpty(zcxx.getZclydwh())) {
Sys_union union = zgfwZcxxService.dao().fetch(Sys_union.class, Cnd.where("unionname", "=", zcxx.getZclydwh()));
two = union.getUnioncode();
}
} else {
two = "00";
}
zgfwZclb zclb = zgfwZcxxService.dao().fetch(zgfwZclb.class, Cnd.where("contentCode", "=", zcxx.getContentCode()));
if (Lang.isNotEmpty(zclb)) {
if (zclb.getCategory().equals("专用设备")) {
three = "Z";
} else if (zclb.getCategory().equals("通用设备")) {
three = "T";
} else if (zclb.getCategory().equals("家具设备")) {
three = "J";
}
}
four = DateUtil.format(new Date(), "yyyyMM");
Sql sql = Sqls.create("""
SELECT
COUNT(1)
FROM
`zgfw_zcxx`
WHERE
YEAR(zcgzrq) = @zcgzrq_ny
AND zcbh LIKE @zcbhCode
""").setParam("zcgzrq_ny", DateUtil.thisYear()).setParam("zcbhCode", "%" + three + "%");
int count = zgfwZcxxService.count(sql);
five = String.format("%03d", count + 1);
if (StrUtil.isNotBlank(two) && StrUtil.isNotBlank(three) && StrUtil.isNotBlank(four) && StrUtil.isNotBlank(five)) {
return one + two + "-" + three + "-" + four + "-" + five;
}
return null;
}
@At("/readExcelTable")
@Ok("json:full")
@ViReturn
public Object readExcelTable(@Param(value = "zxccList", required = false) Zgfw_Zcxx[] zxccList) {
return zgfwZcxxService.matchUserId(zxccList);
}
}
@@ -1,33 +1,56 @@
package io.v.nutz.zhgh.zc.controller;
import cn.afterturn.easypoi.entity.ImageEntity;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zc.model.ZcPdPlan;
import io.v.nutz.zhgh.zc.model.Zgfw_Zcxx;
import io.v.nutz.zhgh.zc.model.Zgfw_Zcxx_bdxx;
import io.v.nutz.zhgh.zc.service.ZgfwZcxxBdService;
import io.v.nutz.zhgh.zc.service.ZgfwZcxxService;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 资产变更
@@ -43,6 +66,8 @@ public class ZgfwGdzcbgController {
@Inject
private SysUserService sysUserService;
@Inject
private FtpService ftpService;
@At("")
@Ok("beetl:/platform/zcgl/gdzcbg.html")
@@ -53,39 +78,53 @@ public class ZgfwGdzcbgController {
@At("/data")
@Ok("json")
@ViReturn
@RequiresPermissions("zc.bg")
public Object data(@Param("pageNumber") Integer pageNumber, @Param("pageSize") Integer pageSize, @Param("searchName") String searchName, @Param("searchKeyword") String searchKeyword,
@Param(value = "zcghlx", required = false) String zcghlx,
@Param(value = "zcgzrq", required = false) String zcgzrq,
@Param(value = "zclydwh", required = false) String zclydwh,
@Param(value = "zcrksj", required = false) String zcrksj, String pageOrderName, String pageOrderBy) {
public Object data(PageForm page,
Integer isPd,
String zcpdid,
String zcghlx,
String unionid,
String zcgzrq, String zclydwh, String zcrksj) {
try {
Sql sql = Sqls.create("""
SELECT
zc.*,
lyrur.username lyr,
jsrur.username jsr,
ut.unionname
ut.unionname,
bd.zcbdid,
COUNT(bd.zcid) AS isPd
FROM
zgfw_zcxx zc
LEFT JOIN zgfw_zcxx_bdxx bd ON bd.pdPlanId=@zcpdid and bd.zcid = zc.zcid
LEFT JOIN sys_user lyrur ON zc.zclyrid = lyrur.id
LEFT JOIN sys_user jsrur ON zc.zcjsrid = jsrur.id
LEFT JOIN sys_union ut ON ut.`id` = zc.zclydwh $condition
""");
""").setParam("zcpdid", zcpdid);
CndPlus cndPlus = CndPlus.create();
cndPlus.andEx(searchName, "like", "%" + searchKeyword + "%");
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cndPlus.andEx("zc.zcghlx", "=", "1");
cndPlus.andEx("zc.zclydwhid", "=", Vi.getUnionId());
} else {
// cndPlus.andExcludeEmpty("zc.zcghlx", "=", "2");
}
cndPlus.andEx("zc.zclydwhid", "=", unionid);
cndPlus.andEx(page.getSearchName(), "like", "%" + page.getSearchKeyword() + "%");
cndPlus.andEx("zc.zcghlx", "=", zcghlx);
cndPlus.andEx("zc.zcgzrq", "=", zcgzrq);
cndPlus.andEx("zc.zclydwh", "=", zclydwh);
cndPlus.andEx("zc.zcrksj", "=", zcrksj);
if (StrUtil.isNotBlank(pageOrderName) && StrUtil.isNotBlank(pageOrderBy)) {
cndPlus.orderBy(pageOrderName, pageOrderBy.equals("desc") ? "desc" : "asc");
} else {
cndPlus.desc("zc.zcghlx");
if (isPd != 0) {
cndPlus.and("( SELECT COUNT(*) FROM zgfw_zcxx_bdxx WHERE pdPlanId = '%s' AND zcid = zc.zcid )".formatted(zcpdid), isPd == 1 ? ">=" : "<", 1);
}
if (StrUtil.isNotBlank(page.getPageOrderName()) && StrUtil.isNotBlank(page.getPageOrderBy())) {
cndPlus.orderBy(page.getPageOrderName(), page.getPageOrderBy().equals("desc") ? "desc" : "asc");
} else {
cndPlus.desc("zc.zcghlx").asc("zc.contentCode").asc("zc.zcgzrq");
}
cndPlus.groupBy("zc.zcid");
sql.setCondition(cndPlus);
Pagination pagination = zgfwZcxxService.listPage(pageNumber, pageSize, sql);
Pagination pagination = zgfwZcxxService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success().addData(pagination);
} catch (Exception e) {
return Result.error();
@@ -98,59 +137,39 @@ public class ZgfwGdzcbgController {
@Ok("json")
public Object doChange(@Param("..") Zgfw_Zcxx_bdxx zcxxBdxx, String zczt) {
try {
Zgfw_Zcxx zcxx = zgfwZcxxService.fetch(zcxxBdxx.getZcid());
Sys_user user = null;
if (zczt.equals("报废") || zczt.equals("待报废")) {
zcxxBdxx.setZcnowlyrid(Strings.isBlank(zcxxBdxx.getZcnowlyrid()) ? zcxxBdxx.getZcoldlyrid() : zcxxBdxx.getZcnowlyrid());
zcxxBdxx.setZcnowlydwh(Strings.isBlank(zcxxBdxx.getZcnowlydwh()) ? zcxxBdxx.getZcoldlydwh() : zcxxBdxx.getZcnowlydwh());
zcxxBdxx.setZcnowcfdmc(Strings.isBlank(zcxxBdxx.getZcnowcfdmc()) ? zcxxBdxx.getZcoldcfdmc() : zcxxBdxx.getZcnowcfdmc());
} else {
user = zgfwZcxxBdService.dao().fetch(Sys_user.class, zcxxBdxx.getZcnowlyrid());
zcxxBdxx.setZcnowlyrid(Strings.isBlank(zcxxBdxx.getZcnowlyrid()) ? zcxxBdxx.getZcoldlyrid() : zcxxBdxx.getZcnowlyrid());
zcxxBdxx.setZcnowlydwh(Strings.isBlank(zcxxBdxx.getZcnowlydwh()) ? zcxxBdxx.getZcoldlydwh() : zcxxBdxx.getZcnowlydwh());
zcxxBdxx.setZcnowcfdmc(Strings.isBlank(zcxxBdxx.getZcnowcfdmc()) ? zcxxBdxx.getZcoldcfdmc() : zcxxBdxx.getZcnowcfdmc());
}
zcxxBdxx.setZcoldlyrid(zcxx.getZclyrid());
zcxxBdxx.setZcbdsj(DateUtil.now());
zcxxBdxx.setZcnowlyrid(Strings.isBlank(zcxxBdxx.getZcnowlyrid()) ? zcxxBdxx.getZcoldlyrid() : zcxxBdxx.getZcnowlyrid());
zcxxBdxx.setZcnowlydwh(Strings.isBlank(zcxxBdxx.getZcnowlydwh()) ? zcxxBdxx.getZcoldlydwh() : zcxxBdxx.getZcnowlydwh());
zcxxBdxx.setZcnowcfdmc(Strings.isBlank(zcxxBdxx.getZcnowcfdmc()) ? zcxxBdxx.getZcoldcfdmc() : zcxxBdxx.getZcnowcfdmc());
zcxxBdxx.setZcbdsj(sdf.format(new Date()));
zcxxBdxx.setZcbdshrid(ShiroUtil.getPrincipalProperty("id").toString());
zgfwZcxxBdService.insert(zcxxBdxx);
zcxx.setZclyrid(zcxxBdxx.getZcnowlyrid());
Zgfw_Zcxx zcxx = zgfwZcxxService.fetch(zcxxBdxx.getZcid());
//zcxx.setZclyrid(zcxxBdxx.getZcnowlyrid());
zcxx.setZclydwh(zcxxBdxx.getZcnowlydwh());
zcxx.setZccfdmc(zcxxBdxx.getZcnowcfdmc());
zcxx.setZclyrname(user == null ? null : user.getUsername());
zcxx.setZclyrgh(user == null ? null : user.getLoginname());
zcxx.setZczt(zczt);
zcxx.setZcjsrid(ShiroUtil.getPrincipalProperty("id").toString());
zcxx.setZcjsrname(ShiroUtil.getPrincipalProperty("username").toString());
zcxx.setZcjsrgh(Vi.getUnion().getUnionname());
zgfwZcxxService.update(zcxx);
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
@Ok("json")
@RequiresPermissions("zc.bg")
public Object queryChangeData(String zcid) {
try {
Sql sql = Sqls.create("""
SELECT
bd.`zcoldcfdmc` oldcfd,
bd.`zcnowcfdmc` nowcfd,
shr.`username` shrname,
bd.`zcbdsj`,
bd.zcnowlydwh,
bd.zcoldlydwh,
oldlyr.username oldlyrusername,
nowlyr.username nowlyrusername
bd.*
FROM
zgfw_zcxx_bdxx bd
LEFT JOIN `sys_user` oldlyr ON bd.zcoldlyrid = oldlyr.`id`
LEFT JOIN `sys_user` nowlyr ON bd.`zcnowlyrid` = nowlyr.`id`
LEFT JOIN sys_user oldlyr ON bd.zcoldlyrid = oldlyr.`id`
LEFT JOIN sys_union oldlydw ON bd.`zcoldlydwh` = oldlydw.`id`
LEFT JOIN sys_user nowlyr ON bd.`zcnowlyrid` = nowlyr.`id`
LEFT JOIN sys_union nowlydw ON bd.`zcnowlydwh` = nowlydw.`id`
LEFT JOIN sys_user shr ON bd.`zcbdshrid` = shr.`id`
WHERE
bd.`zcid` = @zcid
@@ -191,7 +210,6 @@ public class ZgfwGdzcbgController {
@At
@Ok("json")
@RequiresPermissions("zc.bg")
public Object openEditData(String zcid) {
try {
Sql sql = Sqls.create("SELECT xx.*,u.`username`,un.`unionname` FROM zgfw_zcxx xx \n" +
@@ -204,4 +222,138 @@ public class ZgfwGdzcbgController {
}
}
@At
@Ok("json")
@Aop(TransAop.READ_COMMITTED)
@ViReturn
public Object doSubmit(Zgfw_Zcxx_bdxx zcxxBdxx, String zclyrname, String zclyrgh, String zclyrid, String zclydwh, String zclydwhid) {
Zgfw_Zcxx zcxx = zgfwZcxxService.fetch(zcxxBdxx.getZcid());
zcxxBdxx.setZcoldlyrid(zcxx.getZclyrid());
zcxxBdxx.setZcnowlyrid(zclydwhid);
zgfwZcxxBdService.insert(zcxxBdxx);
zcxx.setZczt(zcxxBdxx.getZczt());
if (zcxx.getZcghlx().equals("2")) {
zcxx.setZclyrname(zclyrname);
zcxx.setZclyrgh(zclyrgh);
zcxx.setZclyrid(zclyrid);
zcxx.setZclydwh(zclydwh);
zcxx.setZclydwhid(zclydwhid);
} else {
zcxx.setZclyrname(ShiroUtil.getPlatformUsername());
zcxx.setZclyrgh(ShiroUtil.getPlatformLoginname());
zcxx.setZclyrid(ShiroUtil.getUserId());
zcxx.setZclydwh(((Sys_union) ShiroUtil.getPrincipalProperty("union")).getUnionname());
zcxx.setZclydwhid(((Sys_union) ShiroUtil.getPrincipalProperty("union")).getId());
}
zgfwZcxxService.update(zcxx);
return null;
}
@At
@Ok("json")
@Aop(TransAop.READ_COMMITTED)
@ViReturn
public Object doPdDelete(String zcbdid) {
zgfwZcxxBdService.delete(zcbdid);
return null;
}
@At
@Ok("json")
@ViReturn
public Object getPdPlan(String year) {
return zgfwZcxxService.dao().query(ZcPdPlan.class, Cnd.NEW().andEX("year", "=", year).desc("startDate"));
}
@At
@Ok("void")
@RequiresAuthentication
public void doHzExcel(String zcpdid, String zcghlx, HttpServletResponse response) {
try {
Map<String, Object> map = new HashMap<String, Object>();
String unitname = "校工会";
Sql sql = Sqls.create("""
SELECT
zc.zcbh,
zc.zcmc,
bd.zcrksj,
u.username,
bd.mobile,
zc.zccfdmc,
bd.pdzt,
bd.wpdzt,
bd.zczt,
it.name unitname,
bd.zcFile
FROM
zgfw_zcxx zc
LEFT JOIN zgfw_zcxx_bdxx bd ON bd.zcid=zc.zcid AND bd.pdPlanId=@zcpdid
left join sys_unit it on it.id=zc.zclydwhid
LEFT JOIN `user` u ON u.id=bd.zcbdshrid
$condition
""").setParam("zcpdid", zcpdid);
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
/*if (ShiroUtil.hasRole("H04")) {
cnd.andEX("zc.zcghlx", "=", "1");
cnd.andEX("zc.zclydwhid", "=", Vi.getUnionId());
unitname = Vi.getUnit().getName();
} else {
cnd.andEX("zc.zcghlx", "=", "2");
}*/
cnd.andEX("zc.zcghlx", "=", "1");
cnd.andEX("zc.zclydwhid", "=", Vi.getUnionId());
unitname = Vi.getUnit().getName();
}
cnd.andEX("zc.zcghlx", "=", zcghlx);
cnd.groupBy("zc.zcbh");
cnd.asc("zc.zcbh");
sql.setCondition(cnd);
List<NutMap> maps = sysUserService.listMap(sql);
for (int i = 0; i < maps.size(); i++) {
maps.get(i).put("index", i + 1);
String zcFile1 = maps.get(i).getString("zcFile");
if (StrUtil.isNotBlank(zcFile1)) {
List<NutMap> zcFile = Json.fromJsonAsList(NutMap.class, zcFile1);
ByteArrayOutputStream signOs = new ByteArrayOutputStream();
ftpService.download(zcFile.get(0).getString("filepath"), signOs);
ByteArrayInputStream bais = new ByteArrayInputStream(signOs.toByteArray());
BufferedImage bufferImg = ImageIO.read(bais);
ImageIO.write(bufferImg, "jpg", signOs);
ImageEntity imageEntity = new ImageEntity(signOs.toByteArray(), 200, 1000);
maps.get(i).put("img", imageEntity);
} else {
maps.get(i).put("img", null);
}
}
map.put("maplist", maps);
map.put("applyDate", DateUtil.format(new Date(), "yyyy年MM月dd日"));
if (Lang.isNotEmpty(maps)) {
map.put("unitname", unitname);
}
String templateUrl = "templates/zc/pdHz.xlsx";
response.setContentType("application/octet-stream");
ViTool.excelResponse(response, "杭州医学院固定资产盘点汇总表.xlsx");
TemplateExportParams params = new TemplateExportParams(
templateUrl);
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
workbook.write(response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -6,7 +6,6 @@ import io.v.nutz.zhgh.zc.service.ZgfwZcxxBdService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
@@ -33,34 +32,33 @@ public class ZgfwZcSjkbController {
@At
@Ok("json")
@RequiresPermissions("zc.sjkb")
public Object data(){
Sql sql = Sqls.create("""
SELECT
count( CASE WHEN zczt = '在用' THEN '在用' END ) AS zy,
count( CASE WHEN zczt = '闲置' THEN '闲置' END ) AS xz,
count( CASE WHEN zczt = '未使用' THEN '未使用' END ) AS wsy,
count( CASE WHEN zczt = '待报废' THEN '待报废' END ) AS dbf,
count( CASE WHEN zczt = '校外转入' THEN '校外转入' END ) AS xwzr,
count( CASE WHEN zczt = '校内转入' THEN '校内转入' END ) AS xnzr,
count( CASE WHEN zczt = '其它' THEN '其它' END ) AS qt
FROM
zgfw_zcxx
""");
List<Record> zttj = zgfwZcxxBdService.list(sql);
/* StringBuffer sb=new StringBuffer();
sb.append("SELECT un.unionname,COUNT(CASE WHEN zcid IS NOT NULL THEN 0 END) sl FROM hy_unioninfomgr un LEFT JOIN zgfw_zcxx zc ON zc.zclydwh=un.`id` GROUP BY id");
List<Record> fghtj = zgfwZcxxBdService.list(Sqls.create(sb.toString()));*/
Sql sql1 = Sqls.create("""
SELECT
COUNT( CASE WHEN zcdj < 2000 THEN '1' END ) a,
COUNT( CASE WHEN zcdj >= 2000 AND zcdj < 4000 THEN '2' END ) b,
COUNT( CASE WHEN zcdj >= 4000 AND zcdj < 6000 THEN '3' END ) c,
COUNT( CASE WHEN zcdj >= 6000 AND zcdj < 8000 THEN '4' END ) d,
COUNT( CASE WHEN zcdj >= 8000 AND zcdj < 10000 THEN '5' END ) e,
COUNT( CASE WHEN zcdj >= 10000 THEN '3' END ) f
FROM
zgfw_zcxx
""");
List<Record> jgtj = zgfwZcxxBdService.list(sql1);
StringBuffer sf=new StringBuffer();
//sf.append("SELECT COUNT(CASE WHEN zczt='1' THEN '1' END) zy,COUNT(CASE WHEN zczt='2' THEN '2' END) ty,COUNT(CASE WHEN zczt='3' THEN '3' END) bf FROM zgfw_zcxx ");
sf.append("SELECT\n" +
"\tcount( CASE WHEN zczt = '在用' THEN '在用' END ) AS zy,\n" +
"\tcount( CASE WHEN zczt = '闲置' THEN '闲置' END ) AS xz,\n" +
"\tcount( CASE WHEN zczt = '损坏' THEN '损坏' END ) AS sh,\n" +
"\tcount( CASE WHEN zczt = '外携' THEN '外携' END ) AS wx\n" +
"FROM\n" +
"\tzgfw_zcxx");
List<Record> zttj = zgfwZcxxBdService.list(Sqls.create(sf.toString()));
StringBuffer sr=new StringBuffer();
sr.append("SELECT\n" +
"\tCOUNT( CASE WHEN zcdj < 2000 THEN '1' END ) a,\n" +
"\tCOUNT( CASE WHEN zcdj >= 2000 AND zcdj < 4000 THEN '2' END ) b,\n" +
"\tCOUNT( CASE WHEN zcdj >= 4000 AND zcdj < 6000 THEN '3' END ) c,\n" +
"\tCOUNT( CASE WHEN zcdj >= 6000 AND zcdj < 8000 THEN '4' END ) d,\n" +
"\tCOUNT( CASE WHEN zcdj >= 8000 AND zcdj < 10000 THEN '5' END ) e,\n" +
"\tCOUNT( CASE WHEN zcdj >= 10000 THEN '3' END ) f \n" +
"FROM\n" +
"\tzgfw_zcxx");
List<Record> jgtj = zgfwZcxxBdService.list(Sqls.create(sr.toString()));
List<Record> list = zgfwZcxxBdService.list(Sqls.create("SELECT SUBSTR(MIN(zcgzrq),1,4) ksnf,SUBSTR(MAX(zcgzrq),1,4) jsnf FROM zgfw_zcxx"));
Record record = list.get(0);
@@ -7,10 +7,11 @@ import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.OfficeTemplateUtil;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zc.model.Zgfw_Zcxx;
import io.v.nutz.zhgh.zc.model.zcDepreciationRecord;
import io.v.nutz.zhgh.zc.service.ZgfwZcxxBdService;
@@ -25,7 +26,6 @@ import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans;
import javax.servlet.http.HttpServletResponse;
@@ -57,52 +57,42 @@ public class ZgfwZcTzglController {
@Inject
private ZgfwZcxxBdService zgfwZcxxBdService;
@Inject
private OfficeTemplateUtil officeTemplateUtil;
@At
@ViReturn
@RequiresPermissions("zc.tzgl")
public Object data(PageForm pageForm, @Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param(value = "zcghlx", required = false) String zcghlx,
@Param(value = "zcgzrq", required = false) String zcgzrq,
@Param(value = "zclydwh", required = false) String zclydwh,
@Param(value = "zcrksj", required = false) String zcrksj,
@Param(value = "pageOrderName", required = false) String pageOrderName,
@Param(value = "pageOrderBy", required = false) String pageOrderBy,
@Param(value = "contentCode", required = false) String contentCode) {
public Object data(PageForm pageForm, String searchName, String searchKeyword, String zcghlx,
String zcgzrq, String zclydwh, String zcrksj, String unionid, String pageOrderName, String pageOrderBy, String contentCode) {
Sql sql = Sqls.create("""
SELECT
xx.*,
lb.content
xx.*
FROM
`zgfw_zcxx` xx
LEFT JOIN zgfw_zclb lb ON xx.contentCode = lb.contentCode
$condition
""");
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(searchName)&&StrUtil.isNotBlank(searchKeyword)){
cnd.andEX(searchName, "like", "%" + searchKeyword + "%");
CndPlus cndPlus = CndPlus.create();
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cndPlus.andEx("xx.zcghlx", "=", "1");
cndPlus.andEx("xx.zclydwhid", "=", Vi.getUnionId());
}
cnd.andEX("xx.contentCode", "=", contentCode);
cnd.andEX("xx.zcghlx", "=", zcghlx);
cnd.andEX("xx.zcgzrq", "=", zcgzrq);
cnd.andEX("xx.zclydwh", "=", zclydwh);
cnd.andEX("xx.zcrksj", "=", zcrksj);
cndPlus.andEx(searchName, "like", "%" + searchKeyword + "%");
cndPlus.andEx("xx.contentCode", "=", contentCode);
cndPlus.andEx("xx.zcghlx", "=", zcghlx);
cndPlus.andEx("xx.zcgzrq", "=", zcgzrq);
cndPlus.andEx("xx.zclydwh", "=", zclydwh);
cndPlus.andEx("xx.zcrksj", "=", zcrksj);
cndPlus.andEx("xx.zclydwhid", "=", unionid);
if (StrUtil.isNotBlank(pageOrderName) && StrUtil.isNotBlank(pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy.equals("desc") ? "desc" : "asc");
cndPlus.orderBy(pageOrderName, pageOrderBy.equals("desc") ? "desc" : "asc");
} else {
cnd.desc("xx.zcghlx");
cndPlus.desc("xx.zcghlx");
}
sql.setCondition(cnd);
sql.setCondition(cndPlus);
Pagination pagination = zgfwZcxxService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success().addData(pagination);
}
@At
@Ok("json")
@ViReturn
@RequiresPermissions("zc.tzgl")
public Object doDel(String id) {
Trans.exec(() -> {
zgfwZcxxService.delete(id);
@@ -112,8 +102,8 @@ public class ZgfwZcTzglController {
}
@At
@Ok("json")
@ViReturn
@RequiresPermissions("zc.tzgl")
public Object bgzt(String zcid, String zczt) {
Zgfw_Zcxx fetch = zgfwZcxxService.fetch(zcid);
fetch.setZczt(zczt);
@@ -123,7 +113,6 @@ public class ZgfwZcTzglController {
@At
@Ok("void")
@RequiresPermissions("zc.tzgl")
public void downloadrzd(String id, HttpServletResponse response) {
try {
List<Record> query = zgfwZcxxService.list(Sqls.create("select * from zgfw_zcxx where zcid='" + id + "'"));
@@ -137,13 +126,12 @@ public class ZgfwZcTzglController {
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".xls");
TemplateExportParams params = new TemplateExportParams(
officeTemplateUtil.getPath("rzd"));
Thread.currentThread().getContextClassLoader().getResource("docTemplate/zc/rzd.xls").getPath());
Workbook workbook = ExcelExportUtil.exportExcel(params, record);
workbook.write(response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
}
@@ -152,7 +140,6 @@ public class ZgfwZcTzglController {
@At
@ViReturn
@RequiresPermissions("zc.tzgl")
public Object doZj() {
Trans.exec(() -> {
@@ -7,11 +7,10 @@ import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.zhgh.zc.service.ZgfwZcxxBdService;
import io.v.nutz.zhgh.zc.service.ZgfwZcxxService;
import org.apache.poi.ss.usermodel.Workbook;
@@ -26,7 +25,6 @@ import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
@@ -60,20 +58,8 @@ public class ZgfwZcZhcxController {
@At
@Ok("json")
@ViReturn
@RequiresPermissions("zc.zhcx")
public Object data(@Param(value = "pageNumber", required = false) Integer pageNumber,
@Param(value = "pageSize", required = false) Integer pageSize,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param(value = "zczt", required = false) String zczt,
@Param(value = "startTime", required = false) String startTime,
@Param(value = "endTime", required = false) String endTime,
@Param(value = "zcghlx", required = false) String zcghlx,
@Param(value = "zcrksj", required = false) String zcrksj,
@Param(value = "ghid", required = false) String ghid,
@Param(value = "pageOrderName", required = false) String pageOrderName,
@Param(value = "pageOrderBy", required = false) String pageOrderBy) {
public Object data(Integer pageNumber, Integer pageSize, String searchName, String searchKeyword, String zczt, String startTime, String endTime, String zcghlx,
String zcrksj, String ghid, String pageOrderName, String pageOrderBy) {
Sql sql = Sqls.create("""
SELECT
xx.*
@@ -99,7 +85,7 @@ public class ZgfwZcZhcxController {
cndPlus.and(Cnd.cri().where().andBetween("zcgzrq", startTime, endTime));
}
sql.setCondition(cndPlus);
Pagination pagination = zgfwZcxxService.listPage(pageNumber, pageSize, sql);
Pagination pagination = zgfwZcxxService.listPageMap(pageNumber, pageSize, sql);
return Result.success().addData(pagination);
}
@@ -112,7 +98,6 @@ public class ZgfwZcZhcxController {
@At
@Ok("void")
@RequiresPermissions("zc.zhcx")
public void doExport(String searchKeyword, String searchName, String zczt, String zcghlx, String ghid, String startTime, String endTime, HttpServletResponse response) {
Sql sql = Sqls.create("""
SELECT
@@ -135,33 +120,27 @@ public class ZgfwZcZhcxController {
}
sql.setCondition(cnd);
List<Record> list = zgfwZcxxService.list(sql);
list.forEach(v -> {
v.set("zcghlx", v.getString("zcghlx").equals("1") ? "院级工会" : "校工会");
});
List<ExcelExportEntity> entityList = new ArrayList<>();
entityList.add(new ExcelExportEntity("领用单位号", "zclydwh", 20));
entityList.add(new ExcelExportEntity("仪器编号", "zcbh", 20));
entityList.add(new ExcelExportEntity("仪器名称", "zcmc", 20));
entityList.add(new ExcelExportEntity("型号", "zcxh", 20));
entityList.add(new ExcelExportEntity("规格", "zcgg", 20));
entityList.add(new ExcelExportEntity("单价", "zcdj", 20));
entityList.add(new ExcelExportEntity("厂家", "zccj", 20));
entityList.add(new ExcelExportEntity("出厂号", "zccch", 20));
entityList.add(new ExcelExportEntity("资产名称", "zcmc", 20));
entityList.add(new ExcelExportEntity("类别名称", "content", 20));
entityList.add(new ExcelExportEntity("型号规格", "zcxh", 20));
entityList.add(new ExcelExportEntity("购置日期", "zcgzrq", 20));
entityList.add(new ExcelExportEntity("现状", "zczt", 20));
entityList.add(new ExcelExportEntity("存放地名称", "zccfdmc", 20));
entityList.add(new ExcelExportEntity("数量", "sl", 20));
entityList.add(new ExcelExportEntity("单价", "zcdj", 20));
entityList.add(new ExcelExportEntity("备注(存放地点)", "zccfdmc", 20));
entityList.add(new ExcelExportEntity("单位", "zclydwh", 20));
entityList.add(new ExcelExportEntity("领用人", "zclyrname", 20));
entityList.add(new ExcelExportEntity("经手人", "zcjsrname", 20));
entityList.add(new ExcelExportEntity("入库时间", "zcrksj", 20));
entityList.add(new ExcelExportEntity("单据号", "zcdjh", 20));
entityList.add(new ExcelExportEntity("合同号", "zchth", 20));
entityList.add(new ExcelExportEntity("经费卡号", "zcjfkh", 20));
entityList.add(new ExcelExportEntity("经费卡金额", "zcjfkje", 20));
entityList.add(new ExcelExportEntity("国标分类号", "zcgbflh", 20));
entityList.add(new ExcelExportEntity("国别", "zcgb", 20));
entityList.add(new ExcelExportEntity("发票号", "zcfph", 20));
entityList.add(new ExcelExportEntity("供货商", "zcghs", 20));
entityList.add(new ExcelExportEntity("领用人工号", "zclyrgh", 20));
entityList.add(new ExcelExportEntity("资产编号", "zcbh", 20));
entityList.add(new ExcelExportEntity("资产归属", "zcghlx", 20));
try {
ViTool.excelResponse(response, "资产总账表.xls");
ViTool.excelResponse(response, "固定资产台账.xls");
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entityList, list);
workbook.write(response.getOutputStream());
} catch (Exception e) {
@@ -0,0 +1,32 @@
package io.v.nutz.zhgh.zc.controller.mobile;
import io.v.nutz.base.service.ViService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
/**
* @ClassName ZcPdMobileController
* @Description TODO
* @Author zhf
* @Date 2024/3/3 15:44
*/
@IocBean
@Ok("json:full")
@At("/mobile/zc/zcPd")
public class ZcPdMobileController {
@Inject
private ViService viService;
@At("")
@Ok("beetl:/mobile/zc/zcPd.html")
@RequiresPermissions("zc.bg")
public void index() {
}
}
@@ -6,8 +6,8 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.zhgh.zc.model.Zgfw_Zcxx;
import io.v.nutz.zhgh.zc.model.zgfwZclb;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -18,7 +18,6 @@ import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.time.LocalDate;
import java.time.Period;
@@ -47,10 +46,7 @@ public class zgfwZclbController {
@At
@ViReturn
@RequiresPermissions("zcgl.zclb")
public Object doEdit(zgfwZclb zgfw_zclb,
@Param(value = "oldContentCode", required = false) String oldContentCode,
@Param(value = "oldDepreciationYear", required = false) String oldDepreciationYear) {
public Object doEdit(zgfwZclb zgfw_zclb, String oldContentCode, String oldDepreciationYear) {
if (!oldContentCode.equals(zgfw_zclb.getContentCode())) {
zgfwZclb zgfwZclb = baseService.dao().fetch(zgfwZclb.class, Cnd.where("contentCode", "=", zgfw_zclb.getContentCode()));
if (zgfwZclb != null) {
@@ -80,7 +76,6 @@ public class zgfwZclbController {
@At
@ViReturn
@RequiresPermissions("zcgl.zclb")
public Object doAdd(zgfwZclb zgfw_zclb) {
zgfwZclb zgfwZclb = baseService.dao().fetch(zgfwZclb.class, Cnd.where("contentCode", "=", zgfw_zclb.getContentCode()));
if (zgfwZclb != null) {
@@ -92,9 +87,7 @@ public class zgfwZclbController {
@At
@ViReturn
@RequiresPermissions("zcgl.zclb")
public Object pageData(PageForm page,
@Param(value = "category", required = false) String category) {
public Object pageData(PageForm page, String category) {
Sql sql = Sqls.create("SELECT * FROM `zgfw_zclb` $condition");
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(page.getSearchName()) && StrUtil.isNotBlank(page.getSearchKeyword())) {
@@ -109,7 +102,6 @@ public class zgfwZclbController {
@At
@ViReturn
@RequiresPermissions("zcgl.zclb")
public Object doDelete(String id) {
baseService.dao().clear(zgfwZclb.class, Cnd.where("id", "=", id));
return null;
@@ -117,9 +109,8 @@ public class zgfwZclbController {
@At
@ViReturn
@RequiresPermissions("zcgl.zclb")
public Object queryLb() {
return baseService.dao().query(zgfwZclb.class, Cnd.NEW().asc("contentCode"));
return baseService.dao().query(zgfwZclb.class, Cnd.NEW().asc("category"));
}
@@ -0,0 +1,48 @@
package io.v.nutz.zhgh.zc.model;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
/**
* @ClassName ZcDJPlan
* @Description TODO
* @Author zhf
* @Date 2024/2/27 14:16
*/
@Data
@Table
public class ZcPdPlan {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("年度")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String year;
@Column
@Comment("开始时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String startDate;
@Column
@Comment("时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String endDate;
@Column
@Comment("说明")
@ColDefine(type = ColType.VARCHAR, width = 300)
private String note;
@Column
@Comment("创建时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String createDate;
}
@@ -5,11 +5,9 @@ import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@Comment("资产信息")
@Table("Zgfw_Zcxx")
public class Zgfw_Zcxx implements Serializable {
@@ -22,22 +20,47 @@ public class Zgfw_Zcxx implements Serializable {
@Column
@Comment("编号")
@Excel(name = "资产编号", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 100)
@Excel(name = "编号", width = 30)
private String zcbh;
@Column
@Comment("名称")
@Comment("资产名称")
@Excel(name = "资产名称", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 100)
@Excel(name = "名称", width = 30)
private String zcmc;
@Column
@Comment("资产所属编码")
@Excel(name = "类别编号", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 50)
private String contentCode;
@Column
@Comment("资产所属类别")
@Excel(name = "类别名称", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 50)
private String content;
@Column
@Comment("型号")
@Excel(name = "型号规格", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 100)
@Excel(name = "型号", width = 30)
private String zcxh;
@Column
@Comment("购置日期")
@Excel(name = "购置日期", importFormat = "yyyy-MM-dd", exportFormat = "yyyy-MM-dd", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 30)
private String zcgzrq;
@Column
@Comment("数量")
@Excel(name = "数量", width = 30)
@ColDefine(type = ColType.INT)
private Integer sl;
@Column
@Comment("规格")
@ColDefine(type = ColType.VARCHAR, width = 100)
@@ -45,10 +68,27 @@ public class Zgfw_Zcxx implements Serializable {
@Column
@Comment("单价")
@ColDefine(type = ColType.FLOAT, width = 30)
@Excel(name = "单价", width = 30)
@ColDefine(type = ColType.FLOAT, width = 30)
private String zcdj;
@Column
@Comment("存放地名称")
@Excel(name = "备注(存放地点)", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zccfdmc;
@Column
@Comment("领用单位")
@Excel(name = "领用单位", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zclydwh;
@Column
@Comment("领用单位id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zclydwhid;
@Column
@Comment("厂家")
@ColDefine(type = ColType.VARCHAR, width = 100)
@@ -59,17 +99,6 @@ public class Zgfw_Zcxx implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zccch;
@Column
@Comment("购置日期")
@ColDefine(type = ColType.VARCHAR, width = 30)
@Excel(name = "购置日期", importFormat = "yyyy-MM-dd", exportFormat = "yyyy-MM-dd", width = 30)
private String zcgzrq;
@Column
@Comment("存放地名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
@Excel(name = "存放地名称", width = 30)
private String zccfdmc;
@Column
@Comment("领用人id")
@@ -78,11 +107,13 @@ public class Zgfw_Zcxx implements Serializable {
@Column
@Comment("领用人姓名")
@Excel(name = "领用人", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zclyrname;
@Column
@Comment("领用人工资号")
@Excel(name = "领用人工号", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zclyrgh;
@@ -104,60 +135,71 @@ public class Zgfw_Zcxx implements Serializable {
@Column
@Comment("入库时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
@Excel(name = "入库时间", importFormat = "yyyy-MM-dd", exportFormat = "yyyy-MM-dd", width = 30)
private String zcrksj;
@Column
@Comment("单据号")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zcdjh;
@Column
@Comment("合同号")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zchth;
@Column
@Comment("经费卡号")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zcjfkh;
@Column
@Comment("经费卡金额")
@ColDefine(type = ColType.FLOAT, width = 30)
private String zcjfkje;
@Column
@Comment("国标分类号")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String zcgbflh;
@Column
@Comment("分类号")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String zcflh;
@Column
@Comment("国别")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String zcgb;
@Column
@Comment("发票号")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zcfph;
@Column
@Comment("供货商")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zcghs;
@Column
@Comment("状态")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String zczt;
@Column
@Comment("领用单位")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zclydwh;
@Comment("盘点状态")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String pdzt;
@Column
@Comment("分工会资产、校工会资产")
@Excel(name = "资产类型(1院级工会2.校工会)", width = 30)
@ColDefine(type = ColType.VARCHAR, width = 10)
@Excel(name = "所属工会类型", width = 30)
private String zcghlx;
@Column
@Comment("数量")
@ColDefine(type = ColType.INT)
@Excel(name = "数量", width = 30)
private Integer sl;
public static Zgfw_Zcxx getDefault() {
Zgfw_Zcxx d = new Zgfw_Zcxx();
d.setZclydwh("1C08:工会");
d.setZcbh("17004130");
d.setZcmc("微型电子计算机");
d.setZcxh("R6948");
d.setZcgg("7459");
d.setZcdj(String.valueOf(9700.00f));
d.setZccj("Dell");
d.setZccch("");
d.setZcgzrq("");
d.setZczt("在用");
d.setZccfdmc("田家炳楼305");
d.setZclyrname("庄菁");
d.setZclyrgh("10010");
d.setZclyrgh("");
d.setZcjsrname("庄菁");
d.setZcrksj("");
d.setZcghlx("院级工会固定资产,工会固定资产");
d.setBz("");
return d;
}
@Column
@Comment("资产所属类别")
@ColDefine(type = ColType.VARCHAR, width = 10)
@Excel(name = "资产所属类别", width = 30)
private String contentCode;
@Column
@Comment("资产折旧到期时间")
@@ -165,12 +207,4 @@ public class Zgfw_Zcxx implements Serializable {
private Date depreciationDate;
@Column
@Comment("备注")
@ColDefine(type = ColType.VARCHAR, width = 100)
@Excel(name = "备注", width = 300)
private String bz;
}
@@ -1,143 +1,114 @@
package io.v.nutz.zhgh.zc.model;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
import java.util.List;
@Comment("资产变更信息表")
/**
* 表的字段名称以前端页面显示为准
*/
@Data
@Table("Zgfw_Zcxx_bdxx")
public class Zgfw_Zcxx_bdxx implements Serializable {
@Name
@Column
@ColDefine(type = ColType.VARCHAR,width = 32)
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
@Comment("资产变动信息id")
private String zcbdid;
@Column
@ColDefine(type = ColType.VARCHAR,width = 32)
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("资产id")
private String zcid;
@Column
@ColDefine(type = ColType.VARCHAR,width = 32)
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("原先领用人id")
private String zcoldlyrid;
@Column
@ColDefine(type = ColType.VARCHAR,width = 32)
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("原先单位id")
private String zcoldlydwh;
@Column
@ColDefine(type = ColType.VARCHAR,width = 100)
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("原先存放地点")
private String zcoldcfdmc;
@Column
@ColDefine(type = ColType.VARCHAR,width = 32)
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("现在领用人id")
private String zcnowlyrid;
@Column
@ColDefine(type = ColType.VARCHAR,width = 32)
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("现在单位id")
private String zcnowlydwh;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("现在单位id")
private String zcnowlydwhid;
@Column
@ColDefine(type = ColType.VARCHAR,width = 100)
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("现在存放地点")
private String zcnowcfdmc;
@Column
@ColDefine(type = ColType.VARCHAR,width = 20)
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("变动日期")
private String zcbdsj;
@Column
@ColDefine(type = ColType.VARCHAR,width = 32)
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("变动审核人")
private String zcbdshrid;
@Column
@Comment("入库时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String zcrksj;
public String getZcbdid() {
return zcbdid;
}
@Column
@Comment("账面价值")
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
private Integer zmjz;
public void setZcbdid(String zcbdid) {
this.zcbdid = zcbdid;
}
@Column
@Comment("联系电话")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String mobile;
public String getZcid() {
return zcid;
}
@Column
@Comment("盘点状态")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String pdzt;
public void setZcid(String zcid) {
this.zcid = zcid;
}
@Column
@Comment("未盘点原因")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String wpdzt;
public String getZcoldlyrid() {
return zcoldlyrid;
}
@Column
@Comment("状态")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String zczt;
public void setZcoldlyrid(String zcoldlyrid) {
this.zcoldlyrid = zcoldlyrid;
}
@Column
@Comment("盘点计划id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String pdPlanId;
public String getZcoldlydwh() {
return zcoldlydwh;
}
@Column
@Comment("资产照片")
@ColDefine(type = ColType.MYSQL_JSON)
private List<Sys_file> zcFile;
public void setZcoldlydwh(String zcoldlydwh) {
this.zcoldlydwh = zcoldlydwh;
}
public String getZcoldcfdmc() {
return zcoldcfdmc;
}
public void setZcoldcfdmc(String zcoldcfdmc) {
this.zcoldcfdmc = zcoldcfdmc;
}
public String getZcnowlyrid() {
return zcnowlyrid;
}
public void setZcnowlyrid(String zcnowlyrid) {
this.zcnowlyrid = zcnowlyrid;
}
public String getZcnowlydwh() {
return zcnowlydwh;
}
public void setZcnowlydwh(String zcnowlydwh) {
this.zcnowlydwh = zcnowlydwh;
}
public String getZcnowcfdmc() {
return zcnowcfdmc;
}
public void setZcnowcfdmc(String zcnowcfdmc) {
this.zcnowcfdmc = zcnowcfdmc;
}
public String getZcbdsj() {
return zcbdsj;
}
public void setZcbdsj(String zcbdsj) {
this.zcbdsj = zcbdsj;
}
public String getZcbdshrid() {
return zcbdshrid;
}
public void setZcbdshrid(String zcbdshrid) {
this.zcbdshrid = zcbdshrid;
}
}
@@ -13,7 +13,6 @@ import java.util.Date;
*/
@Data
@Table
@Comment("资产折旧记录表")
public class zcDepreciationRecord {
@Column
@@ -36,6 +35,7 @@ public class zcDepreciationRecord {
private int surplus;
@Column
@Comment("操作日期")
@ColDefine(type = ColType.VARCHAR, width = 30)
@@ -47,4 +47,12 @@ public class zcDepreciationRecord {
private Date depreciationDate;
}
@@ -11,7 +11,6 @@ import org.nutz.dao.entity.annotation.*;
*/
@Table
@Data
@Comment("资产类型")
public class zgfwZclb {
@Column
@@ -42,4 +41,5 @@ public class zgfwZclb {
private int depreciationYear;
}
@@ -22,7 +22,7 @@ public class ZgfwZcxxServiceImpl extends ViServiceImpl<Zgfw_Zcxx> implements Zgf
@Aop(TransAop.READ_COMMITTED)
public void doAddByExcelImport(Zgfw_Zcxx[] zxccList) {
for (Zgfw_Zcxx zgfw_zcxx : zxccList) {
zgfw_zcxx.setZcghlx(zgfw_zcxx.getZcghlx().equals("院级工会固定资产") ? "1" : "2");
zgfw_zcxx.setZcghlx(zgfw_zcxx.getZcghlx().equals("院级工会") ? "1" : "2");
}
dao().insert(zxccList);
}
@@ -39,11 +39,11 @@ public class ZgfwZcxxServiceImpl extends ViServiceImpl<Zgfw_Zcxx> implements Zgf
String lyr_name = zcxx.getZclyrname();
String lyr_id = getUserId(lyr_name, lyr_gh);
zcxx.setZclyrid(lyr_id);
/*
String jsr_gh = zcxx.getZcjsrgh();
String jsr_name = zcxx.getZcjsrname();
String jsr_id = getUserId(jsr_name, jsr_gh);
zcxx.setZcjsrid(jsr_id);
zcxx.setZcjsrid(jsr_id);*/
}
return zxccList;
}