This commit is contained in:
jishenghua
2024-04-02 14:29:38 +08:00
9 changed files with 46 additions and 53 deletions

View File

@@ -996,11 +996,7 @@ public class DepotHeadService {
String.format(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_MSG, 4));
}
}
try{
depotHeadMapper.insertSelective(depotHead);
}catch(Exception e){
JshException.writeFail(logger, e);
}
depotHeadMapper.insertSelective(depotHead);
/**入库和出库处理预付款信息*/
if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())){
if(depotHead.getOrganId()!=null) {
@@ -1094,11 +1090,7 @@ public class DepotHeadService {
String.format(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_MSG, 4));
}
}
try{
depotHeadMapper.updateByPrimaryKeySelective(depotHead);
}catch(Exception e){
JshException.writeFail(logger, e);
}
depotHeadMapper.updateByPrimaryKeySelective(depotHead);
//如果存在多账户结算需要将原账户的id置空
if(StringUtil.isNotEmpty(depotHead.getAccountIdList())) {
depotHeadMapperEx.setAccountIdToNull(depotHead.getId());
@@ -1311,7 +1303,7 @@ public class DepotHeadService {
billListCacheVo.setOrganName(dh.getOrganName());
billListCacheVo.setOperTimeStr(getCenternTime(dh.getOperTime()));
billListCacheVoMap.put(dh.getId(), billListCacheVo);
String[] objs = new String[100];
String[] objs = new String[sheetOneArr.length];
objs[0] = dh.getOrganName();
objs[1] = dh.getNumber();
objs[2] = dh.getLinkNumber();
@@ -1328,7 +1320,7 @@ public class DepotHeadService {
objs[10] = dh.getRemark();
billList.add(objs);
}
ExcelUtils.exportObjectsWithTitle(wtwb, oneTip, sheetOneArr, "单据列表", 0, billList);
ExcelUtils.exportObjectsManySheet(wtwb, oneTip, sheetOneArr, "单据列表", 0, billList);
//导出明细数据
if(idList.size()>0) {
List<DepotItemVo4WithInfoEx> dataList = depotItemMapperEx.getBillDetailListByIds(idList);
@@ -1349,7 +1341,7 @@ public class DepotHeadService {
String[] sheetTwoArr = StringUtil.listToStringArray(sheetTwoList);
List<String[]> billDetail = new ArrayList<>();
for (DepotItemVo4WithInfoEx diEx : dataList) {
String[] objs = new String[100];
String[] objs = new String[sheetTwoArr.length];
BillListCacheVo billListCacheVo = billListCacheVoMap.get(diEx.getHeaderId());
objs[0] = billListCacheVo != null ? billListCacheVo.getOrganName() : "";
objs[1] = billListCacheVo != null ? billListCacheVo.getNumber() : "";
@@ -1377,7 +1369,7 @@ public class DepotHeadService {
objs[22] = diEx.getRemark();
billDetail.add(objs);
}
ExcelUtils.exportObjectsWithTitle(wtwb, twoTip, sheetTwoArr, "单据明细", 1, billDetail);
ExcelUtils.exportObjectsManySheet(wtwb, twoTip, sheetTwoArr, "单据明细", 1, billDetail);
}
wtwb.write();
wtwb.close();

View File

@@ -507,7 +507,7 @@ public class MaterialService {
List<String[]> objects = new ArrayList<>();
if (null != dataList) {
for (MaterialVo4Unit m : dataList) {
String[] objs = new String[100];
String[] objs = new String[names.length];
objs[0] = m.getName();
objs[1] = m.getStandard();
objs[2] = m.getModel();
@@ -544,7 +544,7 @@ public class MaterialService {
objects.add(objs);
}
}
File file = ExcelUtils.exportObjectsWithoutTitle(title, "*导入时本行内容请勿删除,切记!", names, title, objects);
File file = ExcelUtils.exportObjectsOneSheet(title, "*导入时本行内容请勿删除,切记!", names, title, objects);
ExcelUtils.downloadExcel(file, file.getName(), response);
}

View File

@@ -582,7 +582,7 @@ public class SupplierService {
List<String[]> objects = new ArrayList<String[]>();
if (null != dataList) {
for (Supplier s : dataList) {
String[] objs = new String[10];
String[] objs = new String[names.length];
objs[0] = s.getSupplier();
objs[1] = s.getContacts();
objs[2] = s.getTelephone();
@@ -594,7 +594,7 @@ public class SupplierService {
objects.add(objs);
}
}
return ExcelUtils.exportObjectsWithoutTitle(title, "*导入时本行内容请勿删除,切记!", names, title, objects);
return ExcelUtils.exportObjectsOneSheet(title, "*导入时本行内容请勿删除,切记!", names, title, objects);
}
}
@@ -611,7 +611,7 @@ public class SupplierService {
List<String[]> objects = new ArrayList<String[]>();
if (null != dataList) {
for (Supplier s : dataList) {
String[] objs = new String[20];
String[] objs = new String[names.length];
objs[0] = s.getSupplier();
objs[1] = s.getContacts();
objs[2] = s.getTelephone();
@@ -634,7 +634,7 @@ public class SupplierService {
objects.add(objs);
}
}
return ExcelUtils.exportObjectsWithoutTitle(title, "*导入时本行内容请勿删除,切记!", names, title, objects);
return ExcelUtils.exportObjectsOneSheet(title, "*导入时本行内容请勿删除,切记!", names, title, objects);
}
/**

View File

@@ -504,7 +504,7 @@ public class SystemConfigService {
if (null != arr) {
for (Object object: arr) {
List<Object> list = (List<Object>) object;
String[] objs = new String[100];
String[] objs = new String[names.length];
for (int i = 0; i < list.size(); i++) {
if(null != list.get(i)) {
objs[i] = list.get(i).toString();
@@ -513,7 +513,7 @@ public class SystemConfigService {
objects.add(objs);
}
}
File file = ExcelUtils.exportObjectsWithoutTitle(title, tip, names, title, objects);
File file = ExcelUtils.exportObjectsOneSheet(title, tip, names, title, objects);
ExcelUtils.downloadExcel(file, file.getName(), response);
}
}

View File

@@ -45,9 +45,8 @@ public class ExcelUtils {
* @return
* @throws Exception
*/
public static void exportObjectsWithTitle(WritableWorkbook wtwb, String tip,
String[] names, String title, int index, List<String[]> objects)
throws Exception {
public static void exportObjectsManySheet(WritableWorkbook wtwb, String tip,
String[] names, String title, int index, List<String[]> objects) throws Exception {
WritableSheet sheet = wtwb.createSheet(title, index);
sheet.getSettings().setDefaultColumnWidth(12);
@@ -72,6 +71,7 @@ public class ExcelUtils {
WritableCellFormat format = new WritableCellFormat(wfont);
format.setAlignment(Alignment.LEFT);
format.setVerticalAlignment(VerticalAlignment.TOP);
format.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
// 第一行写入提示
if(com.jsh.erp.utils.StringUtil.isNotEmpty(tip) && tip.contains("*")) {
@@ -101,7 +101,7 @@ public class ExcelUtils {
}
/**
* 导出excel不需要第一行的title
* 导出excel带单个sheet
*
* @param fileName
* @param names
@@ -110,9 +110,8 @@ public class ExcelUtils {
* @return
* @throws Exception
*/
public static File exportObjectsWithoutTitle(String fileName, String tip,
String[] names, String title, List<String[]> objects)
throws Exception {
public static File exportObjectsOneSheet(String fileName, String tip,
String[] names, String title, List<String[]> objects) throws Exception {
File excelFile = new File("/opt/"+ fileName);
WritableWorkbook wtwb = Workbook.createWorkbook(excelFile);
WritableSheet sheet = wtwb.createSheet(title, 0);
@@ -120,16 +119,14 @@ public class ExcelUtils {
// 标题的格式-红色
WritableFont redWF = new WritableFont(WritableFont.ARIAL, 12,
WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE,
Colour.RED);
WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.RED);
WritableCellFormat redWFFC = new WritableCellFormat(redWF);
redWFFC.setVerticalAlignment(VerticalAlignment.CENTRE);
redWFFC.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
// 标题的格式-黑色
WritableFont blackWF = new WritableFont(WritableFont.ARIAL, 12,
WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE,
Colour.BLACK);
WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
WritableCellFormat blackWFFC = new WritableCellFormat(blackWF);
blackWFFC.setVerticalAlignment(VerticalAlignment.CENTRE);
blackWFFC.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
@@ -139,6 +136,7 @@ public class ExcelUtils {
WritableCellFormat format = new WritableCellFormat(wfont);
format.setAlignment(Alignment.LEFT);
format.setVerticalAlignment(VerticalAlignment.TOP);
format.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
// 第一行写入提示
if(StringUtil.isNotEmpty(tip) && tip.contains("*")) {

View File

@@ -610,16 +610,16 @@
FROM jsh_material m
left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_material_current_stock mcs on m.id = mcs.material_id and ifnull(mcs.delete_flag,'0') !='1'
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
where 1=1
and me.default_flag=1
<if test="depotList.size()>0">
and mcs.depot_id in
<foreach collection="depotList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
where 1=1
and me.default_flag=1
<if test="idList.size()>0">
and m.category_id in
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
@@ -655,16 +655,16 @@
(select m.id, ifnull(sum(mcs.current_number),0) currentStock from jsh_material m
left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_material_current_stock mcs on m.id = mcs.material_id and ifnull(mcs.delete_flag,'0') !='1'
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
where 1=1
and me.default_flag=1
<if test="depotList.size()>0">
and mcs.depot_id in
<foreach collection="depotList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
where 1=1
and me.default_flag=1
<if test="idList.size()>0">
and m.category_id in
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">

View File

@@ -153,8 +153,7 @@
</select>
<update id="updateUserWithWeixinOpenId">
update jsh_user u set u.weixin_open_id = #{weixinOpenId}
where u.login_name = #{loginName} and u.password = #{password}
and ifnull(u.status,'0') not in('1','2')
update jsh_user u set u.weixin_open_id = null where u.weixin_open_id = #{weixinOpenId};
update jsh_user u set u.weixin_open_id = #{weixinOpenId} where u.login_name = #{loginName} and u.password = #{password} and ifnull(u.status,'0') not in('1','2');
</update>
</mapper>