作者 zhangFan

稳定版1.0.1

... ... @@ -6,6 +6,7 @@ package com.thinkgem.jeesite.modules.land.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.access.method.P;
import com.thinkgem.jeesite.common.persistence.CrudDao;
import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
... ... @@ -33,4 +34,6 @@ public interface LandBusinesstypeListDao extends CrudDao<LandBusinesstypeList> {
int deleteByMessageId(LandBusinesstypeList landBusinesstypeList);
List<LandBusinesstypeList> findByIsValid(@Param("trailerFrameNo")String frameNo, @Param("isvalid")String isValid);
}
\ No newline at end of file
... ...
... ... @@ -19,7 +19,7 @@ public class LandBusinesstypeList extends DataEntity<LandBusinesstypeList> {
private static final long serialVersionUID = 1L;
private String massageId; // 主键
private String trailerFrameNo; // 车牌号
private String trailerLicenseNo; // 车架号
private String trailerLicenseNo; // 暂用 备案单位
private String masterList; // 主单列表
private Date prodectTime; // 申请时间
private String agentno; // 货代代码
... ...
... ... @@ -20,12 +20,12 @@ public class LandRoadVeRecord extends DataEntity<LandRoadVeRecord> {
private String eportId; // 电子口岸录入号ID(电子口岸与海关数据传输使用,企业无需填写)
private String mainPort; // 主管海关代码
private String coCode; // 企业代码
private String veTargetNo; // 车牌指标编码
private String veTargetNo; // 暂用 备案单位
private String domesticLisenceNo; // 国内车牌
private String domesticLicenseColor; // 车牌颜色
private String foreignLicense; // 外籍车牌
private String veRegPlace; // 注册地址
private String veProperty; // 使用性质
private String veProperty; // 暂用 流转申请单位
private String veConveyQua; // 车辆运输资格
private String veCardNo; // 车辆行驶证编号
private String veOwnerName; // 车辆登记车主名称
... ... @@ -60,6 +60,7 @@ public class LandRoadVeRecord extends DataEntity<LandRoadVeRecord> {
private String veBottomPic; // 车底照片
private String memo; // 备注
private String proposer; // 申请人
@JsonFormat(timezone="GMT+8")
private Date proposeTime; // 申请时间
private String veClassFlag; // 车辆分类
private String operationType; // 删除标识
... ...
... ... @@ -82,4 +82,9 @@ public class LandBusinesstypeListService extends CrudService<LandBusinesstypeLis
public int deleteByMessageId(LandBusinesstypeList landBusinesstypeList) {
return dao.deleteByMessageId(landBusinesstypeList);
}
@Transactional(readOnly = false)
public List<LandBusinesstypeList> findByIsValid(String frameNo,String isValid){
return dao.findByIsValid(frameNo,isValid);
}
}
\ No newline at end of file
... ...
... ... @@ -53,5 +53,10 @@ public class LandRoadVeRecordService extends CrudService<LandRoadVeRecordDao, La
return dao.selectByFrameNo(domesticLisenceNo);
}
/*@Transactional(readOnly = false)
public List<LandRoadVeRecord> selectById(String domesticLisenceNo) {
return dao.selectByFrameNo(domesticLisenceNo);
}*/
}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@
package com.thinkgem.jeesite.modules.land.web;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;
... ... @@ -33,8 +34,11 @@ import com.thinkgem.jeesite.modules.land.entity.VehicleMainifist;
import com.thinkgem.jeesite.modules.land.service.LandBusinesstypeListService;
import com.thinkgem.jeesite.modules.land.service.LandRoadVeRecordService;
import com.thinkgem.jeesite.modules.land.service.VehicleMainifistService;
import com.thinkgem.jeesite.modules.sys.entity.Office;
import com.thinkgem.jeesite.modules.sys.entity.Role;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.security.SystemAuthorizingRealm.Principal;
import com.thinkgem.jeesite.modules.sys.service.OfficeService;
import com.thinkgem.jeesite.modules.sys.service.SystemService;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import com.thinkgem.jeesite.modules.yard.entity.Bayonet;
... ... @@ -69,6 +73,9 @@ public class LandBusinesstypeListController extends BaseController {
@Autowired
private SystemService systemService;
@Autowired
private OfficeService officeService;
private static final String TYPE1 = "调拨业务";
private static final String TYPE2 = "进口提货";
... ... @@ -94,11 +101,30 @@ public class LandBusinesstypeListController extends BaseController {
Principal principal = UserUtils.getPrincipal();
String loginName = principal.getLoginName();
User user = systemService.getUserByLoginName(loginName);
landBusinesstypeList.setCreateBy(user);
Yard yard = new Yard();
List<Yard> yardList = yardService.findList(yard);
Page<LandBusinesstypeList> page = landBusinesstypeListService
.findPage(new Page<LandBusinesstypeList>(request, response), landBusinesstypeList);
List<LandBusinesstypeList> lists = new ArrayList<LandBusinesstypeList>();
Page<LandBusinesstypeList> page = null;
if ("2".equals(user.getUserType())) {
Office office = officeService.get(user.getOffice());
List<User> u = systemService.findByOfficeId(office.getId());
for (int i = 0; i < u.size(); i++) {
landBusinesstypeList.setCreateBy(u.get(i));
page = landBusinesstypeListService
.findPage(new Page<LandBusinesstypeList>(request, response), landBusinesstypeList);
lists.addAll(page.getList());
}
} else {
Role role = systemService.getByUserId(user.getId());
if("admin".equals(role.getEnname())||"leader".equals(role.getEnname())) {
landBusinesstypeList.setCreateBy(systemService.getUserByLoginName("admin"));
}else {
landBusinesstypeList.setCreateBy(user);
}
page = landBusinesstypeListService.findPage(new Page<LandBusinesstypeList>(request, response), landBusinesstypeList);
lists.addAll(page.getList());
}
page.setList(lists);
model.addAttribute("yardList", yardList);
model.addAttribute("page", page);
return "modules/land/landBusinesstypeListList";
... ... @@ -108,30 +134,54 @@ public class LandBusinesstypeListController extends BaseController {
@RequiresPermissions("land:landBusinesstypeList:view")
@RequestMapping(value = "check")
@ResponseBody
public Page<LandRoadVeRecord> list(String frameNo) throws Exception {
Page<LandRoadVeRecord> page = new Page<LandRoadVeRecord>();
public Page<LandRoadVeRecord> list(String frameNo, LandBusinesstypeList landBusinesstypeList,
HttpServletRequest request, HttpServletResponse response) throws Exception {
LandRoadVeRecord landRoadVeRecord = new LandRoadVeRecord();
landRoadVeRecord.setDomesticLisenceNo(frameNo);
landRoadVeRecord.setCreateBy(systemService.getUserByLoginName("admin"));
Page<LandRoadVeRecord> page = roadVeService.findPage(new Page<LandRoadVeRecord>(request, response),
landRoadVeRecord);
List<LandBusinesstypeList> list = landBusinesstypeListService.findByStatus(frameNo);
List<LandRoadVeRecord> veList = roadVeService.selectByFrameNo(frameNo);
List<LandRoadVeRecord> veList = page.getList();
String userName = null;
if (veList.size() < 1) {
page.setResultMsg("此车辆未备案,请先备案");
} else {
if (list.size() > 0) {
boolean check = false;
for (int i = 0; i < list.size(); i++) {
boolean flag = (list.get(i).getContrastflag() == null
|| list.get(i).getContrastflag().length() < 1);
if ("I".equals(list.get(i).getTurnoverflag()) && flag) {
page.setResultMsg("此车辆已存在进出场业务,请勿重新申报");
} else if ("E".equals(list.get(i).getTurnoverflag()) && flag) {
page.setResultMsg("此车辆已存在进出场业务,请勿重新申报");
} else {
page.setResultMsg("此车辆可以正常申报业务");
if ("0".equals(list.get(i).getIsvalid())) {
User id = list.get(i).getCreateBy();
User ue = systemService.getUser(id.toString());
userName = ue.getName();
boolean flag = (list.get(i).getContrastflag() == null
|| list.get(i).getContrastflag().length() < 1);
if ("I".equals(list.get(i).getTurnoverflag()) && flag) {
page.setResultMsg("此车辆已存在进出场业务,请勿重新申报");
check = true;
break;
}
if ("E".equals(list.get(i).getTurnoverflag()) && flag) {
page.setResultMsg("此车辆已存在进出场业务,请勿重新申报");
check = true;
break;
}
}
break;
}
if (!check) {
page.setResultMsg("此车辆可以正常申报业务");
}
} else {
page.setResultMsg("此车辆可以正常申报业务");
}
}
for (int i = 0; i < veList.size(); i++) {
User id = veList.get(i).getCreateBy();
User ue = systemService.getUser(id.toString());
veList.get(i).setVeTargetNo(ue.getName());
veList.get(i).setVeProperty(userName);
}
page.setList(veList);
return page;
... ... @@ -175,6 +225,13 @@ public class LandBusinesstypeListController extends BaseController {
if (!beanValidator(model, landBusinesstypeList)) {
return form(landBusinesstypeList, model);
}
if(!(landBusinesstypeList.getIsvalid()!=null)) {
List<LandBusinesstypeList> lists = landBusinesstypeListService.findByIsValid(landBusinesstypeList.getTrailerFrameNo(), "0");
if(lists.size()>0) {
addMessage(redirectAttributes, "当前车辆已做出入申请,请重新录入");
return "redirect:" + Global.getAdminPath() + "/land/landBusinesstypeList/?repage";
}
}
boolean flag = false;
landBusinesstypeList.setIsDelete("0");
landBusinesstypeList.setIsvalid("0");
... ... @@ -199,7 +256,7 @@ public class LandBusinesstypeListController extends BaseController {
}
}
}
flag=true;
flag = true;
} else {
if (TYPE1.equals(landBusinesstypeList.getBusinesstype())) {
flag = insertType1(landBusinesstypeList);
... ... @@ -214,12 +271,12 @@ public class LandBusinesstypeListController extends BaseController {
flag = insertType1(landBusinesstypeList);
}
}
if(flag) {
if (flag) {
addMessage(redirectAttributes, "保存申请单成功");
}else {
} else {
addMessage(redirectAttributes, "保存申请单失败,请重新录入");
}
return "redirect:" + Global.getAdminPath() + "/land/landBusinesstypeList/?repage";
}
... ... @@ -247,6 +304,23 @@ public class LandBusinesstypeListController extends BaseController {
return "redirect:" + Global.getAdminPath() + "/land/landBusinesstypeList/?repage";
}
@RequiresPermissions("land:landBusinesstypeList:edit")
@RequestMapping(value = "update")
public String update(LandBusinesstypeList landBusinesstypeList, RedirectAttributes redirectAttributes)
throws Exception {
List<LandBusinesstypeList> list = landBusinesstypeListService.findByBarcode(landBusinesstypeList.getBarcode());
for (int i = 0; i < list.size(); i++) {
list.get(i).setIsvalid("1");
if("E".equals(list.get(i).getTurnoverflag())) {
list.get(i).setContrastflag("非正常出站");
}
landBusinesstypeListService.updateEntry(list.get(i));
}
buildBarCode.cancleBarCode(landBusinesstypeList.getTrailerFrameNo());
return "redirect:" + Global.getAdminPath() + "/land/landBusinesstypeList/?repage";
}
public boolean insertType1(LandBusinesstypeList landBusinesstypeList) {
boolean flag = false;
... ... @@ -277,6 +351,7 @@ public class LandBusinesstypeListController extends BaseController {
list.setIsDelete("0");
list.setIsvalid("0");
list.setIsfull(isfull);
list.setTrailerLicenseNo(landBusinesstypeList.getTrailerLicenseNo());
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
list.setCocode(landBusinesstypeList.getCocode());
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
... ... @@ -298,6 +373,7 @@ public class LandBusinesstypeListController extends BaseController {
list1.setIsDelete("0");
list1.setIsvalid("0");
list1.setIsfull(isfull);
list1.setTrailerLicenseNo(landBusinesstypeList.getTrailerLicenseNo());
list1.setBusinesstype(landBusinesstypeList.getBusinesstype());
list1.setCocode(landBusinesstypeList.getCocode());
list1.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
... ... @@ -321,6 +397,7 @@ public class LandBusinesstypeListController extends BaseController {
list2.setIsDelete("0");
list2.setIsvalid("0");
list2.setIsfull(isfull);
list2.setTrailerLicenseNo(landBusinesstypeList.getTrailerLicenseNo());
list2.setBusinesstype(landBusinesstypeList.getBusinesstype());
list2.setCocode(landBusinesstypeList.getCocode());
list2.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
... ... @@ -339,19 +416,26 @@ public class LandBusinesstypeListController extends BaseController {
list2.setMassageId(messageId);
landBusinesstypeListService.save(list2);
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(), messageId);
List<LandBusinesstypeList> typeList = landBusinesstypeListService.findByMessageId(messageId);
int count = 0;
for (int i = 0; i < typeList.size(); i++) {
typeList.get(i).setBarcode(barCode);
landBusinesstypeListService.updateEntry(typeList.get(i));
flag = true;
count++;
if (count == typeList.size()) {
flag = true;
}
}
if (barCode==null) {
int countType = 0;
if (barCode == null) {
List<LandBusinesstypeList> typeList1 = landBusinesstypeListService.findByMessageId(messageId);
for (int i = 0; i < typeList1.size(); i++) {
landBusinesstypeListService.deleteByMessageId(typeList1.get(i));
flag =false;
countType++;
if (countType == typeList1.size()) {
flag = false;
}
}
}
} catch (Exception e) {
... ... @@ -362,7 +446,7 @@ public class LandBusinesstypeListController extends BaseController {
}
public boolean insertType2(LandBusinesstypeList landBusinesstypeList) {
boolean flag = false;
try {
... ... @@ -382,6 +466,7 @@ public class LandBusinesstypeListController extends BaseController {
list.setIsDelete("0");
list.setIsvalid("0");
list.setIsfull(isfull);
list.setTrailerLicenseNo(landBusinesstypeList.getTrailerLicenseNo());
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
list.setCocode(landBusinesstypeList.getCocode());
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
... ... @@ -399,16 +484,24 @@ public class LandBusinesstypeListController extends BaseController {
landBusinesstypeListService.save(list);
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(), messageId);
List<LandBusinesstypeList> typeList = landBusinesstypeListService.findByMessageId(messageId);
int count = 0;
for (int i = 0; i < typeList.size(); i++) {
typeList.get(i).setBarcode(barCode);
landBusinesstypeListService.updateEntry(typeList.get(i));
flag = true;
count++;
if (count == typeList.size()) {
flag = true;
}
}
if (barCode==null) {
int countType = 0;
if (barCode == null) {
List<LandBusinesstypeList> typeList1 = landBusinesstypeListService.findByMessageId(messageId);
for (int i = 0; i < typeList1.size(); i++) {
landBusinesstypeListService.deleteByMessageId(typeList1.get(i));
flag=false;
countType++;
if (countType == typeList.size()) {
flag = false;
}
}
}
} catch (Exception e) {
... ... @@ -418,7 +511,7 @@ public class LandBusinesstypeListController extends BaseController {
}
public boolean insertType3(LandBusinesstypeList landBusinesstypeList) {
boolean flag = false;
try {
// first entry
... ... @@ -436,6 +529,7 @@ public class LandBusinesstypeListController extends BaseController {
list.setIsDelete("0");
list.setIsvalid("0");
list.setIsfull(isfull);
list.setTrailerLicenseNo(landBusinesstypeList.getTrailerLicenseNo());
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
list.setCocode(landBusinesstypeList.getCocode());
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
... ... @@ -451,19 +545,27 @@ public class LandBusinesstypeListController extends BaseController {
list.setTurnoverflag("E");
list.setMassageId(messageId);
landBusinesstypeListService.save(list);
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(), messageId);
List<LandBusinesstypeList> typeList = landBusinesstypeListService.findByMessageId(messageId);
int count = 0;
for (int i = 0; i < typeList.size(); i++) {
typeList.get(i).setBarcode(barCode);
landBusinesstypeListService.updateEntry(typeList.get(i));
flag = true;
count++;
if (count == typeList.size()) {
flag = true;
}
}
if (barCode==null) {
int countType = 0;
if (barCode == null) {
List<LandBusinesstypeList> typeList1 = landBusinesstypeListService.findByMessageId(messageId);
for (int i = 0; i < typeList1.size(); i++) {
landBusinesstypeListService.deleteByMessageId(typeList1.get(i));
flag = false;
countType++;
if (countType == typeList.size()) {
flag = false;
}
}
}
} catch (Exception e) {
... ... @@ -550,43 +652,85 @@ public class LandBusinesstypeListController extends BaseController {
public static String dateTimeFormat() {
Date dateTime = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
String str = String.valueOf(new Random().nextInt(9999)+1);
if(str.length()==1) {
str = "000"+str;
}else if(str.length()==2) {
str = "00"+str;
}else if(str.length()==3) {
str = "0"+str;
String str = String.valueOf(new Random().nextInt(9999) + 1);
if (str.length() == 1) {
str = "000" + str;
} else if (str.length() == 2) {
str = "00" + str;
} else if (str.length() == 3) {
str = "0" + str;
}
str = format.format(dateTime)+str;
str = format.format(dateTime) + str;
return str;
}
public void insertVm(String id, String frameNo, String mainfistList) {
List<VehicleMainifist> vmList = veMainService.selectByBueId(id);
if (mainfistList.length() > 0) {
String[] list = mainfistList.replace(",", ",").split(",");
if (vmList.size() > list.length) {
for (int j = 0; j < vmList.size(); j++) {
for (int i = 0; i < list.length; i++) {
if (vmList.get(j).getMainifist() != list[i]) {
veMainService.deleteEntry(vmList.get(j));
String[] list = mainfistList.replaceAll(",", ",").replaceAll("-", "").split(",");
boolean flag = vmList.size() == 0;
boolean listFlag = "".equals(list[0]);
if (listFlag) {
if (!flag) {
for (int i = 0; i < vmList.size(); i++) {
veMainService.deleteEntry(vmList.get(i));
}
}
}
if (!listFlag) {
if (flag) {
for (int i = 0; i < list.length; i++) {
VehicleMainifist vm = veMainService.selectByVm(id, list[i]);
if (vm == null) {
VehicleMainifist vehicleMainifist = new VehicleMainifist();
vehicleMainifist.setBusinessId(id);
vehicleMainifist.setBusinessNum(frameNo);
vehicleMainifist.setMainifist(list[i]);
veMainService.save(vehicleMainifist);
}
}
} else {
int count = 0;
if (vmList.size() >= list.length) {
for (int i = 0; i < vmList.size(); i++) {
System.out.println(vmList.get(i).getMainifist());
System.out.println(mainfistList.indexOf(vmList.get(i).getMainifist()) != -1);
for (int j = 0; j < list.length; j++) {
if (!(mainfistList.indexOf(vmList.get(i).getMainifist()) != -1)) {
veMainService.deleteEntry(vmList.get(i));
} else {
VehicleMainifist vm = veMainService.selectByVm(id, list[j]);
if (vm == null) {
VehicleMainifist vehicleMainifist = new VehicleMainifist();
vehicleMainifist.setBusinessId(id);
vehicleMainifist.setBusinessNum(frameNo);
vehicleMainifist.setMainifist(list[j]);
veMainService.save(vehicleMainifist);
}
}
}
VehicleMainifist vm = veMainService.selectByVm(id, list[i]);
if (vm == null) {
VehicleMainifist vehicleMainifist = new VehicleMainifist();
vehicleMainifist.setBusinessId(id);
vehicleMainifist.setBusinessNum(frameNo);
vehicleMainifist.setMainifist(list[i]);
veMainService.save(vehicleMainifist);
}
} else {
for (int i = 0; i < list.length; i++) {
for (int j = 0; j < vmList.size(); j++) {
if (!(mainfistList.indexOf(vmList.get(j).getMainifist()) != -1)) {
veMainService.deleteEntry(vmList.get(j));
} else {
VehicleMainifist vm = veMainService.selectByVm(id, list[i]);
if (vm == null) {
VehicleMainifist vehicleMainifist = new VehicleMainifist();
vehicleMainifist.setBusinessId(id);
vehicleMainifist.setBusinessNum(frameNo);
vehicleMainifist.setMainifist(list[i]);
veMainService.save(vehicleMainifist);
}
}
}
}
}
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -3,6 +3,7 @@
*/
package com.thinkgem.jeesite.modules.land.web;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
... ... @@ -26,13 +27,17 @@ import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.land.entity.LandRoadVeRecord;
import com.thinkgem.jeesite.modules.land.service.LandRoadVeRecordService;
import com.thinkgem.jeesite.modules.sys.entity.Office;
import com.thinkgem.jeesite.modules.sys.entity.Role;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.security.SystemAuthorizingRealm.Principal;
import com.thinkgem.jeesite.modules.sys.service.OfficeService;
import com.thinkgem.jeesite.modules.sys.service.SystemService;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
/**
* 汽车备案Controller
*
* @author zhangfan
* @version 2018-10-08
*/
... ... @@ -42,31 +47,68 @@ public class LandRoadVeRecordController extends BaseController {
@Autowired
private LandRoadVeRecordService landRoadVeRecordService;
@Autowired
private SystemService systemService;
@Autowired
private OfficeService officeService;
@ModelAttribute
public LandRoadVeRecord get(@RequestParam(required=false) String id) {
public LandRoadVeRecord get(@RequestParam(required = false) String id) {
LandRoadVeRecord entity = null;
if (StringUtils.isNotBlank(id)){
if (StringUtils.isNotBlank(id)) {
entity = landRoadVeRecordService.get(id);
}
if (entity == null){
if (entity == null) {
entity = new LandRoadVeRecord();
}
return entity;
}
@RequiresPermissions("land:landRoadVeRecord:view")
@RequestMapping(value = {"list", ""})
public String list(LandRoadVeRecord landRoadVeRecord, HttpServletRequest request, HttpServletResponse response, Model model) {
@RequestMapping(value = { "list", "" })
public String list(LandRoadVeRecord landRoadVeRecord, HttpServletRequest request, HttpServletResponse response,
Model model) {
Principal principal = UserUtils.getPrincipal();
String loginName = principal.getLoginName();
User user = systemService.getUserByLoginName(loginName);
landRoadVeRecord.setCreateBy(user);
Page<LandRoadVeRecord> page =
landRoadVeRecordService.findPage(new Page<LandRoadVeRecord>(request, response), landRoadVeRecord);
List<LandRoadVeRecord> lists = new ArrayList<LandRoadVeRecord>();
Page<LandRoadVeRecord> page = null;
if ("2".equals(user.getUserType())) {
Office office = officeService.get(user.getOffice());
List<User> u = systemService.findByOfficeId(office.getId());
for (int i = 0; i < u.size(); i++) {
landRoadVeRecord.setCreateBy(u.get(i));
page = landRoadVeRecordService.findPage(new Page<LandRoadVeRecord>(request, response),
landRoadVeRecord);
lists.addAll(page.getList());
}
page.setCount(lists.size());
} else {
/*
* Role role = systemService.getByUserId(user.getId()); List<Role> roles =
* systemService.findAllRole(); if("admin".equals(role.getEnname())
* ||"leader".equals(role.getEnname())) {
*
* }else { landRoadVeRecord.setCreateBy(user); }
*/
if ("3".equals(user.getUserType())) {
landRoadVeRecord.setCreateBy(user);
} else {
landRoadVeRecord.setCreateBy(systemService.getUserByLoginName("admin"));
}
page = landRoadVeRecordService.findPage(new Page<LandRoadVeRecord>(request, response), landRoadVeRecord);
lists.addAll(page.getList());
}
// List<LandRoadVeRecord> list = page.getList();
for (int i = 0; i < lists.size(); i++) {
User id = lists.get(i).getCreateBy();
User ue = systemService.getUser(id.toString());
lists.get(i).setVeTargetNo(ue.getName());
}
page.setList(lists);
model.addAttribute("page", page);
return "modules/land/landRoadVeRecordList";
}
... ... @@ -81,52 +123,49 @@ public class LandRoadVeRecordController extends BaseController {
@RequiresPermissions("land:landRoadVeRecord:edit")
@RequestMapping(value = "save")
public String save(LandRoadVeRecord landRoadVeRecord, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, landRoadVeRecord)){
if (!beanValidator(model, landRoadVeRecord)) {
return form(landRoadVeRecord, model);
}
String barcode = landRoadVeRecord.getBarcode();
if(barcode ==null) {
String barCode = buildBarCode.crateCar(landRoadVeRecord);
// String barCode = "111";
if("0".equals(barCode)) {
landRoadVeRecord.setReturnmessage("备案成功");
}else {
landRoadVeRecord.setReturnmessage("备案失败");
}
landRoadVeRecord.setBarcode(barCode);
String barCode = buildBarCode.crateCar(landRoadVeRecord);
// String barCode = "111";
if ("0".equals(barCode)) {
landRoadVeRecord.setReturnmessage("备案成功");
} else {
landRoadVeRecord.setReturnmessage("备案失败");
}
if(landRoadVeRecord.getProposeTime()==null) {
landRoadVeRecord.setBarcode(barCode);
if (landRoadVeRecord.getProposeTime() == null) {
landRoadVeRecord.setProposeTime(new Date());
}
landRoadVeRecordService.save(landRoadVeRecord);
addMessage(redirectAttributes, "保存备案成功");
return "redirect:"+Global.getAdminPath()+"/land/landRoadVeRecord/?repage";
return "redirect:" + Global.getAdminPath() + "/land/landRoadVeRecord/?repage";
}
@RequiresPermissions("land:landRoadVeRecord:edit")
@RequestMapping(value = "delete")
public String delete(LandRoadVeRecord landRoadVeRecord, RedirectAttributes redirectAttributes) {
landRoadVeRecordService.delete(landRoadVeRecord);
buildBarCode.cancleCar(landRoadVeRecord);
addMessage(redirectAttributes, "删除备案成功");
return "redirect:"+Global.getAdminPath()+"/land/landRoadVeRecord/?repage";
return "redirect:" + Global.getAdminPath() + "/land/landRoadVeRecord/?repage";
}
@RequiresPermissions("land:landRoadVeRecord:edit")
@RequestMapping(value = "selectByVeName")
@ResponseBody
public Page<LandRoadVeRecord> selectByVeName(String veName){
public Page<LandRoadVeRecord> selectByVeName(String veName) {
Page<LandRoadVeRecord> page = new Page<LandRoadVeRecord>();
Principal principal = UserUtils.getPrincipal();
String loginName = principal.getLoginName();
User user = systemService.getUserByLoginName(loginName);
List<LandRoadVeRecord> veList = landRoadVeRecordService.selectByFrameNo(veName);
if(veList.size()>0) {
if (veList.size() > 0) {
page.setCount(1L);
}
return page;
}
}
\ No newline at end of file
... ...
... ... @@ -36,5 +36,12 @@ public interface RoleDao extends CrudDao<Role> {
public int deleteRoleOffice(Role role);
public int insertRoleOffice(Role role);
/**
* 根据userID获取相对应的角色
* @param id
* @return
*/
public Role getByUserId(String id);
}
... ...
... ... @@ -71,5 +71,12 @@ public interface UserDao extends CrudDao<User> {
* @return
*/
public int updateUserInfo(User user);
/**
* 根据部门号查询当前部门下所有用户,用于数据查询,当前用户为部门经理时使用
* @param id
* @return
*/
public List<User> findByOfficeId(String id);
}
... ...
... ... @@ -408,6 +408,16 @@ public class SystemService extends BaseService implements InitializingBean {
return true;
}
@Transactional(readOnly = false)
public List<User> findByOfficeId(String id){
List<User> list = userDao.findByOfficeId(id);
return list;
}
public Role getByUserId(String id) {
return roleDao.getByUserId(id);
}
///////////////// Synchronized to the Activiti //////////////////
// 已废弃,同步见:ActGroupEntityServiceFactory.java、ActUserEntityServiceFactory.java
... ...
... ... @@ -10,11 +10,11 @@
#jdbc.password=123456
#mysql database setting
#jdbc.type=mysql
#jdbc.driver=com.mysql.cj.jdbc.Driver
#jdbc.url=jdbc:mysql://10.50.7.70:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
#jdbc.username=station
#jdbc.password=station@10.50.7.70
jdbc.type=mysql
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://10.50.7.70:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
jdbc.username=station
jdbc.password=station@10.50.7.70
#jdbc.type=mysql
#jdbc.driver=com.mysql.cj.jdbc.Driver
... ... @@ -22,11 +22,11 @@
#jdbc.username=kako
#jdbc.password=mysql10.50.7.10
jdbc.type=mysql
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/station?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
jdbc.username=root
jdbc.password=root
#jdbc.type=mysql
#jdbc.driver=com.mysql.cj.jdbc.Driver
#jdbc.url=jdbc:mysql://localhost:3306/station?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
#jdbc.username=root
#jdbc.password=root
#mssql database settings
#jdbc.type=mssql
... ...
... ... @@ -91,10 +91,10 @@
<include refid="landBusinesstypeListJoins"/>
<where>
a.is_delete = "0"
<if test='trailerFrameNo !="1" and trailerFrameNo !=null and trailerFrameNo !=""'>
<if test='trailerFrameNo !=null and trailerFrameNo !=""'>
and trailer_frame_no = #{trailerFrameNo}
</if>
<if test='(createBy.id !="1" and createBy.id !=null and createBy.id !="")'>
<if test='createBy.id !="1" and createBy.id !=null and createBy.id !=""'>
and create_by = #{createBy.id}
</if>
<if test="endstation !=null and endstation !=''">
... ... @@ -120,6 +120,39 @@
</choose>
</select>
<select id="findByUserType" resultType="LandBusinesstypeList">
SELECT
<include refid="landBusinesstypeListColumns"/>
FROM land_businesstype_list a
<include refid="landBusinesstypeListJoins"/>
<where>
a.is_delete = "0"
<if test='trailerFrameNo !=null and trailerFrameNo !=""'>
and trailer_frame_no = #{trailerFrameNo}
</if>
<if test="endstation !=null and endstation !=''">
and endstation = #{endstation}
</if>
<if test="contrastflag !=null and contrastflag !=''">
and contrastflag = #{contrastflag}
</if>
<if test="aisle !=null and aisle !=''">
and aisle = #{aisle}
</if>
<if test="agentname !=null and agentname !=''">
and agentname like "%"#{agentname}"%"
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.update_date DESC
</otherwise>
</choose>
</select>
<select id="findAllList" resultType="LandBusinesstypeList">
SELECT
<include refid="landBusinesstypeListColumns"/>
... ... @@ -137,7 +170,10 @@
</otherwise>
</choose>
</select>
<select id="findByIsValid" resultType="LandBusinesstypeList">
select * from land_businesstype_list
WHERE trailer_frame_no =#{trailerFrameNo} AND isvalid=#{isvalid}
</select>
<update id="deleteByBarcode" parameterType="java.lang.String">
UPDATE land_businesstype_list set is_delete = "1",isvalid = "1"
WHERE barcode = #{barcode}
... ...
... ... @@ -82,10 +82,10 @@
FROM land_road_ve_record a
<include refid="landRoadVeRecordJoins"/>
<trim prefix="WHERE" prefixOverrides="and">
<if test='domesticLisenceNo !="1" and domesticLisenceNo !=null and domesticLisenceNo !=""'>
<if test='domesticLisenceNo !=null and domesticLisenceNo !=""'>
and domestic_lisence_no = #{domesticLisenceNo}
</if>
<if test='createBy.id !="1" and createBy.id !=null and createBy.id !=""'>
<if test='createBy.id !="1"and createBy.id !=null and createBy.id !=""'>
and create_by = #{createBy.id}
</if>
</trim>
... ...
... ... @@ -70,6 +70,15 @@
ORDER BY a.code
</select>
<select id="findById" resultType="Office">
SELECT
<include refid="officeColumns"/>
FROM sys_office a
<include refid="officeJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.code
</select>
<select id="findByParentIdsLike" resultType="Office">
SELECT
<include refid="officeColumns"/>
... ...
... ... @@ -84,6 +84,11 @@
WHERE a.name = #{name} AND a.del_flag = #{DEL_FLAG_NORMAL}
</select>
<select id="getByUserId" resultType="Role">
SELECT r.* FROM sys_role r,sys_user u,sys_user_role ur
WHERE r.id = ur.role_id AND u.id=ur.user_id AND u.id=#{id};
</select>
<select id="getByEnname" resultType="Role">
SELECT
<include refid="roleColumns"/>
... ...
... ... @@ -201,10 +201,16 @@
a.id, a.name, a.login_name
FROM sys_user a
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
AND a.office_id = #{office.id}
AND a.office_id = #{office.id}
ORDER BY a.name
</select>
<select id="findByOfficeId" resultType="User">
SELECT sys_user.id FROM sys_user
WHERE office_id = #{id} AND user_type !="1"
ORDER BY id
</select>
<!-- 查询全部用户 -->
<select id="findAllList" resultType="User">
SELECT
... ...
... ... @@ -66,7 +66,7 @@ th, td {
<div class="control-group">
<label class="control-label">主单号:</label>
<div class="controls">
<input type="text" name="coCode" placeholder="请输入主单号,例如172-12341234"
<input type="text" name="coCode" placeholder="请输入主单号,例如17212341234"
autocomplete="off" class="input-xxlarge" id="putMaster">
<button class="btn btn-primary" id="select">查询</button>
<span class="help-inline"><font color="red">查询单号前请先选定业务类型</font>
... ... @@ -171,7 +171,27 @@ th, td {
</div>
</div>
</div>
<div class="control-group" style="display:none">
<div class="control-group">
<div class="row-fluid">
<div class="span12">
<div class="span6">
<label class="control-label">备案单位:</label>
<div class="controls" >
<form:input path="trailerLicenseNo" htmlEscape="false" maxlength="32"
class="input-xlarge ReadOnly" id="veTargetNo" readonly="true"/>
</div>
</div>
<div class="span6">
<label class="control-label">当前业务申请单位:</label>
<div class="controls" >
<form:input path="" htmlEscape="false" maxlength="32"
class="input-xlarge ReadOnly" id="businessPro" readonly="true"/>
</div>
</div>
</div>
</div>
</div>
<%-- <div class="control-group" style="display:none">
<div class="row-fluid">
<div class="span12">
<div class="span6">
... ... @@ -190,7 +210,7 @@ th, td {
</div>
</div>
</div>
</div>
</div> --%>
<div class="control-group">
<div class="row-fluid">
<div class="span12">
... ... @@ -291,7 +311,7 @@ th, td {
<label class="control-label">主单列表:</label>
<div class="controls">
<form:textarea path="masterList" rows="5" maxlength="1000" id="masterList"
placeholder="请输入主单号,例如172-12341234,多个单号以“,”(英文)分割"
placeholder="请输入主单号,例如17212341234,多个单号以“,”(英文)分割"
class="input-xxlarge textarea" />
</div>
</div>
... ... @@ -318,9 +338,7 @@ th, td {
})
$("#masterList").blur(function(){
var masterList = $("#masterList").val();
if(masterList.indexOf(",")!=-1){
$("#masterList").val(masterList.replace(/,/g,","));
}
$("#masterList").val(masterList.replace(/\,/g,",").replace(/\-/g,""));
})
$("#frameNo").blur(function(){
var frameNo = $("#frameNo").val();
... ... @@ -338,16 +356,19 @@ th, td {
$("#agentno").val(data.list[0].coCode)
$("#driverid").val(data.list[0].veOwnerNo)
$("#drivername").val(data.list[0].veOwnerName)
$("#veTargetNo").val(data.list[0].veTargetNo)
$("#businessPro").val(data.list[0].veProperty)
if(str.indexOf("已存在进出场")!=-1){
$("#btnAll").css("display","none");
}
}
if(data.list ==undefined){
$("#agentName").val("");
$("#agentno").val("");
$("#driverid").val("");
$("#drivername").val("");
$("#veTargeNo").val("");
$("#businessPro").val("");
}
if(str.indexOf("车辆未备案")!=-1){
$("#btnAll").css("display","none");
... ...
... ... @@ -67,12 +67,12 @@
<form:option value="" label="--请选择--" />
</form:select>
<label>是否出站</label>
<%-- <label>是否出站</label>
<form:select path="contrastflag" class="input">
<form:option value="" label="--请选择--" />
<form:option value="已进站" label="已进站" />
<form:option value="已出站" label="已出站" />
</form:select>
</form:select> --%>
</li>
<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
... ... @@ -83,9 +83,9 @@
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<shiro:hasRole name="dept">
<shiro:hasAnyRoles name="dept,admin,leader">
<th>操作</th>
</shiro:hasRole>
</shiro:hasAnyRoles>
<th>车牌号</th>
<th>挂靠单位</th>
<th>目的海关代码</th>
... ... @@ -93,6 +93,8 @@
<th>卡口</th>
<th>地磅称重</th>
<th>总货重</th>
<th>进出差值</th>
<th>备案车重</th>
<th>业务类型</th>
<th>二维码编号</th>
<th>进出场站</th>
... ... @@ -104,11 +106,11 @@
<tbody>
<c:forEach items="${page.list}" var="landBusinesstypeList">
<tr>
<shiro:hasRole name="dept">
<shiro:hasAnyRoles name="dept,admin,leader">
<td>
<a href="${ctx}/land/landBusinesstypeList/form?id=${landBusinesstypeList.id}">查看</a>
</td>
</shiro:hasRole>
</shiro:hasAnyRoles>
<td>${landBusinesstypeList.trailerFrameNo}</td>
<td>${landBusinesstypeList.agentname}</td>
<td>${landBusinesstypeList.endport}</td>
... ... @@ -129,6 +131,8 @@
</td>
<td>${landBusinesstypeList.aislewt}</td>
<td>${landBusinesstypeList.remark}</td>
<td>${landBusinesstypeList.remark1}</td>
<td>${landBusinesstypeList.remark2}</td>
<td>${landBusinesstypeList.businesstype}</td>
<td>${landBusinesstypeList.barcode}</td>
<td>
... ... @@ -143,6 +147,9 @@
<c:if test="${landBusinesstypeList.contrastflag==null ||landBusinesstypeList.contrastflag==''}">
<a href="${ctx}/land/landBusinesstypeList/form?id=${landBusinesstypeList.id}">修改</a>
<a href="${ctx}/land/landBusinesstypeList/delete?id=${landBusinesstypeList.id}" onclick="return confirmx('确认要删除该流转吗?', this.href)">删除</a>
<shiro:hasAnyRoles name="dept,admin.leader">
<a href="${ctx}/land/landBusinesstypeList/update?id=${landBusinesstypeList.id}" onclick="return confirmx('确认要更新异常吗?', this.href)">异常处理</a>
</shiro:hasAnyRoles>
</c:if>
</td></shiro:hasPermission>
</tr>
... ...
... ... @@ -126,10 +126,10 @@ input {
</span>
<label class="row-lable">行驶证有效期:</label>
<span class="row-controls">
<input name="VE_FACTORY_DATE" type="text" readonly="readonly"
<input name="veFactoryDate" type="text"
maxlength="20" class="input-medium Wdate required"
value="<fmt:formatDate value="${landRoadVeRecord.proposeTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" />
value="<fmt:formatDate value="${landRoadVeRecord.veFactoryDate}" pattern="yyyy-MM-dd"/>"
onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
<span class="help-inline"><font color="red">*</font></span>
</span>
</div>
... ...
... ... @@ -39,6 +39,7 @@
<tr>
<th>运输公司名称</th>
<th>挂靠单位</th>
<th>备案单位</th>
<th>国内车牌</th>
<th>车主姓名</th>
<th>车主联系方式</th>
... ... @@ -55,6 +56,7 @@
<tr>
<td>${landRoadVeRecord.coCode }</td>
<td>${landRoadVeRecord.proposer }</td>
<td>${landRoadVeRecord.veTargetNo }</td>
<td>${landRoadVeRecord.domesticLisenceNo }</td>
<td>${landRoadVeRecord.veOwnerName }</td>
<td>${landRoadVeRecord.ownerInsideTel }</td>
... ... @@ -67,9 +69,9 @@
</a></td>
<shiro:hasPermission name="land:landRoadVeRecord:edit"><td>
<a href="${ctx}/land/landRoadVeRecord/form?id=${landRoadVeRecord.id}">修改</a>
<shiro:hasRole name="dept">
<shiro:hasAnyRoles name="dept,admin,leader">
<a href="${ctx}/land/landRoadVeRecord/delete?id=${landRoadVeRecord.id}" onclick="return confirmx('确认要删除该备案吗?', this.href)">删除</a>
</shiro:hasRole>
</shiro:hasAnyRoles>
</td></shiro:hasPermission>
</tr>
</c:forEach>
... ...